Maven構建成功後複製jar包到指定位置插件

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.8</version>
        <executions>
            <execution>
                <id>deploy</id>
                <phase>package</phase>
                <goals>
                    <goal>run</goal>
                </goals>
                <configuration>
                    <target>
                        <property name="servicemix_path" value="D:/apache-servicemix-5.4.0/deploy" />
                        <property name="target_file" value="${project.artifactId}-${project.version}.jar" />
                        <echo message="servicemix_path: ${servicemix_path}" />
                        <echo message="file: ${target_file}" />
                        <delete file="${servicemix_path}/${target_file}"></delete>
                        <copy file="target/${target_file}" todir="${servicemix_path}/" />
                    </target>
                </configuration>
            </execution>
        </executions>
</plugin>

發佈了75 篇原創文章 · 獲贊 8 · 訪問量 35萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章