前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >MAVEN学习笔记之私服Nexus(2)

MAVEN学习笔记之私服Nexus(2)

作者头像
王小雷
发布2019-05-26 16:30:31
4300
发布2019-05-26 16:30:31
举报
文章被收录于专栏:王小雷王小雷

版权声明:本文为王小雷原创文章,未经博主允许不得转载 https://blog.csdn.net/dream_an/article/details/49274339

MAVEN学习笔记之私服Nexus(2)

代码语言:javascript
复制
私有服务器搭建
    Nexus

    www.snatype.org下载
    snatype-work 是默认nexus存储nexus

    a:将bin添加到环境中 Adminisrator path 
    b:修改java的绝对路径
    文件bin\jsw\config\wrapper.config
    内容wrapper.java.command=E:\IDE\Java\JDK\bin\java
    c:cmd中 nexus install  ;nexus start

    localhost:8081/nexus
    login
    user:admin
    pass:admin123

    jqury类网站
    http://www.datatables.net/

2.0 nexus
常用工厂 group hosted hosted 三大工厂 
    三大工厂简介
    mvn:deploy 提交命令
    group控制都个工厂
    第一种 pom.xml(不推荐)
    <repositories>
        <repository>
            <id>nexus</id>
            <name>Nexus Repoitory</name>
            <url>http://localhost:8081/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases> 
            <--!snapshots默认是关闭的需要手动开启!-->
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    第二种 maven文件走中配置(推荐)  是的所有maven项目使用nexcus
    setting.xml
    增加如下内容:
    <profile>
    <id>nexusRepo</id>
    <repositories>
        <repository>
            <id>nexusProfile</id>
            <name>Nexus Repoitory</name>
            <url>http://localhost:8081/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases> 
            <--!snapshots默认是关闭的需要手动开启!-->
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    </profile>
    <activeprofiles>
    <!--只有激活才生效--!>
        <activeprofiles>nexusProfile</activeprofiles>
    </activeprofiles>

    第三种 配置镜像(更推荐)
    <!--工厂的镜像,只要mirrorof中的工厂要访问,都会自动来找镜像,
    如果镜像无法访问则不会再访问中央工厂,使用*表示所有的工厂都来这个镜像访问,推荐使用-->
        <mirror>
            <id>nexusMirror</id>
            <mirrorof>*</mirrorof>
            <name>Human Readable Name for this Mirror</name>
            <url>http://localhost:8081/nexus/content/groups/public/</url>
        </mirror>

    </mirror>

    <profile>
    <repositories>
        <repository>
            <id>central</id>
            <name>central Repoitory</name>
            <url>http://*</url>
            <layout>default<layout> 
            <--!snapshots默认是关闭的需要手动开启!-->
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    </profile>

发布工厂
    <distributionManagement>
        <repoaitory>
            <id>user-release</id>
            <name>user release res</name>
            <url>http://localhost:8081/nexus/content/repositories/releases/</url>
        </repoaitory>
        <snapshotRepoaitory>
            <id>user-snapshots</id>
            <name>user release res</name>
            <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
        </snapshotRepoaitory>
    </distributionManagement>

    需要授权(学习网址http://www.icoolxue.com/play/718)
    maven\setting.xml

        <server>
            <id>user-release</id>
            <username>deployment</username>
            <password>deployment123</password>
        </server>
        <server>
            <id>user-snapshots</id>
            <username>deployment</username>
            <password>deployment123</password>
        </server>

    </servers>

添加私有工厂
    增加hosted是
        release
        ADD-->ID Name Type
        再增加hosted
        snapshots
    添加权限 release snapshots
        name cmsprivilege
        all
    组织机构管理
        a:添加角色
        Roles-->Add-->ID NAME ADD(ALL)
        b:添加用户
        Users-->Add (Nexus User)-->ID Name Activie Add(cms role)

    最后修改 
        setting.xml   
        pom.xml url
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2015年10月20日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档