ant jar's mainclass

孤街醉人 提交于 2019-12-10 01:02:36

问题


how do i set the Main-Class attribute of my jar in ant?


回答1:


Create a manifest:

<manifest file="build/MANIFEST.MF">
  <attribute name="Main-Class"
             value="foo.FooMain" />
</manifest>
<jar destfile="build/foo.jar"
     manifest="build/MANIFEST.MF">
  <fileset dir="build/classes" />
</jar>



回答2:


You can specify it in the manifest by using the Manifest nested element of the Jar task. Set Main-Class to the required class.



来源:https://stackoverflow.com/questions/2165311/ant-jars-mainclass

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!