我在详细模式下运行ant 1.8.0.我创建了一个包含Implementation-Title,-Version和-Vendor的清单,生成的JAR包含一个包含其中的清单.JAR的课程运行良好.然而,蚂蚁的输出说
[jar] No Implementation-Title set.No Implementation-Version set.No Implementation-Vendor set.
这只是蚂蚁中的一个错误,还是我在这里遗漏了什么?
谢谢
这是我的蚂蚁代码:
<?xml version="1.0" encoding="UTF-8"?>
<project name="helloworld.makejar" default="makejar" basedir=".">
<target name ="makejar" description="Create a JAR for the HelloWorld project">
<delete file="helloworld.jar" />
<delete file="MANIFEST.MF" />
<manifest file="MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="project.builder.example.HelloWorld" />
<section name="common">
<attribute name="Specification-Title" value="Example" />
<attribute name="Specification-Version" value="1.0.0" />
<attribute name="Specification-Vendor" value="Example Organization" />
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="1.0.0 today" />
<attribute name="Implementation-Vendor" value="Acme Corp." />
</section>
</manifest>
<jar jarfile="helloworld.jar"
includes="**/*.class"
basedir="bin"
manifest="MANIFEST.MF"
/>
</target>
<javac srcdir="src" destdir="bin" />
</project>
Run Code Online (Sandbox Code Playgroud)
我认为问题是必须将属性定义为清单元素的子元素,而不是嵌套部分的子元素.
更新
也许使用内联清单元素会产生影响.以下代码段来自Ant文档:
<jar destfile="test.jar" basedir=".">
<include name="build"/>
<manifest>
<!-- Who is building this jar? -->
<attribute name="Built-By" value="${user.name}"/>
<!-- Information about the program itself -->
<attribute name="Implementation-Vendor" value="ACME inc."/>
<attribute name="Implementation-Title" value="GreatProduct"/>
<attribute name="Implementation-Version" value="1.0.0beta2"/>
<!-- details -->
<section name="common/MyClass.class">
<attribute name="Sealed" value="false"/>
</section>
</manifest>
</jar>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2230 次 |
| 最近记录: |