向标准的maven部署添加工件 [英] adding artifacts to standard maven deploy
问题描述
我希望有人可以通过maven部署来帮助我(通常通过发布插件)。
I was hoping someone could help me with maven deployments (typically run through the release plugin).
我想将除了打包的jar之外的文件部署到发布后的repo,如具体的指导文件和生成的SQL文件。
I want to deploy files other than just the packaged jar to the repo upon release, such as specific instruction documents and generated SQL files.
如果我不必使用 deploy:deploy-文件
。如果我可以将每个文件添加到我的POM文件中的一个列表中,那么最好是在发布之后自动为我自动提取。
It would be good if i did not have to use deploy:deploy-file
for each one. it would be best if I could just add each file to a list within my POM file and it would be picked up automatically for me upon release.
推荐答案
使用Maven程序集插件将它们打包到一个将被安装/部署的程序集中。
Either use the Maven Assembly Plugin to package them into an assembly that will get installed/deployed.
或使用 attach-artifact
构建助手插件的目标:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>some file</file>
<type>extension of your file</type>
<classifier>optional</classifier>
</artifact>
...
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
这篇关于向标准的maven部署添加工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!