We can use "maven-deploy-plugin" to upload any artifact to repository from a location by pom.xml.
By this we can upload any artifact without uploading the generated artifacts, also without install/deploy goal.
....
</plugins>
....
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>deploy-file</id>
<phase>clean</phase> <!-- The phase in which you want to upload the file to Repository . In this case "mvn clean " goal will upload the artifact.-->
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<repositoryId>maven-public</repositoryId> <!-- This is the id which contains the user/pass to connet to Nexus. This will be under "servers" section in settings.xml -->
<file>C:\Users\bismayam\Desktop\poc.jar</file>
<url>http://<host>:<port>/nexus/content/repositories/test-releases/</url>
<groupId>testGroup</groupId>
<artifactId>testArtifact</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
No comments:
Post a Comment
Thank You for your valuable comment