Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to deploy my artifact on to my nexus?

Tags:

I am using nexus open source as my repository manager for Maven 3.0.3

Maven is able to create artifact *.jar.

Now, I would like to know how I can push the generated artifact *.jar to the nexus repo manager, so that other dependent modules can pull from it.

I referred to this guide.

In settings.xml, I have

    <server>     
            <id>nexus-site</id>
            <username>admin</username>
            <password>xxxx</password>
    </server>

It fails.

How can invoke my deployment from mvn command or how to deploy my artifact on to my nexus?

like image 446
BalaB Avatar asked Dec 07 '11 10:12

BalaB


People also ask

How do I deploy Nexus?

Deployment to Nexus is a secured operation – and a deployment user exists for this purpose out of the box on any Nexus instance. Configuring Maven with the credentials of this deployment user, so that it can interact correctly with Nexus, cannot be done in the pom. xml of the project.


3 Answers

Just try

   mvn deploy

that will deploy your artifact to the nexus repo manager.

Have you configured the distributionManagement section ?

like image 179
khmarbaise Avatar answered Oct 30 '22 16:10

khmarbaise


And if you want to add it to the snapshot repository, you need the following configuration inside your pom.xml

<distributionManagement>
    <repository>
         <id>nexus-site</id>
         <name>MyCo Internal Repository</name>
         <url>http://Nexus url</url>
    </repository>
    <snapshotRepository>
         <id>nexus-site</id>
         <name>Your Snapshot Repository</name>
         <url>http://Nexus url</url>
    </snapshotRepository>
</distributionManagement>
like image 35
Kamiel Ahmadpour Avatar answered Oct 30 '22 16:10

Kamiel Ahmadpour


Repository element should also be specified. Snippet:pom.xml

<distributionManagement>
    <repository>
      <id>internal.repo</id>
      <name>MyCo Internal Repository</name>
      <url>http://Nexus url</url>
    </repository>
  </distributionManagement>
like image 31
abhinav Avatar answered Oct 30 '22 16:10

abhinav