0

I need to build project with subprojects and main project is the Maven project, one of the subprojects - is the Ant project. I need to compile all projects from one main pom.xml I have found solution How to wrap an Ant build with Maven? and it's answer is correct, but not for my project. Because when my ant project required Ant v. 1.8.x, but on build with the

<dependencies>
        <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b3</version>
            <exclusions>
                <exclusion>
                    <groupId>ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-nodeps</artifactId>
            <version>1.8.1</version>
        </dependency>
    </dependencies>

    <modules>
        <module>Bundles/I_AboutForm</module>
        <module>Bundles/I_AppVars</module>
    </modules>


    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <configuration>
                            <!--<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath" />-->
                            <tasks>
                                <ant antfile="MainApplication/build.xml" target="compile"/>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

maven downloaded Ant v. 1.7.1 and uses him on build (in the local repo has Ant v.1.8.1). I think, may be trouble in the dependings of the ant-contrib 1.0b3 - may be ant-contrib depends on Ant v. 1.7.1?

Please advice me how to build Ant v. 1.8.x project in Maven. Thanks, best regards, Arthur.

Community
  • 1
  • 1
Arthur
  • 3,253
  • 7
  • 43
  • 75

1 Answers1

1

looking at the version of the plugin 1.7, it seems to use the ant version 1.8.2 http://maven.apache.org/plugins/maven-antrun-plugin/dependencies.html

Try to specify the version 1.7 of the plugin maven-antrun-plugin

for example:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
                <executions>
                    <execution>
Farid
  • 2,265
  • 18
  • 14