Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ant脚本中的Maven pom.xml_Maven_Ant_Maven Ant Tasks - Fatal编程技术网

ant脚本中的Maven pom.xml

ant脚本中的Maven pom.xml,maven,ant,maven-ant-tasks,Maven,Ant,Maven Ant Tasks,这是我build.xml的一部分。我从ant脚本触发mvn构建,然后重命名该构建并将其复制到特定位置。maven中有一个profile的概念。你能帮助我在下面的快照中提供maven概要文件吗 <target name="_deployHubstarRESTAPI"> <artifact:mvn pom="../HubstarRESTAPI/pom.xml"> <arg value="clean"/> <arg va

这是我build.xml的一部分。我从ant脚本触发mvn构建,然后重命名该构建并将其复制到特定位置。maven中有一个profile的概念。你能帮助我在下面的快照中提供maven概要文件吗

<target name="_deployHubstarRESTAPI">
    <artifact:mvn pom="../HubstarRESTAPI/pom.xml">
        <arg value="clean"/>
        <arg value="install" />
      </artifact:mvn>
      <copy file="../HubstarRESTAPI/target/HubstarRESTAPI-0.0.1-SNAPSHOT.war" todir="${web.hubstarrestapi.dist.dir}"/>
      <move file="${web.hubstarrestapi.dist.dir}/HubstarRESTAPI-0.0.1-SNAPSHOT.war" tofile="${web.hubstarrestapi.dist.dir}/HubstarRESTAPI.war"/>
</target>

Ant实际上是在用您传递的参数创建命令。 只需添加您的配置文件条目作为参数。像这样

 <target name="_deployHubstarRESTAPI" >
<artifact:mvn pom="../HubstarRESTAPI/pom.xml">
   <arg value="clean"/>
   <arg value="install" />
   <arg value="-P${build.name}" />
 </artifact:mvn>
 <copy file="../HubstarRESTAPI/target/HubstarRESTAPI-0.0.1-SNAPSHOT.war" todir="${web.hubstarrestapi.dist.dir}"/>
 <move file="${web.hubstarrestapi.dist.dir}/HubstarRESTAPI-0.0.1-SNAPSHOT.war" tofile="${web.hubstarrestapi.dist.dir}/HubstarRESTAPI.war"/>
</target>

Ant实际上是在用您传递的参数创建命令。 只需添加您的配置文件条目作为参数。像这样

 <target name="_deployHubstarRESTAPI" >
<artifact:mvn pom="../HubstarRESTAPI/pom.xml">
   <arg value="clean"/>
   <arg value="install" />
   <arg value="-P${build.name}" />
 </artifact:mvn>
 <copy file="../HubstarRESTAPI/target/HubstarRESTAPI-0.0.1-SNAPSHOT.war" todir="${web.hubstarrestapi.dist.dir}"/>
 <move file="${web.hubstarrestapi.dist.dir}/HubstarRESTAPI-0.0.1-SNAPSHOT.war" tofile="${web.hubstarrestapi.dist.dir}/HubstarRESTAPI.war"/>
</target>


为什么构建Maven项目需要Ant脚本?你想解决的真正问题是什么?您知道pom文件中
finalName
的用法吗?用于构建的主项目是ant项目,其中一个项目是maven项目。为什么需要ant脚本来构建maven项目?你想解决的真正问题是什么?您知道pom文件中
finalName
的用法吗?用于构建的主项目是ant项目,其中一个项目是maven项目。