`

nexus maven私有库搭建

阅读更多
1.下载nexus包,linux命令
wget http://sonatype-download.global.ssl.fastly.NET/nexus/oss/nexus-2.11.4-01-bundle.tar.gz
2.解压nexus包
  tar -zxvf  nexus-2.11.4-01-bundle.tar.gz
3.配置环境变量
  export RUN_AS_USER=root
4.启动命令(start | stop | restart),前提是配置了Java环境,默认端口为8081
./nexus-2.11.4-01/bin/nexus start
5.可以修改自己默认端口(nexus-2.11.4-01/conf/nexus.properties)
6.登录界面:http://IP:8081/nexus
 
其中默认用户/密码:admin/admin123
登录后的界面

7.配置本地maven的setting配置
  
<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
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
 
  -->
 <localRepository>D:/MvnRepository</localRepository>
    <servers> 
    <server>
    <id>nexus-releases</id>
    <username>admin</username>
    <password>admin123</password>
  </server>
  <server>
    <id>nexus-snapshots</id>
    <username>admin</username>
    <password>admin123</password>
  </server>
   </servers> 
   <mirrors> 
    <mirror>
        <id>nexus</id>
        <name>internal nexus repository</name>
        <url>http://192.168.149.192:8081/nexus/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>
   <profiles>
    <profile>
    <id>nexus</id>
    <repositories>
      <repository>
        <id>nexus</id>
        <name>Nexus</name>
        <url>http://192.168.149.192:8081/nexus/content/groups/public/</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
      </repository>
    </repositories>
    <pluginRepositories>
      <pluginRepository>
        <id>nexus</id>
        <name>Nexus</name>
        <url>http://192.168.149.192:8081/nexus/content/groups/public/</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </pluginRepository>
    </pluginRepositories>
<distributionManagement>
  <repository>
    <id>nexus-releases</id>
    <name>Nexus Releases Repository</name>
    <url>http://192.168.149.192:8081/nexus/content/repositories/releases/</url>
  </repository>
  <snapshotRepository>
    <id>nexus-snapshots</id>
    <name>Nexus Snapshots Repository</name>
    <url>http://192.168.149.192:8081/nexus/content/repositories/snapshots/</url>
  </snapshotRepository>
</distributionManagement> 

   <activeProfiles>
    <!-- 激活nexusRepo这个profile:只有激活才生效 -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>

8.pom.xml文件配置:上传私有库代码
<build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
<distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>Nexus Release Repository</name>
            <url>http://192.168.149.192:8081/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>nexus-snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://192.168.149.192:8081/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

基本配置已完成;
具体详情可参考博客:
http://blog.csdn.net/shenshen123jun/article/details/9084293
http://www.cnblogs.com/luotaoyeah/p/3791966.html


  • 大小: 96.7 KB
  • 大小: 69.5 KB
分享到:
评论

相关推荐

    nexus 搭建 maven仓库

    nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库

    使用Nexus搭建Maven私有仓库

    使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。

    搭建Maven私有仓库.docx

    Windows Server 2016环境下使用Nexus搭建Maven私有仓库详细过程及常用配置。

    使用Nexus搭建Maven私有仓库.rar

    使用Nexus搭建Maven私有仓库

    MavenDemo:Android使用Nexus搭建 Maven私有仓库

    Android Maven私有仓库搭建笔记前言  什么是maven、gradle?  Maven是一个项目管理和自动构建工具。  Gradle是一个基于JVM的构建工具,是一款通用灵活的构建工具,支持maven, Ivy仓库,支持传递性依赖管理,...

    nexus 搭建maven 私有服务器

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问

    Maven私有仓库搭建软件nexus-3.58.1-02-unix.tar.gz

    nexus的全称是Nexus Repository Manager,一个强大的仓库管理器,极大地简化了内部仓库的维护和外部仓库的访问。 主要用它来搭建公司内部的maven私服。这是目前最新版本,网上比较难找到,所以放到这里。

    nexus使用+Maven仓库管理

    nexus Maven

    Nexus Maven 操作手册.pdf

    在Ubuntu16.04平台搭建maven私有服务器,包括私服的配置和在项目中私有仓库引入和使用。 Maven可以通过一小段描述信息来管理项目的构建,报告和文档的项目管理工具软件。 Nexus 是一个强大的仓库管理器。

    maven3+nexus2搭建本地,私有仓库

    maven3+nexus2搭建本地和私有仓库详细步骤 ,有图有真相,希望对你有帮助

    Nexus3私有仓库.pdf

    从基础概念出发,详解如何搭建并维护一个安全高效的Maven、npm、Docker等多类型组件的私有仓库,包括仓库创建、权限管理、代理远程仓库以及与CI/CD流程的集成等内容,全方位覆盖Nexus3的核心功能及其实战技巧。...

    部署Nexus 代理docker

    文档图文并茂的详细描述了linux下Nexus 的部署,同时也提供...nexus支持搭建docker 仓库、maven仓库、yum仓库等 nexus主要类型仓库支持三种模式hosted、proxy、group每种模式有不同用法和功能,具体解释可参考官方说明

    拥抱AndroidStudio之四:Maven仓库使用与私有仓库搭建

    使用AndroidStudio,必然要与maven仓库频繁打交道,在创造和分享自己打造的Androidlibrary的时候,maven仓库的知识更是必不可少。本章将为开发者系统梳理这方面的知识。笔者曾经不思量力的思考过『是什么推动了...

    maven 库管理工具 nexus 3.55 - 基于其可以搭建私有库

    - maven 库管理工具 - 基于其可以搭建私有库 -windows 版本

    nexus3远程搭建maven私服(离线)

    如果安装nexus3.x搭建maven私服,前提需要在Linux服务器安装1.8JDK以及3.xMAVEN版本 1、安装jdk和maven: (1)、下载jdk1.8Linux版本,上传于指定目录下并解压(maven也一样), (2)、执行 vim /etc/profile命令...

    maven私服nexus.war

    maven私有服务器搭建工具nexus的war包,可直接放在如tomcat之类的服务器下部署运行。

    nexus-3.38.0-01-unix.tar.gz

    linux,maven私有仓库搭建安装包

    nexus-3.38.0-01-win64

    windows,maven私有仓库搭建安装包

    nexus2.14.14.zip搭建maven私服工具——linux版

    nexus2.14.14.zip搭建maven私有仓库工具,linux版。在linux下解压,./bin/nexus start启动,默认情况下,不建议以root用户运行Nexus,可以修改bin/nexus中的配置跳过警告(修改RUN_AS_USER=root),vi bin/nexus,...

Global site tag (gtag.js) - Google Analytics