Skip to main content

Posts

Showing posts from October, 2011

How to upload an artifact to maven remote repository?

If you want to deploy artifacts that were not build using maven, or which were build using maven but their POMs did not contains the deployment detials, then you need to deploy them using the following: mvn -e deploy:deploy-file -DgroupId=com.test.jpa -DartifactId=jpa-demo -Dversion=1.0.0 -Dpackaging=jar -Dfile=jpa-demo-1.0.0.jar -Durl=http://localhost:8080/archiva/repository/internal/ -DrepositoryId=reppoI d url: specifies the remote maven repository to where the jar is to be uploaded repositoryId: Id repository is secured, repositoryId is used to specify the credentials that are to be used for uploading. Repositories are defined in settings.xml. e.g. <servers>     <server>       <id>deploymentRepo</id>       <username>repouser</username>       <password>repopwd</password>     </server> </servers> Maven repository will return code 401 if credentials are missing or invalid. Better way is to use deploy p