我想將我的自定義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