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>