我想将我的自定义maven插件上传到nexus存储库。如何将maven插件上传到Nexus存储库?
我的问题是,当我上传我的插件,通过网络IU像普通的依赖关系,行家不能找到它:
插件com.huawei:Maven的项目版本插件:1.0其中一个 依赖项无法解析:无法读取com.huawei的工件描述符 :maven-project-version-plugin:jar:1.0:未能找到 com.mycompany:maven-project-version-plugin:pom :1.0中的 http://localhost:8081/nexus/content/groups/public被缓存在 本地存储库中,直到更新 连接的时间间隔才会重新解析分辨率已经过去或更新被迫 - > [帮助1]
但是,当我安装我的插件maven本地repositiry(非nexus)通过命令行一切都很好。
那么,安装自定义maven插件和安装“非插件”artefact的区别是什么?有什么技巧吗?
我的settings.xml:
<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">
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<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>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
需要了解更多关于你的maven设置。你在settings.xml或pom.xml中使用任何插件库吗? – Michael
@Michael正如你所说,我添加了我的settings.xml。但我认为,问题不在于此。我可以从nexus下载所有其他依赖项:托管存储库中的依赖项以及代理存储库中的所有其他依赖项。我可以下载我的插件,如果我将它们标记为。但是当我尝试设置他们像 maven找不到它。 –
Sergey