我正在将旧版应用程序从Jboss 6迁移到Wildfly18。当我尝试通过maven打包我的应用程序时,出现错误:
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:
Found Banned Dependency: javax.inject:javax.inject:jar:1
Found Banned Dependency: javax.activation:activation:jar:1.1
Found Banned Dependency: stax:stax-api:jar:1.0.1
Found Banned Dependency: org.slf4j:slf4j-log4j12:jar:1.7.25
Found Banned Dependency: com.sun.mail:javax.mail:jar:1.5.6
Found Banned Dependency: com.google.inject:guice:jar:4.2.3
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability. See above detailed error message.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.775 s
[INFO] Finished at: 2020-10-22T12:50:47-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (ban-bad-dependencies) on project Common: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
研究这个问题后,我的项目确实确实依赖于由wildfly pom中的maven-enforcer插件列出为“被禁止”的工件。我已经能够解决某些依赖关系,但是像Guice这样的其他依赖关系则很难删除。我知道我可以在自己的poms中覆盖执行程序设置,但是我不想在不知道为什么将它们首先列入黑名单的情况下这样做。
有人知道我在哪里可以找到解释为何某些文物被野蝇阻止的文档?有没有人尝试过将Guice与wildfly一起成功使用?
更新:
我pom的父母:
<parent>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-parent</artifactId>
<version>18.0.1.Final</version>
</parent>