我當前的 pom 配置為將 jar 部署到我的工件。此外,還有一個運行 jar 的 bash 腳本,我也將它保存在我的專案中。我也想將此腳本(與 jar 分開)部署到同一版本下的我的工件中。
是否可以?如果是這樣,我應該在 pom 中添加什么來做到這一點?
uj5u.com熱心網友回復:
您可以使用Apache Maven Deploy Plugin 中的deploy:deploy-file目標
<plugins>
<!-- other plugins ...-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<goals>
<goal>deploy-file</goal>
</goals>
<phase>deploy</phase> <!-- change this if you need another phase -->
<configuration>
<groupId>${project.groupId}-script</groupId><!-- whatever you want -->
<artifactId>${project.groupId}</artifactId><!-- same groupId as the project, you can choose another one-->
<version>${project.version}</version><!-- same version as the project, but you can choose another one -->
<file><!-- path to your script --></file>
<pomFile> <!-- path to the pom file of the script --></pomFile>
<generatePom><!-- but maybe you don't want a pom file for the script, so set this to false--></generatePom>
<repositoryId><!-- the one configured in your settings.xml and distributionManagement --></repositoryId>
<url><!-- the one configured in your settings.xml and distributionManagement --></url>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/407146.html
標籤:
