小时候用 Ant 项目构建 Maven 项目

building a Maven project with Ant project as a child

我正在尝试在 Maven 中构建父 pom,其中包括一个在 ant 中构建的子 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>
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>