[英]How “build” and deploy a plain text maven artifact
我有一個maven模塊,用於保存我需要“構建”的純文本文件(使用name-version-classifier.extension格式重命名該文件)並部署在我的maven存儲庫中。 我知道我可以通過命令行部署它,但我想知道我是否可以寫一個pom.xml,我可以得到相同的結果。
LDM。
從討論如何將文本文件附加到模塊的分發? :
在過去,我已經使用Build Helper插件來附加其他工件https://www.mojohaus.org/build-helper-maven-plugin
如何將附加工件附加到項目的示例顯示了如何附加文件; 使你的pom
類型的模塊和附加工件將是唯一部署的工件:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</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>
使用build-helper-maven-plugin:attach-artifact
<project>
...
<build>
<plugins>
<plugin>
<!-- add configuration for antrun or another plugin here -->
</plugin>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</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>
</plugins>
</build>
</project>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.