我正在使用 ANT 创建.jar
文件。这是我的build.xml
:
<?xml version="1.0"?>
<project name="stack_overflow" default="info">
<target name="info">
<jar destfile="util.jar" includes="com/appl/constants">
<manifest>
<attribute name="Main-Class"
value="com.appl.constants.Applicationinfo.class"/>
</manifest>
</jar>
</target>
</project>
当我运行ant jar
时,util.jar
会生成文件,但其中只有 manifest.mf。
这是我得到的错误:
Buildfile: C:\Users\Srikrishna\workspace\SpringExample5\build\build.xml
info:
[jar] Building MANIFEST-only jar: C:\Users\Srikrishna\workspace\
SpringExample5\build\${web.dir}\lib\util.jar
BUILD FAILED
C:\Users\Srikrishna\workspace\SpringExample5\build\build.xml:5:
Could not create almost empty JAR archive (
C:\Users\Srikrishna\workspace\SpringExample5\build\${web.dir}\lib\util.jar
(The system cannot find the path specified))
Total time: 200 milliseconds
我的文件夹结构是:
src
|
com.appl.constants
|
Applicationinfo.class
为什么我的罐子里什么都没有?