美文网首页
Nexus3搭建与maven连接发布

Nexus3搭建与maven连接发布

作者: Martin_阿锤 | 来源:发表于2018-06-08 18:30 被阅读14次
  1. Why
    统一各开发人员版本。开发组内包共享。Docker镜像管理。
  2. 步骤
    下载
    http://www.sonatype.com/download-oss-sonatype
    解压后启动。(linux下有root的权限提示,不影响)
    windows: ./bin/nexus.exe /run
    默认的超级管理员账号admin,密码:admin123
    几个默认的库:
    maven-central:maven中央库,默认从https://repo1.maven.org/maven2/拉取jar
    maven-releases:私库发行版jar
    maven-snapshots:私库快照(调试版本)jar
    maven-public:仓库分组,把上面三个仓库组合在一起对外提供服务,在本地maven基础配置settings.xml中使用。

maven的settings文件配置

<settings>
<pluginGroups>
<pluginGroup>org.sonatype.plugins</pluginGroup>
</pluginGroups>
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/repository/maven-public/</url>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>

工程pom配置:

<distributionManagement>
<repository>
<id>nexus</id>
<name>Releases</name>
<url>http://localhost:8081/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Snapshot</name>
<url>http://localhost:8081/repository/maven-snapshots</url>
</snapshotRepository>

<build>
<defaultGoal>compile</defaultGoal>
<finalName>page</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</distributionManagement>

发布时:deploy -e

平时引用的时候都会先下载到nexus仓库

相关文章

  • Nexus3搭建与maven连接发布

    Why统一各开发人员版本。开发组内包共享。Docker镜像管理。 步骤下载http://www.sonatype....

  • Nexus3 私服的使用

    一、下载与安装 Maven Nexus3私服搭建指南,点击查看 二、Maven配置 打开Maven配置文件 set...

  • maven备忘

    1. 搭建私有库 使用docker搭建私有maven库,docker image为sonatype/nexus3 ...

  • 8 私服相关

    1 私服:nexus搭建流程Maven Nexus3私服搭建指南https://www.jianshu.com/p...

  • Android 打包上传Maven私库

    一.Maven私服搭建 下载nexus3地址:https://www.sonatype.com/download-...

  • Android 打包上传Maven库

    一.Maven私服搭建 下载nexus3地址:https://www.sonatype.com/download-...

  • 基于Docker搭建Maven私服

    初次搭建Maven私服,记录一下自己遇到的两个小问题。 1.碰到了400错误:因为自己Maven nexus3中新...

  • maven搭建nexus3(操作maven)

    环境准备: 系统:centos7 网络:处于内网环境中,需要配置代理 软件包:nexus-3.14.0-04-un...

  • maven学习笔记

    1.maven环境配置2.配置maven3.maven私服 nexus3 配置4.maven使用nexus仓库5....

  • 搭建组件仓库并发布

    gradle maven nexus搭建组件仓库与发布 多个Android app应用需要开发,那么很有可能你需要...

网友评论

      本文标题:Nexus3搭建与maven连接发布

      本文链接:https://www.haomeiwen.com/subject/aetgsftx.html