正如@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
原因是在项目的性质:)太长时间来解释 –