maven~nexus开启游客下载

对于nexus这个私服务来说,匿名默认是不能下载包的,需要在nexus服务端进行配置

  • 配置
    maven~nexus开启游客下载

添加nexus私服

<!-- nexus下载包配置 -->
<repositories>
    <repository>
        <id>maven-public</id>
        <url>http://192.168.0.203:8081/repository/maven-public/</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

上传到私服

如果希望上传到仓库则需要账号密码

  • .m2/settings.xml配置
    <servers>
        <server>        
            <id>maven-public</id>
            <username>admin</username>
            <password>xxxx</password>
        </server>
    </servers>
* nexus上传配置
<distributionManagement>
    <repository>
        <id>releases</id>
        <name>Nexus Release Repository</name>
        <url>http://192.168.0.203:8081/repository/maven-releases/</url>
    </repository>
    <snapshotRepository>
        <id>snapshots</id>
        <name>Nexus Snapshot Repository</name>
        <url>http://192.168.0.203:8081/repository/maven-snapshots/</url>
    </snapshotRepository>
</distributionManagement>
上一篇:Jenkins+Maven+Gitlab+Nexus持续集成环境搭建


下一篇:docker环境下安装maven私服和gitlab