Plugins 如何将maven插件上载到Nexus存储库?
我想上传我的自定义maven插件到nexus存储库 我的问题是,当我像普通依赖一样通过web IU将插件上传到nexus时,maven找不到它: Plugin com.huawei:maven项目版本Plugin:1.0或其 无法解析依赖项:无法读取项目描述符 对于com.huawei:maven项目版本plugin:jar:1.0:找不到 com.mycompany:maven项目版本插件:pom:1.0 in 缓存在 本地存储库,在更新之前不会重新尝试解析 nexus的间隔已过或强制更新->[帮助1] 但当我通过命令行将插件安装到maven local Repository(而不是nexus)时,一切都很好 那么,安装自定义maven插件和安装“非插件”工件之间有什么区别呢?有什么窍门吗 My settings.xml:Plugins 如何将maven插件上载到Nexus存储库?,plugins,maven,nexus,Plugins,Maven,Nexus,我想上传我的自定义maven插件到nexus存储库 我的问题是,当我像普通依赖一样通过web IU将插件上传到nexus时,maven找不到它: Plugin com.huawei:maven项目版本Plugin:1.0或其 无法解析依赖项:无法读取项目描述符 对于com.huawei:maven项目版本plugin:jar:1.0:找不到 com.mycompany:maven项目版本插件:pom:1.0 in 缓存在 本地存储库,在更新之前不会重新尝试解析 nexus的间隔已过或强制更新->
关系
*
http://localhost:8081/nexus/content/groups/public
关系
中心的
http://central
真的
真的
中心的
http://central
真的
真的
关系
问题解决了。嗯,我不知道怎么做,但今天一切都是工作。我想问题出在Nexus缓存中。我刚刚删除了我的托管存储库并再次创建了它。也许有一些不太激进的方法,但我不知道它们=)删除工件,然后“终止缓存”,在我的例子中没有帮助
好吧,我的问题的答案是:Nexus中的安装插件和非插件工件之间没有任何区别,只有一个不同。如果选择GAV定义:GAV参数,则必须在组合框“打包”中选择“maven插件”
我认为没有必要编写一步一步的指令,它非常简单。只需选择托管存储库->工件上载选项卡并填写必填字段。还要添加的是,您还必须上载Maven插件的pom。如果不这样做,Nexus将自动生成一个不正确的。i、 它只是一个基本的pom,由版本、artifactID、打包和groupID组成 需要了解更多关于maven设置的信息。你在settings.xml或pom.xml中使用插件库吗?@Michael,正如你所说,我添加了我的settings.xml。但我认为,问题不在这里。我可以从nexus下载所有其他依赖项:从托管存储库下载我的依赖项,从代理存储库下载所有其他依赖项。我可以下载我的插件,如果我标记他们喜欢。但当我试着像maven一样设置它们时,却找不到它。
<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>