anyuan2002.com - vwin网

查找: 您的方位主页 > 网络频道 > 阅览资讯:Nexus架构Maven私服

Nexus架构Maven私服

2019-04-17 08:43:55 来历:www.anyuan2002.com 【
  • 下载镜像
  • 创立存储
  • 布置容器
  • 编写Maven配置文件
  • 编写Maven项目pom文件

 

(一)下载镜像

#> docker pull sonatype/nexus3

 

(二)创立存储

#> mkdir /sre/nexus-data && chown -R 200 /sre/nexus-data

 

(三)布置容器

#> docker run -d -p 8081:8081 --name nexus -v /sre/nexus-data:/nexus-data sonatype/nexus3

 

(四)编写Maven配置文件

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<pluginGroups>

</pluginGroups>

<proxies>

</proxies>

<servers>
  
 <server>  
  <id>nexus-releases</id>  
  <username>admin</username>  # 默许用户名admin 
  <password>admin123</password>  # 默许用户暗码
 </server>  
 <server>  
  <id>nexus-snapshots</id>  
  <username>admin</username>  
  <password>admin123</password>  
 </server>   
 
</servers>


<mirrors>
  
 <mirror> 
      <id>nexus</id> 
      <mirrorOf>*</mirrorOf> 
      <name>Nexus Mirror</name> 
      <url>http://ip-address:8081/repository/maven-public/</url> 
 </mirror> 
</mirrors>

 
 <profiles>
  
 <profile> 
      <id>nexus</id> 
      <repositories> 
        <repository> 
          <id>nexus</id> 
          <name>local private nexus</name> 
          <url>http://ip-address:8081/repository/maven-public/</url> 
          <releases> 
            <enabled>true</enabled> 
          </releases> 
          <snapshots> 
            <enabled>false</enabled> 
          </snapshots> 
        </repository> 
        <repository> 
          <id>nexus</id> 
          <name>local private nexus</name> 
          <url>http://ip-address:8081/repository/maven-public/</url> 
          <releases> 
            <enabled>false</enabled> 
          </releases> 
          <snapshots> 
            <enabled>true</enabled> 
          </snapshots> 
        </repository> 
 
      </repositories> 
      <pluginRepositories> 
        <pluginRepository> 
          <id>nexus</id> 
          <name>local private nexus</name> 
          <url>http://ip-address:8081/repository/maven-public/</url> 
          <releases> 
            <enabled>true</enabled> 
          </releases> 
          <snapshots> 
            <enabled>false</enabled> 
          </snapshots> 
        </pluginRepository> 
        <pluginRepository> 
          <id>nexus</id> 
          <name>local private nexus</name> 
          <url>http:/ip-address:8081/repository/maven-public/</url> 
          <releases> 
            <enabled>false</enabled> 
          </releases> 
          <snapshots> 
            <enabled>true</enabled> 
          </snapshots> 
        </pluginRepository> 
      </pluginRepositories> 
    </profile> 
 </profiles>
 <activeProfiles> 
    <activeProfile>nexus</activeProfile> 
  </activeProfiles> 
 
</settings>

 

(五) 编写Maven项目pom文

<distributionManagement>
  <repository>
    <id>nexus</id>
    <name>local private nexus</name>
    <url>http://ip-address:8081/repository/maven-public/</url>
  </repository>
</distributionManagement>

 

 
 

本文地址:http://www.anyuan2002.com/a/question/100397.html
Tags: Nexus 架构 MAVEN
修改:vwin网
  • 上一篇:HDFS架构简述
  • 下一篇:没有了
  • 关于咱们 | 联络咱们 | 友情链接 | 网站地图 | Sitemap | App | 回来顶部