个人工具

“Nexus”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
安装 openjdk1.8
使用
 
第32行: 第32行:
  
 
= 使用 =
 
= 使用 =
 +
 +
修改 ~/.m2/settings.xml
 +
 +
注意下面的localhost地址修改为你服务器的实际地址。
 +
 +
<settings>
 +
  <mirrors>
 +
    <mirror>
 +
      <!--This sends everything else to /public -->
 +
      <id>nexus</id>
 +
      <mirrorOf>*</mirrorOf>
 +
      <url>http://localhost:8081/repository/maven-public/</url>
 +
    </mirror>
 +
  </mirrors>
 +
  <profiles>
 +
    <profile>
 +
      <id>nexus</id>
 +
      <!--Enable snapshots for the built in central repo to direct -->
 +
      <!--all requests to nexus via the mirror -->
 +
      <repositories>
 +
        <repository>
 +
          <id>central</id>
 +
          <url>http://central</url>
 +
          <releases><enabled>true</enabled></releases>
 +
          <snapshots><enabled>true</enabled></snapshots>
 +
        </repository>
 +
      </repositories>
 +
    <pluginRepositories>
 +
        <pluginRepository>
 +
          <id>central</id>
 +
          <url>http://central</url>
 +
          <releases><enabled>true</enabled></releases>
 +
          <snapshots><enabled>true</enabled></snapshots>
 +
        </pluginRepository>
 +
      </pluginRepositories>
 +
    </profile>
 +
  </profiles>
 +
  <activeProfiles>
 +
    <!--make the profile active all the time -->
 +
    <activeProfile>nexus</activeProfile>
 +
  </activeProfiles>
 +
</settings>

2016年4月22日 (五) 18:02的最新版本

搭建一个私有的maven仓库,同时支持缓存和代理。

说明

下载地址:

 http://www.sonatype.com/download-oss-sonatype

选择

nexus-3.0.0-03-unix.tar.gz

下载

安装

安装 openjdk1.8

apt-get install software-properties-common
add-apt-repository ppa:openjdk-r/ppa
apt-get update
apt-get install openjdk-8-jdk
update-alternatives --config java
update-alternatives --config javac

安装 nexus

tar xzvf nexus-3.0.0-03-unix.tar.gz
mv nexus-3.0.0-03 /usr/local/nexus
ln -s /usr/local/nexus/bin/nexus /etc/init.d/nexus
update-rc.d nexus defaults
/etc/init.d/nexus start

打开 nexus

访问 http://x.x.x.x:8081/

默认用户名 : admin 密码:admin123

使用

修改 ~/.m2/settings.xml

注意下面的localhost地址修改为你服务器的实际地址。

<settings>
 <mirrors>
   <mirror>
     <id>nexus</id>
     <mirrorOf>*</mirrorOf>
     <url>http://localhost:8081/repository/maven-public/</url>
   </mirror>
 </mirrors>
 <profiles>
   <profile>
     <id>nexus</id>
     <repositories>
       <repository>
         <id>central</id>
         <url>http://central</url>
         <releases><enabled>true</enabled></releases>
         <snapshots><enabled>true</enabled></snapshots>
       </repository>
     </repositories>
    <pluginRepositories>
       <pluginRepository>
         <id>central</id>
         <url>http://central</url>
         <releases><enabled>true</enabled></releases>
         <snapshots><enabled>true</enabled></snapshots>
       </pluginRepository>
     </pluginRepositories>
   </profile>
 </profiles>
 <activeProfiles>
   <activeProfile>nexus</activeProfile>
 </activeProfiles>
</settings>