根据站点
https://maven.apache.org/plugins-archives/maven-shade-plugin-LATEST/shade-mojo.html
maven shade插件的最新版本是CCD_ 1,自2021-07-14年以来一直存在。
为了参考早期版本3.3.0-SNAPSHOT
,我在pom 中使用了以下参考
<pluginRepositories>
<pluginRepository>
<id>maven-snapshots</id>
<url>https://repository.apache.org/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
我的问题是如何在pom中引用3.3.1-SNAPSHOT
。运行mvn install
时,我收到以下错误:
ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.3.1-SNAPSHOT:shade ([...]) on project [...]: Execution [...] of goal org.apache.maven.plugins:maven-shade-plugin:3.3.1-SNAPSHOT:shade failed: Plugin org.apache.maven.plugins:maven-shade-plugin:3.3.1-SNAPSHOT or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-shade-plugin:jar:3.3.1-20220317.155034-43 -> org.slf4j:slf4j-api:jar:1.7.32: Failed to read artifact descriptor for org.slf4j:slf4j-api:jar:1.7.32: Could not transfer artifact org.slf4j:slf4j-api:pom:1.7.32 from/to maven-snapshots (https://repository.apache.org/content/repositories/snapshots/): transfer failed for https://repository.apache.org/content/repositories/snapshots/org/slf4j/slf4j-api/1.7.32/slf4j-api-1.7.32.pom: Unknown host repository.apache.org: Temporary failure in name resolution -> [Help 1]
那么slf4j的问题是什么呢?我能以某种方式解决这个问题吗?
谢谢!
PS:我之所以想试用最新版本,是因为我在运行mvn install
:时遇到了以下错误
带有maven阴影插件3.2.4
:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (owlex) on project owl: Error creating shaded jar: Unsupported class file major version 61 -> [Help 1]
带有maven阴影插件3.3.0-SNAPSHOT
:
3.3.1-SNAPSHOT
0
我可以建议使用已经发布的最新版本的maven shade插件3.3.0。
这将正确处理JDK 17。
https://www.mail-archive.com/announce@maven.apache.org/msg01066.html