欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Maven deploy jar with dependencies to repo

程序员文章站 2023-12-30 13:08:10
...

 

I can deploy a jar by using the following in my pom.xml and running mvn deploy:

<distributionManagement><repository><id>releases</id><url>http://${host}:8081/nexus/content/repositories/releases</url></repository><snapshotRepository><id>snapshots</id><name>InternalSnapshots</name><url>http://${host}:8081/nexus/content/repositories/snapshots</url></snapshotRepository></distributionManagement>

And I can build an executable jar-with-dependencies using the following:

<plugin><artifactId>maven-assembly-plugin</artifactId><executions><execution><id>create-executable-jar</id><phase>deploy</phase><goals><goal>single</goal></goals><configuration><descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs><archive><manifest><mainClass>my.company.app.Main</mainClass></manifest></archive></configuration></execution></executions></plugin>


 

 

<plugin><artifactId>maven-deploy-plugin</artifactId><version>2.7</version><executions><execution><id>deploy-executable</id><goals><goal>deploy-file</goal></goals><configuration><file>target/Monitoring-Client-1.0-SNAPSHOT-jar-with-dependencies.jar</file></configuration></execution></executions></plugin>

 

 

 

 

 

 

 

相关标签: Maven Java

上一篇:

下一篇: