常用标签概览
- servers/server:配置私有仓库用户名和密码进行认证,以 id 进行关联。
- mirrors/mirror:配置镜像仓库拉取时的地址源和额外配置。
- profiles/profile:配置多个可能使用的镜像仓库。
- activeProfiles/activeProfile:配置默认激活的 profile,以 id 进行关联。
Oinone 私有仓库配置
以下配置可以在使用 Oinone 私有仓库的同时,也可以正常使用 aliyun 镜像源。
<servers>
<server>
<id>shushi</id>
<username>${username}</username>
<password>${password}</password>
</server>
</servers>
<mirrors>
<mirror>
<id>shushi</id>
<mirrorOf>shushi</mirrorOf>
<url>http://ss.nexus.ixtx.fun/repository/public</url>
<!-- 忽略 https 认证,maven 版本过高时需要配置 -->
<blocked>false</blocked>
</mirror>
</mirrors>
<profiles>
<profile>
<id>shushi</id>
<repositories>
<repository>
<!-- 对应 server.id -->
<id>shushi</id>
<url>http://ss.nexus.ixtx.fun/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<!-- 对应 server.id -->
<id>shushi</id>
<url>http://ss.nexus.ixtx.fun/repository/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>aliyun</id>
<repositories>
<repository>
<id>aliyun</id>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun</id>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!-- 使用 shushi 私有仓库 -->
<activeProfile>shushi</activeProfile>
<!-- 使用 aliyun 镜像仓库 -->
<activeProfile>aliyun</activeProfile>
</activeProfiles>
常见问题
使用 mvn 时无法拉取 Oinone 最新版镜像,提示找不到对应的包
原因:在 Oinone 开源后,oinone-pamirs 内核相关包都被部署到 maven 中央仓库,但由于其他镜像仓库的同步存在延时,在未正确同步的其他镜像源拉取时会出现找不到对应的包相关异常。
解决方案:检查 mirrors 中是否配置了 aliyun 镜像源,如果配置了,使用上述 Oinone 私有仓库配置重新配置后,再进行拉取。这一问题是由于 mirrors 配置不当,拦截了所有从 maven 中央仓库拉取的地址替换为了 aliyun 镜像源导致的。
Oinone社区 作者:张博昊原创文章,如若转载,请注明出处:https://doc.oinone.top/backend/25009.html
访问Oinone官网:https://www.oinone.top获取数式Oinone低代码应用平台体验