facebook

[Closed] How do I import settings from build.xml?

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #243463 Reply

    kurobt
    Member

    I downloaded a source file tree from apache using svn plugin.
    I could build this by pointing build.xml and choosing Run Ant from the context menu.
    But Eclipse shows the X marks on all components because it cannot build the project in the regular way, Project > Build All, I am guessing. It can’t build because build path needs adjustments. If it were simple class path, I’d just do that, but this source tree has many subcomponents each having its own JARs to link with, so it’s not that easy to enter the settings manually.
    Is there any way to synchronize Eclipse’s idea of build path and build.xml?

    #243486 Reply

    Scott Anderson
    Participant

    Sorry, but I don’t think there is a mechanism in Eclipse to configure a classpath from an Ant build file.

    Does anyone else know differently?

    #243615 Reply

    David Orriss Jr
    Participant

    [EDIT: oh.. sorry.. I thought you meant for creating a new project… not updating an existing one… sorry…!!! ]

    Actually… yes.. you can…

    From: http://eclipse.sys-con.com/read/100814.htm

    I was reading this article ( http://eclipse.sys-con.com/read/99729.htm ) about new features in Eclipse 3.1. One feature mentioned that caught my eye was the ability to set a project based on an existing ANT build file, and the ability to export a project settings to an ANT build file. Unfortunately the article didn’t explain how to do this import/export. I searched Eclipse’s help, to no avail. After some messing around with eclipse I found out how to do it.

    To export your project settings to an ANT build file:

    1. In your navigator window, look for a file called “.project”
    2. Right click on the file and click on “export”
    3. On the window that pops up, select “Ant Buildfiles” and click on “next”
    4. Select the appropriate project to use to generate the ANT buildfile
    5. Click “finish”

    You should now have two new build files on your project, “build.xml” and build-user.xml.

    Any custom targets you create should go on build-user.xml, since build.xml will be overwritten every time a build file is generated.

    To create a project from an existing ANT buildfile:

    1. Click on File->New->Project
    2. Select “Java Project from existing Ant Buildfile” and click “next”
    3. Enter a project name, and select the build file to use to create the project
    4. Select the javac declaration to be used to define the project
    5. Click finish

    I hope these instructions are helpful to others out there.

    #243657 Reply

    Scott Anderson
    Participant

    Dave,

    Awesome followup. I love it when I learn stuff on our forums. 🙂

    #243700 Reply

    David Orriss Jr
    Participant

    Oh good.. at least I found a useful tidbit for ya.. 🙂

    And I blogged it for posterity’s sake.. 😉

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: [Closed] How do I import settings from build.xml?

You must be logged in to post in the forum log in