zoukankan      html  css  js  c++  java
  • MAVEN学习笔记之私服Nexus(2)

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

    
    私有服务器搭建
        Nexus
    
        www.snatype.org下载
        snatype-work 是默认nexus存储nexus
    
        a:将bin添加到环境中 Adminisrator path 
        b:修改java的绝对路径
        文件binjswconfigwrapper.config
        内容wrapper.java.command=E:IDEJavaJDKinjava
        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)
        mavensetting.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
  • 相关阅读:
    4种方法帮你解决IntelliJ IDEA控制台中文乱码问题
    万字长文:解读区块链7类共识算法
    CoralCache:一个提高微服务可用性的中间件
    探究Python源码,终于弄懂了字符串驻留技术
    OAuth:每次授权暗中保护你的那个“MAN”
    厉害了!这群95后正在用三维成像技术让科幻变成现实
    华为云FusionInsight MRS在金融行业存算分离的实践
    【新春特辑】发压岁钱、看贺岁片、AI写春联……华为云社区给大家拜年了
    Java实现 蓝桥杯 算法训练 天数计算
    WebRTC框架中的硬件加速
  • 原文地址:https://www.cnblogs.com/lanzhi/p/6468001.html
Copyright © 2011-2022 走看看