Tôi vừa dịch một dự án kiến thành maven tuy nhiên kể từ khi maven không thực sự đối phó với triển khai tôi giới thiệu một số antrun vào xây dựng. Tuy nhiên khi tôi cố gắng thực hiện nó, các plugin bỏ qua nhiệm vụ của tôi. cho exemple khi tôi chạy mvn sạch antrun: chạy Tôi nhận được thông báo sau: Không có ant mục tiêu xác định - SKIPPED. điều tương tự cũng xảy ra với giai đoạn thứ hai, trong đó tôi đang cố gắng ghi đè giai đoạn triển khai để thực hiện triển khai thực tế thay vì tải lên một kho lưu trữ.Làm thế nào để ràng buộc maven antrun plugin vào pha sạch
Hãy tìm thấy bên dưới một trích pom.xml của tôi (loại: pom):
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>clean</id>
<configuration>
<task>
<echo>Cleaning deployed website</echo>
</task>
<tasks>
<delete dir="${deployRoot}/mydir/${env}"/>
</tasks>
</configuration>
<phase>clean</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>deployment</id>
<configuration>
<task>
<echo>Deploying website</echo>
</task>
<tasks>
<echo>Copying website artifact to deployment </echo>
<mkdir dir="${deployRoot}/mydir/${env}" />
<unzip
src="${project.basedir}/target/${env}.${project.version}.zip"
dest="${deployRoot}/mydir/${env}" />
<chmod perm="ugo+rx">
<fileset dir="${deployRoot}/mydir/${env}/web-exploded/bin">
<include name="**/*.sh" />
<include name="**/*.bat" />
</fileset>
</chmod>
</tasks>
</configuration>
<phase>deploy</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>