Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvn:install to place my jar in nexus remote repository

I am using maven in eclipse (m2 eclipse)

When i execute mvn:install i want my jar(artifact) to be installed in the nexus repository which is located on the server(right now the installed jar is placed in the local system repository).. how can i do that ?

enter image description here

I even changed this to my local repository address

like image 492
Praneel PIDIKITI Avatar asked Feb 25 '11 12:02

Praneel PIDIKITI


1 Answers

Typically, you'd use mvn deploy to deploy to a non-local repository.

You will, of course, need to have the repo configured, either in your maven settings.xml or in the project POM.

As we always use the same internal repo, I've done this in the Maven settings.xml, more precisely, the "profiles" section.

Here is my config for reference:

  <profiles>
    <profile>
      <id>artifactory</id>
      <repositories>
        <repository>
          <id>central</id>
          <name>libs-releases</name>
          <url>http://repo.example.com/libs-releases</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
        <repository>
          <id>snapshots</id>
          <name>libs-snapshots</name>
          <url>http://repo.example.com/libs-snapshots</url>
          <snapshots />
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <name>plugins-releases</name>
          <url>http://repo.example.com/plugins-releases</url>
          <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
like image 140
Kris Avatar answered Sep 30 '22 18:09

Kris