个人工具

“Nexus”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(以内容'搭建一个私有的maven仓库,同时支持缓存和代理。 - 说明 - 下载地址: http://www.sonatype.com/download-oss-sonatype 选择 nexus-3.0.0-03-unix.…'创建新页面)
 
使用
 
(未显示同一用户的2个中间版本)
第1行: 第1行:
 
搭建一个私有的maven仓库,同时支持缓存和代理。
 
搭建一个私有的maven仓库,同时支持缓存和代理。
  
- 说明 -
+
= 说明 =
 
下载地址:
 
下载地址:
 
   http://www.sonatype.com/download-oss-sonatype
 
   http://www.sonatype.com/download-oss-sonatype
第10行: 第10行:
 
下载
 
下载
  
- 安装 -
+
= 安装 =
-- 安装 openjdk1.8 --
+
== 安装 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>
 +
      <!--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>