mvn:install将我的jar放置在nexus远程存储库中 [英] mvn:install to place my jar in nexus remote repository
问题描述
我在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屋!