使用 Maven dependentecy 插件解压一次依赖项
你好 我已经弄清楚如何在我的项目目录中分解 zip 文件 但我只想做一次。我的意思是,如果目录已经存在,就不要再次爆炸它。 这就是我今天的做法,
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
<executions>
<!--Import qooxdoo sdk and add it to target directory-->
<execution>
<id>extract-qooxdoo-sdk</id>
<phase>process-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>qooxdoo-sdk</includeArtifactIds>
<outputDirectory>${project.basedir}/qooxdoo-sdk</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>>2.2</version>
<executions>
<!--Import qooxdoo sdk and add it to target directory-->
<execution>
<id>extract-qooxdoo-sdk</id>
<phase>process-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>qooxdoo-sdk</includeArtifactIds>
<outputDirectory>${project.basedir}/qooxdoo-sdk</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
感谢您的帮助
Hi
i've figured out what to do to explode a zip file in my project directory
But i would like to do it just one time. i mean if the diretory already exist not explode it a second time.
Here is the way i do it today
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
<executions>
<!--Import qooxdoo sdk and add it to target directory-->
<execution>
<id>extract-qooxdoo-sdk</id>
<phase>process-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>qooxdoo-sdk</includeArtifactIds>
<outputDirectory>${project.basedir}/qooxdoo-sdk</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>>2.2</version>
<executions>
<!--Import qooxdoo sdk and add it to target directory-->
<execution>
<id>extract-qooxdoo-sdk</id>
<phase>process-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>qooxdoo-sdk</includeArtifactIds>
<outputDirectory>${project.basedir}/qooxdoo-sdk</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用配置文件来检查该文件夹是否存在。但我建议将该文件夹放入不同的文件夹中,例如目标文件夹......
i would suggest to use a profile to check if the folder exists. But i would suggest to put that folder into a different folder for example to target folder....