[英]How to resolve parent pom dependency issue: Failed to read artifact descriptor; Could not find artifact?
[英]Failed to read extensions descriptor. Could not find artifact in central
我已經創建了一個maven擴展 ,現在我嘗試使用它而不在本地安裝它。 所以我已經將它部署到我們自己的存儲庫(還不是maven中央存儲庫)中,但是出於某種原因,maven試圖從https://repo.maven.apache.org/maven2下載它,但是失敗了:
[警告]無法讀取擴展描述符/home/my-user/git/my-project/.mvn/extensions.xml:插件com.blablablah:kompile-maven-extension:1.0或其依賴項之一無法解析:在中央( https://repo.maven.apache.org/maven2 )中找不到工件com.blablablah:kompile-maven-extension:jar:1.0
我怎樣才能告訴maven從我們的存儲庫下載它呢?
我的〜/ .m2 / settings.xml配置了<repositories>
和<pluginRepositories>
來指向快照和指向我的repo的發行版,它適用於所有依賴項,但顯然不適用於此擴展名。
我還沒有在Maven文檔中找到任何有用的東西,因為擴展似乎仍然“太新”。
我的{project-root} /。mvn / extensions.xml看起來像這樣:
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>com.blablablah</groupId>
<artifactId>kompile-maven-extension</artifactId>
<version>1.0</version>
</extension>
</extensions>
我沒有修改項目pom.xml 。
我一直在研究整個項目的有效pom,並且中央存儲庫當然是作為每個模塊的常規存儲庫和插件存儲庫,但始終是我自己的存儲庫之后的最后一個條目。 我還沒有發現任何可以解釋為什么Maven僅在Maven Central中尋找我的擴展的東西。
我想念什么?
Maven版本是3.3.9。 我也在maven 3.5.0上進行了測試。
謝謝!
對我來說唯一有效的方法是將存儲庫添加到settings.xml並將其添加到活動配置文件中:
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<profiles>
<profile>
<id>tycho-stage</id>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>oss</id>
<url>https://oss.sonatype.org/content/repositories/orgeclipsetycho-1056</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>oss</id>
<url>https://oss.sonatype.org/content/repositories/orgeclipsetycho-1056</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>tycho-stage</activeProfile>
</activeProfiles>
</settings>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.