nexus 快速搭建-本地私有仓库 -maven

场景:

  • 需要上传打包starer
  • 本地、局域网内 jar包上传、下载
  • 搭建后本地有层代理,可节省代宽,无网可拉包等…

下载: https://help.sonatype.com/repomanager3/product-information/download

  • 基本说明:
    • proxy 用来代理远程公共仓库,如 Maven中央仓库
    • hosted 本地仓库
    • group 仓库组,用来聚合代理仓库和宿主仓库

服务安装启动:

安装:nexus.exe /install local-mvn
启动:nexus.exe /start local-mvn
停止:nexus.exe /stop local-mvn
卸载:nexus.exe /uninstall local-mvn
默认配置:\etc\nexus-default.properties

默认访问地址:http://127.0.0.1:8081

初始admin密码:/sonatype-work/nexus3/admin.password

  • 登录后 修改 密码 admin123

settings - nexus.xml 配置,默认密码 admin123


 

 

<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">
  
  
  <localRepository>E:\environment\pub-repositorylocalRepository>
  
 
  
 
  
  <pluginGroups>
    
  pluginGroups>
 
  
  <proxies>
    
  proxies>
 
  
  <servers>
    
 
    
	<server>
      <id>releasesid>  
      <username>adminusername>
      <password>admin123password>
    server>
     <server>
      <id>snapshotsid> 
      <username>adminusername>
      <password>admin123password>
	server>
	<server>
      <id>nexus-maid>
      <username>adminusername>
      <password>admin123password>
    server>
 	
  servers>
 
  
  <mirrors>
    
	 <mirror>
        <id>nexus-maid>
        <name>internal nexus repositoryname>
        
        <url>http://127.0.0.1:8081/repository/maven-public/url>
        <mirrorOf>*mirrorOf>
    mirror>
	
	<mirror>
		<id>nexus-aliyunid>
		<mirrorOf>centralmirrorOf>
		<name>Nexus aliyunname>
		<url>http://maven.aliyun.com/nexus/content/groups/publicurl>
	mirror>
	
  mirrors>
 
  
  <profiles>
    
	
 
    
	<profile>
  
           <id>jdk-1.8id>
           <activation>
               <activeByDefault>trueactiveByDefault>
               <jdk>1.8jdk>
           activation>
           <properties>
               <maven.compiler.source>1.8maven.compiler.source>
               <maven.compiler.target>1.8maven.compiler.target>
               <maven.compiler.compilerVersion>1.8maven.compiler.compilerVersion>
           properties>
   profile>
 
    <profile>
  <id>nexus-prid>
   
  <repositories>
    <repository>
      <id>nexus-maid>
      <name>Nexus Centralname>
     
      <url>http://127.0.0.1:8081/repository/maven-public/url>
      <layout>defaultlayout>
       
      <releases>
        <enabled>trueenabled>
      releases>
       
      <snapshots>
        <enabled>trueenabled>
      snapshots>
    repository>
  repositories>
   
  <pluginRepositories>
    <pluginRepository>
      <id>nexus-maid>
      <name>Nexus Centralname>
      <url>http://127.0.0.1:8081/repository/maven-public/url>
      <layout>defaultlayout>
      <snapshots>
        <enabled>trueenabled>
      snapshots>
      <releases>
         <enabled>trueenabled>
      releases>
    pluginRepository>
  pluginRepositories>
   profile>
  profiles>
 
  <activeProfiles>
       
    <activeProfile>nexus-practiveProfile>
    <activeProfile>jdk-1.8activeProfile>
  activeProfiles>
 
 
 
  
 
settings>

nexus 基本配置:

建aliyun 代理库:

  • 地址 :http://maven.aliyun.com/nexus/content/groups/public
  • 名称:aliyun-proxynexus 快速搭建-本地私有仓库 -maven_第1张图片
    nexus 快速搭建-本地私有仓库 -maven_第2张图片
    nexus 快速搭建-本地私有仓库 -maven_第3张图片

本地jar 上传:
nexus 快速搭建-本地私有仓库 -maven_第4张图片
nexus 快速搭建-本地私有仓库 -maven_第5张图片

你可能感兴趣的:(maven,java)