作为一个孩子,用Ant项目构建一个Maven项目

时间:2015-04-09 09:44:27

标签: maven ant

我正在尝试在Maven中建立一个父pom,其中包括一个用蚂蚁建造的孩子。我得到以下例外,

Execution default of goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run failed: A required class was missing while executing org.apache.maven.plugins:maven-antrun-plugin:1.6:run

我的代码是:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <configuration>
                        <target>                               
                            <ant dir="SampleJava/projectBuilder.xml" />
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>

1 个答案:

答案 0 :(得分:0)

and it got resolved with the below code:
--------

   <plugin>
      <artifactId>maven-antrun-plugin</artifactId>
      <executions>
        <execution>
          <phase>process-resources</phase>
          <configuration>
            <tasks>
              <ant antfile="../SampleJava/projectBuilder.xml" target="makejar"/>
            </tasks>
          </configuration>
          <goals>
            <goal>run</goal>
          </goals>
        </execution>
      </executions>
    </plugin>