Ant and using maven dependencies and settings file

850 views Asked by At

We have a legacy project that uses ANT for building. It uses the maven ant task plugin for handling dependencies against our Nexus server.

We now want to use a common settings.xml file for this ANT project and our other maven projects to minimize the hassle.

The ant project has a dependency file containing "dependency sets"

<artifact:dependencies filesetId="foo" settingsFile="ant-settings.xml">
    <dependency ....>
</artifact:dependencies>
<artifact:dependencies filesetId="fum" settingsFile="ant-settings.xml">
    <dependency ....>
</artifact:dependencies>

In the settings file used by the ANT project we have a profile set to "active by default".

We can't put this profile in the common settings file as it will mess it up for the maven projects and the ANT project will not build without the profile.

Is there a way to do this and keep all projects happy?

/J

1

There are 1 answers

0
jne On

In our dependencies file I added

<artifact:remoteRepository id="foo" url="nexus path" />

To all artifact:dependencies I add

<remoteRepository refId="foo" />

at the end. i.e:

<artifact:dependencies filesetId="foo" settingsFile="ant-settings.xml">
    <dependency ....>
    <remoteRepository refId="foo" />
</artifact:dependencies>