如何在Maven pom.xml中提供Nexus路径



我使用maven为我的项目,需要提供一个Nexus路径后提供GroupId, ArtifactId和版本。

<dependency>
<groupId>com.org.abc</groupId>
<artifactId>myartifactid</artifactId>
<version>myversion</version>
</dependency>
<dependency>
<groupId>com.org.def</groupId>
<artifactId>myartifactid</artifactId>
<version>myversion</version>
</dependency>
<dependency>
<groupId>com.org.ghi</groupId>
<artifactId>myartifactid</artifactId>
<version>myversion</version>
</dependency>

我的Nexus路径-https://nexus/content/repositories/

路径中存在的工件-https:/mynexusdomain/联系/内容/仓库/照片/com/org/abc/myartifactid/MySnapshotVersion/plugins/MyRequiredJars

Settings.xml:

<?xml version="1.0" encoding="utf-8"?>
<settings xmlns="http://maven.apache.org/settings/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:/Maven_repo</localRepository>
<mirrors>
<mirror>
<id>nexus</id>          
<name>Nexus</name>
<url>http://NexusDomain/nexus/content/repositories/myrepo/myrepo1/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>

在这里,根据pom文件,我可以提到组(com.org.abc)、工件(myartifactid)。是否有任何可能的方法来提及在nexus url链接后的路径。

任何输入将是非常感谢。谢谢!

不,你不能在Nexus中使用文件夹。只有groupId, artifactId, version。如果您需要加载其他jar,请使用它们各自的groupId、artifactId、version来加载它们。

最新更新