使用Maven构建java项目,错误:发生了Ant BuildException:使用refid时不能指定嵌套元素

时间:2015-05-11 07:07:42

标签: java maven ant

该项目由Ant构建,现在我们使用Maven。

错误是

  

"发生了Ant BuildException:使用refid时不得指定嵌套元素。"

pom.xml是:

<artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>aopmetrics-on-aopmetrics</id>
                <phase>package</phase> 
                <configuration>
                  <tasks>
                    <taskdef name="aopmetrics" classname="org.tigris.aopmetrics.AopMetricsTask">
                      <classpath refid="maven.compile.classpath"/>
                      <classpath refid="maven.test.classpath"/>
                      <classpath location="${project.build.directory}/${project.build.finalName}.jar"/>
                    </taskdef>

                    <aopmetrics workdir="${project.build.directory}/work" sourcelevel="1.5" export="xls"
                        resultsfile="${project.build.directory}/aop-metrics-results.xls">
                      <fileset dir="src/main/java" includes="**/*.java"/>
                      <fileset dir="src/test/java" includes="**/*.java"/>
                      <classpath refid="maven.compile.classpath"/>
                      <classpath refid="maven.test.classpath"/>
                    </aopmetrics> 
                  </tasks> 
                </configuration> 
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>

0 个答案:

没有答案