zoukankan      html  css  js  c++  java
  • maven私服

    一、入门
        1、下载并解压nexus文件
        2、运行nexusin
    exus.exe /run
        3、浏览器输入localhost:8081
        4、登录用户名admin,密码在E:sonatype-work
    exus3admin.password
        5、更改密码
        6、nexus配置文件nexusetc
    exus-default.properties
    二、上传jar包到私服
        1、settings.xml
            <servers>  
                <server>  
                    <id>releases</id>  
                    <username>admin</username>  
                    <password>admin123</password>  
                </server>  
                <server>  
                    <id>snapshots</id>  
                    <username>admin</username>  
                    <password>admin123</password>  
                </server>    
            </servers> 
        2、pom.xml
            <distributionManagement>  
                <repository>  
                    <id>releases</id>
                    <url>http://127.0.0.1:8081/nexus/content/repositories/releases/</url>  
                </repository>  
                <snapshotRepository>  
                    <id>snapshots</id>
                    <url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url>  
                </snapshotRepository>
            </distributionManagement>
        3、项目运行mvn deploy命令
    三、从私服下载jar包
        1、settings.xml
            <profiles>  
                <profile>  
                    <id>dev</id>  
                    <repositories>  
                        <repository>  
                            <id>nexus</id>  
                            <url>http://127.0.0.1:8081/nexus/content/groups/public/</url>  
                            <releases>  
                                <enabled>true</enabled>  
                            </releases>  
                            <snapshots>  
                                <enabled>true</enabled>  
                            </snapshots>  
                        </repository>  
                    </repositories>  
                    <pluginRepositories>
                        <pluginRepository>
                            <id>public</id>
                            <name>Public Repositories</name>
                            <url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
                        </pluginRepository>
                    </pluginRepositories>
                </profile>  
            </profiles>  
            <activeProfiles>  
                <activeProfile>dev</activeProfile>  
            </activeProfiles>  
    四、安装第三方jar包到本地仓库
        mvn install:install-file -DgroupId=com.wuxi -DartifactId=practice -Dversion=1.1.1 -Dpackaging=jar -Dfile=jarPath
    五、安装第三方jar包到私服
        1、settings.xml
            <servers>  
                <server>  
                    <id>thirdparty</id>  
                    <username>admin</username>  
                    <password>admin123</password>  
                </server>  
            </servers>
        2、项目运行命令
            mvn deploy:deploy-file -DgroupId=com.wuxi -DartifactId=practice -Dversion=1.1.1 -Dpackaging=jar -Dfile=jarPath -Durl=http://127.0.0.1:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty
  • 相关阅读:
    新的for增强循环方法,记录一下,方便以后使用
    Intellij IDEA 自动生成 serialVersionUID
    Java知识点汇总[Review]
    D16-常用十种算法[Java数据结构和算法]
    W9-请求响应[JavaWeb]
    D15-图[Java数据结构和算法]
    D14-多路查找树[Java数据结构和算法]
    D13-平衡二叉树[Java数据结构和算法]
    D12-二叉排序树[Java数据结构和算法]
    D11-堆排序和赫夫曼编码[Java数据结构和算法]
  • 原文地址:https://www.cnblogs.com/linding/p/13623976.html
Copyright © 2011-2022 走看看