mvn:install将我的jar放置在nexus远程存储库中 [英] mvn:install to place my jar in nexus remote repository

查看:114
本文介绍了mvn:install将我的jar放置在nexus远程存储库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse(M2 Eclipse)中使用Maven

当我执行mvn:install时,我希望将jar(artifact)安装在服务器上的nexus存储库中(现在已安装的jar被放置在本地系统存储库中). ?

我什至将其更改为本地存储库地址

解决方案

通常,您将使用mvn deploy部署到非本地存储库.

当然,您需要在maven settings.xml或项目POM中配置存储库.

由于我们始终使用相同的内部存储库,因此我在Maven settings.xml(更确切地说是配置文件"部分)中完成了此操作.

这是我的配置供参考:

  <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>

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 ?

I even changed this to my local repository address

解决方案

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>

这篇关于mvn:install将我的jar放置在nexus远程存储库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆