2011-08-24 2 views
6

입니다. 개미 1.8.0을 자세한 모드로 실행 중입니다. Implementation-Title, -Version 및 -Vendor가 포함 된 매니페스트를 만들었고 결과 JAR에 포함 된 매니페스트가 포함되어 있습니다. JAR 클래스는 정상적으로 실행됩니다. 그러나 개미의 출력은ant claims Implementation-Title/Version/Vendor가 설정되지 않았지만, 그것들은

[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> 
+0

매니페스트는 어떻게 작성하고 있습니까? 손으로 만들었나요 아니면 Ant의 jar 작업의 매니 페스트 중첩 요소를 사용하고 있습니까? 매니페스트 파일의 내용을 게시 할 수 있습니까? –

+0

고마워, 케빈. 매니페스트가 어떻게 만들어지고 소비되는지를 볼 수 있도록 개미 코드를 추가했습니다. –

답변

4

나는 문제가 중첩 된 부분의 자녀 인 반대로 속성, 매니페스트 요소의 자식으로 정의해야한다고 생각합니다. 어쩌면 차이를 만들 것입니다 인라인 매니페스트 요소를 사용하여 업데이트

. 다음 스 니펫은 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> 
+0

섹션 계층을 제거해도 문제가 해결되지 않았습니다. 더욱이, 나는 이것이 명령 행에서 어긋나지 않는 것을 관찰한다. 아마도이 개미를 실행하는 이클립스의 특질 일까? –

+0

다른 점은 별도의 매니페스트 요소 대신 jar 작업에서 인라인 매니페스트 요소를 사용하는 것입니다. 답변이 위에 업데이트되었습니다. –

+0

빙고! Eclipse에서 작동합니다. 감사. –

관련 문제