您的位置:首页 > 其它

本地安装nexus私服步骤以及配置到本地maven插件中

2017-11-24 23:05 751 查看
解压nexus的相关压缩文件: nexus-2.12.0-01-bundle.zip

进入软件文件的conf文件夹下的nexus.properties:

软件端口是8081,访问地址是http://localhost:8081/nexus,默认登录账户是admin密码是admin123,仓库分为4类7种

要想使用私服的jar包就要配置本地的maven插件setting.xml文件

这个是要访问私服的账户密码设置

要从私服下载的话,还要配置:

<profile>  

       <!--profile的id-->

       <id>dev</id>  

       <repositories>  

        <repository> 

          <!--仓库id,repositories可以配置多个仓库,保证id不重复-->

          <id>nexus</id>  

          <!--仓库地址,即nexus仓库组的地址-->

          <url>http://localhost:8081/nexus/content/groups/public/</url>  

          <!--是否下载releases构件-->

          <releases>  

           <enabled>true</enabled>  

          </releases>  

          <!--是否下载snapshots构件-->

          <snapshots>  

           <enabled>true</enabled>  

          </snapshots>  

        </repository>  

       </repositories> 

        <pluginRepositories> 

          <!-- 插件仓库,maven的运行依赖插件,也需要从私服下载插件-->

           <pluginRepository> 

              <!-- 插件仓库的id不允许重复,如果重复后边配置会覆盖前边 -->

              <id>public</id> 

              <name>Public Repositories</name> 

              <url>http://localhost:8081/nexus/content/groups/public/</url> 

          </pluginRepository> 

       </pluginRepositories> 

     </profile>

同时也要激活这个id为dev的profile

  <activeProfiles>

  <activeProfile>dev</activeProfile>

 </activeProfiles>

想要上传哪一个模块就要在哪一个模块的pom.xml文件中指定上传的地址:

<!--指定jar包上传地址 -->
  <distributionManagement>
    <repository>
      <id>releases</id>
    <url>http://localhost:8081/nexus/content/repositories/releases/</url>
    </repository>

    <snapshotRepository>
      <id>snapshots</id>
想上传哪一个项目模块的jar包就右键点击这个项目模块,runas选择mavenbuild…输入上传指令deploy即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  nexus maven 软件