ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42030] - Class-Path attribute is not merged in the proper order in <manifest>
Date Sat, 02 Jun 2007 14:05:47 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42030>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42030





------- Additional Comments From peterreilly@apache.org  2007-06-02 07:05 -------
Thanks for the example.
There is a couple of bugs with the build file.
1) if you do a jar tf on test.jar, you will see that
   the jar file does not include any classes.
2) the Main-Class is set to Test and not to  edu.bu.cs.snbench.snafuc.Test
3) (minor) the classpath ref in the build file may include
   the created jar file (not good practice).

1) is due to the <include> nested element in the <jar> task,
   it is not needed and in its current form will only include the
   directory and not the contents.

I am including a new build file that fixes these issues:
project name="test" default="test" basedir=".">
  <path id="classpath">
    <fileset dir=".">
      <include name="*.jar" />
    </fileset>
  </path>
  
  <target name="test">
    <mkdir dir="bin"/>
    <javac srcdir="."
	   destdir="bin"
	   deprecation="true"
	   debug="true"
	   debuglevel="lines,vars,source"
	   classpath="commons-cli-1.0.jar">
      <include name="*.java" />
    </javac>
    <mkdir dir="META-INF" />
    <jar destfile="test.jar"
	 basedir="bin"
       >
      <!--<include name="edu" /> -->
      <manifest>
	<attribute name="Class-Path"
		   value="commons-cli-1.0.jar" />
	<attribute name="Main-Class"
		   value="edu.bu.cs.snbench.snafuc.Test" />
      </manifest>
    </jar>
    <delete dir="META-INF" />
  </target>
  <target name="clean">
    <delete dir="bin"/>
    <delete>
      <fileset dir="." includes="test.jar"/>
    </delete>
  </target>
</project>

Looking at your original build.xml, I see the same problem
  <include name="edu/bu/cs/snbench/snafuc/snafugg/*" />
  <include name="edu/bu/cs/snbench/snafuc/SnBenchTypes.class" />

either drop the <include> or do <include name="edu/**"/>
(note the two **'s)




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message