Maven搭建本地私服后POM配置

版权声明:本文为博主原创文章,未经博主允许不得转载,如果转载,我也不是很介意。 https://blog.csdn.net/qq_34926773/article/details/82143630

这里就不细说怎么搭建nexus了,我们如果需要同时使用spring的jar同时又需要自己的本地jar,那么我们可以把jar上传放在nexus中的thirdparty里,然后在pom.xml里配置如下:

=============================================================
<dependency>
   <groupId>com.fuse</groupId>
   <artifactId>entity</artifactId>
   <version>1.0.0</version>
</dependency>

=============================================================

<repositories>
   <!--本地-->
   <repository>
      <id>thirdparty</id>
      <name>thirdparty</name>
      <url>http://192.168.50.188:8081/nexus/content/repositories/thirdparty/</url>
      <releases>
         <enabled>true</enabled>
      </releases>
      <snapshots>
         <enabled>true</enabled>
      </snapshots>
   </repository>
   <!--外网-->
   <repository>
      <id>spring-milestone</id>
      <name>Spring Milestone Repository</name>
      <url>http://repo.springsource.org/milestone</url>
   </repository>
</repositories>

=============================================================

<distributionManagement>
   <repository>
      <id>thirdparty</id>
      <url>http://192.168.50.188:8081/nexus/content/repositories/thirdparty</url>
   </repository>
</distributionManagement>

猜你喜欢

转载自blog.csdn.net/qq_34926773/article/details/82143630