maven - 如何在单个 maven settings.xm 中添加内部和外部工件
问题描述
嗨,我是 maven settings.xml 的新手,请和我一起裸露
目前正在开发一个使用 JFrog Artifactory 的项目。并且 settings.xml 有一个镜像部分,它指向工件,并且还有一个包含存储库和 pluginRepositories 的配置文件。
现在所有依赖项都从该工件中提取(假设他们已经将这些依赖项安装到该工件中)。
我需要帮助来从外部回购中提取新的依赖项或现有依赖项的新版本如何做到这一点。
我想我需要在 settings.xml 中添加新的 repo url,我可以同时添加两个 repos(如果不去外部 repo,则查找内部)
有人可以指导我或使用内部和外部回购示例 settings.xml 会有所帮助。
谢谢
示例 settings.xml 文件如下所示
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
<id>central</id>
</server>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
<id>snapshots</id>
</server>
</servers>
<mirrors>
<mirror>
<mirrorOf>*</mirrorOf>
<name>test</name>
<url>http://localhost:8082/artifactory/test</url>
<id>test</id>
</mirror>
</mirrors>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://localhost:8082/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://localhost:8082/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://localhost:8082/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://localhost:8082/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
解决方案
推荐阅读
- mocking - Mockito 测试失败,类型为“Null”不是“Future”类型的子类型
' - python-3.x - 使用 pyinstaller 和烧瓶应用程序打开浏览器并检测浏览器选项卡何时关闭?
- spring - 搭建Spring boot comman核心库模块
- javascript - Json 解析 url prestashop webservice
- excel - 将数据从数据透视表复制到另一个
- android-ndk - 为什么我在执行使用 Android NDK 构建的程序时收到未定义符号错误?
- ios - 与 mapView.animate 一起使用时 GMSCameraUpdate 有时不起作用
- ethereum - 为什么以及何时调用 setApprovalForAll?
- python - Python Beautiful Soup:获取类元素文本的问题
- reactjs - 我想获取我在第一个选择中单击的类别的子类别以在第二个选择中显示它