1. Deploying Arbitrary Artifact to Nexus
You need to have configured username and password of your nexus server in your settings.xml file for this snippet to work, it uploads the zip artifact to nexus repository.
settings.xml (located in .m2 directory)
<servers>
<server>
<id>nexus</id>
<username>username</username>
<password>pass</password>
</server>
</servers>
Pom.xml
<!-- Deploy File --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> <executions> <execution> <phase>package</phase> <configuration> <artifactId>${project.artifactId}</artifactId> <groupId>${project.groupId}</groupId> <version>${project.version}</version> <packaging>zip</packaging> <file>target/application-1.0-SNAPSHOT.zip</file> <repositoryId>nexus</repositoryId> <url>http://xxx.yyy.zz.tt:8081/nexus/content/repositories/snapshots/</url> </configuration> <goals> <goal>deploy-file</goal> </goals> </execution> </executions> </plugin>
No comments:
Post a Comment