mvn:install to place my jar in nexus remote repository

27,041

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>
Share:
27,041
Praneel PIDIKITI
Author by

Praneel PIDIKITI

A polyglot developer who’s into JavaScript, Open Source, Apple, Salesforce, Coffee, Robotics, Drones, IoT, Photography and Gaming.

Updated on February 26, 2020

Comments

  • Praneel PIDIKITI
    Praneel PIDIKITI about 4 years

    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