maven 调用 ant

 从maven 中调用ant脚本 

参考 :http://maven.apache.org/plugins/maven-antrun-plugin/

   

     <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-antrun-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <phase>compile</phase>
                                                <goals>
                                                        <goal>run</goal>
                                                </goals>
                                                <configuration>
                                                        <tasks> 
                                                                <ant
                                                                        antfile="${basedir}/build/build.xml">
                                                                        <target name="build" />
                                                                </ant>
                                                        </tasks>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>

 

执行是报错:
Caused by: E:\clearcase_data\Prj_bnet_development\bnet_biz\ReqTask\ReqTaskProces
s\build\build.xml:28: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

需要在build.xml中增加
<property name="build.compiler" value="extJavac"/>
compiler property参考 http://ant.apache.org/manual/CoreTasks/javac.html

 

你可能感兴趣的:(apache,jdk,maven,xml,ant)