Community
Participate
Working Groups
When I load a new project from an existing ant build file, by default eclipse assumes the location of the WorkSpace and nor the location of the build file: build.xml. Such location can't be changed when you go to Properties of the project there is no way to change that, also de New Project Wizard doesn't allow you to change it. Because that when invoking to build the project using ant it doesn't locate some source files.
Can you please explain what "load a new project" means? Are you talking about the basedir property when executing the Ant buildfile? A small example demonstrating the problem would be appreciated.
>Can you please explain what "load a new project" means? File|New|Project... Then Select Java Project form Existing Ant Buildfile Push Next button Then, select the ant file to load on the box: Ant Build file Push the Finish botton Once the proyect is created, and you look on the properties of the project (right botton of the mouse and then Properties) the location of the project is inside the workspace directory. If you want to change this you have to change the workspace location (File|Switch workspace...), then Eclipse restart again. This is not a good solution, because it force to you to put the information on the workspace directory. There is no way to change the location of the generated project without swhithing the workspace location. I expect on the loading process Eclipse allows me to pick the location of the project, some times you have the build files, and also the tree structure, I don't understand why such restriction about the workspace location. The solution would be the put the build.xml file inside on the workspace location, BEFORE and then create the project from an existing ant build file. Probably it is not a bug, just a functional restriction, but at the time a writing the bug I didn't know what is happened, I was thinking on my own location but there was information out of it.
Thank you for reporting back but I am still unsure of the nature of the problem. When you create a Java project from an Ant buildfile, the project resources are linked to the actual location in the filesystem. The import does not copy the project source contents to the workspace but rather just makes resource links from the created Java project.
Creating the project from an existing Ant buildfile according to the instructions below DOES copy the files to the workspace location. Maybe we are working with different versions? Version: 3.1.0 Build id: I20050627-1435
I have downloaded the latest Eclipse version (today) in order to check it: Version: 3.1.1 Build id: M20050929-0840 I get the same problem. The ant project I am trying to create I have downloaded from: http://www.apress.com/book/supplementDownload.html?bID=405&sID=2447 (Sample Application of Pro Spring book, from Appres) I have found ANOTHER PROBLEM: If you use <presetdef> ant feature (from 1.6.* version), for example: <presetdef name="my.javac"> <javac classpathref = "compile.classpath" debug = "${compile.debug}" deprecation = "${compile.deprecation}" destdir = "${build.classes.dir}" includeAntRuntime = "no" failonerror = "true" srcdir = "${src.java.main.dir}" optimize = "${compile.optimize}" > <include name = "**/*.java"/> </javac> </presetdef> and then you use it: <target name="compile" description ="Compiles files"> <!-- compiling source files--> <my.javac/> <!-- compiling testing files--> <my.javac srcdir ="${src.java.test.dir}" destdir ="${build.testclasses.dir}" /> </target> When you want to create a new project from an existing ant build file when you load the build.xml during the wizard process it doesn't allow you to go on, because it claims about there is no <javac> task. It should understand the <presetdef> type or al least to lead you specify the equivalent <javac> task.
Logged new bug report 127593 for allow more than selection of just javac tasks.
The planned support is to allow the user to link to the buildfile in its original location. *** This bug has been marked as a duplicate of bug 147337 ***
David Leal ,is the bug fixed?“It should understand the <presetdef> type or al least to lead you specify the equivalent <javac> task.”