Community
Participate
Working Groups
We develop with JDT and finally create the WARs and JARs to distribute with ANT inside Eclipse. Thus we have two independent Classpaths to keep in sync: the one in the Eclipse Project and the one in the ANT build file -- that's rather tedious and annoying. It should be trivial to make the classpath of the project available a s a variable, so that we would only need to export that variable to ANT and include in our build-files. Looking for a solution i couldn't help to notice, that the demand is overwhelming and hardly covered by insufficient and unsatisfying attempts like antclipse or ant4eclipse (which both don't work, at least here with galileo). -- Configuration Details -- Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.jee.product) Installed Features: org.eclipse.jdt 3.6.2.r362_v20100929-7z8XFUUFLFlmgNd019WRcD5LVkHD
Please feel free to contribute "trivial" enhancements yourself! Patches are always welcome. The Java build classpath (which is not always the same as the runtime classpath) is available through APIs such as JavaProject.getClasspath(); I am not sure what you mean by "as a variable" - surely you don't mean an environment variable, since there would have to be a different one for every project. Can you be more specific about exactly where and how you think the functionality should be exposed? Thanks!
Jay, please follow up. Thanks!
my past attempts to improve eclipse weren't successful. i don't fully understand the ideas behind many concepts and eclipse is rather complex. to make the issue more clear: i got several projects which eventually are build via ant buil files. eg <task name="build"> ... <path id="build.classpath"> <pathelement path="${build.classesdir}" /> <pathelement path="../foo/bar.jar /> <pathelement path="../bar/foo.jar /> ... </path> ... <javac ...> <classpath refid="build.classpath" /> </javac> </task> these path-element is basically a duplicate of the <classpath>-element in .classpath of the project. if the classpath of the project is changed within eclipse (Properties->Java build Path) it has to be changed in the build.xml as well to be synchron. it would be much easier if eclipse's ant plugin (or whatever part integrates ant) would expose the project's classpath to be used in the build.xml, something like <task name="build"> ... <javac ...> <classpath refid="eclipse.project.classpath" /> </javac> </task> eclipse exposes project specific information to ant anyway, why not the classpath -- be it as a variable or a dedicated task? (and not to speak of eclipse's "Variable Classpath Entries" which aren't available to ant at all)
in case somebody stumbles over this. the fix is: - preferences -> ant -> runtime -> properties - add property project_classpath with value ${project_classpath} (which is an eclipse variable) - new property project_classpath can be used in ANT build file <path id="build.classpath"> <pathelement path="${build.classesdir}" /> <pathelement path="${project_classpath}" /> ... <path> you can do the same with any eclipse variable (project_loc or workspace_loc may be helpful)