How to import an existing Ant build.xml into IntelliJ IDEA

I have an existing project that uses the Ant build.xml file to save the location of the dependency jars.

Eclipse is very easy to import from an existing Ant file . I searched online and looked through all the options for the โ€œnew projectโ€ in IntelliJ, but I canโ€™t figure out how to do it.

The closest I have done is File > New > Project from existing sources . But my whole project is full of errors because it did not use build.xml to include banners.

+16
source share
3 answers

Intellij supports Ant projects through the built-in Ant plugin, which is enabled by default in the IDE. To check if this is turned on, go to Settings > Plugins > Ant

After you enable the plugin, you can use build.xml from View > Tool Windows > Ant Build

Then you should have the (+) option to import your build.xml file.

+17
source

You should use File> New> Module instead of File> New> Project from existing sources for the Ant project. You also need to install the Root content and Module file location in the current Ant project directory.

You may also need to set the correct path to display the project in the Project Structure> Use the compilation compilation path and set the correct content path in the Project Structure> Sources

+5
source

Import the project "from existing sources" without selecting any build tool (the ant is not in the list, only maven, sbt, etc.). Then, after completing the import wizard, in the project file view, right-click the ant build.xml file and select the parameter related to ant, which is hidden at the bottom of the menu.

+2
source

Source: https://habr.com/ru/post/987766/


All Articles