正如@William描述,您可以用螞蟻插件,出口的財產,以Maven的背景和跳過任務,如果「真」。
下面是代碼:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<available file="src/main/resources/my-data" type="dir"
property="dir-exits"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-zip-dependencies</id>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<skip>${dir-exists}</skip>
<artifactItems>
<artifactItem>
<groupId>com.mygroup</groupId>
<artifactId>myartifactid</artifactId>
<includes>**/*.json</includes> <outputDirectory>src/main/resources/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
的問題是,你爲什麼需要這樣一個奇怪的事情? – khmarbaise
原因是在項目的性質:)太長時間來解釋 –