Any way to generate ant build.xml file automatically from Eclipse?

后端 未结 7 1227
后悔当初
后悔当初 2020-11-30 23:33

From Eclipse, I found I can easily export an Ant build file for my project. It provides references to 3rd party libraries and some base targets. I\'m using

7条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 23:52

    I've had the same problem, our work environment is based on Eclipse Java projects, and we needed to build automatically an ANT file so that we could use a continuous integration server (Jenkins, in our case).

    We rolled out our own Eclipse Java to Ant tool, which is now available on GitHub:

    ant-build-for-java

    To use it, call:

    java -jar ant-build-for-java.jar  [<.userlibraries file>]
    

    The first argument is the folder with the repositories. It will search the folder recursively for any .project file. The tool will create a build.xml in the given folder.

    Optionally, the second argument can be an exported .userlibraries file, from Eclipse, needed when any of the projects use Eclipse user libraries. The tool was tested only with user libraries using relative paths, it's how we use them in our repo. This implies that JARs and other archives needed by projects are inside an Eclipse project, and referenced from there.

    The tool only supports dependencies from other Eclipse projects and from Eclipse user libraries.

提交回复
热议问题