如何在 Maven 中导入 Wildfly 依赖项

vcj*_*vcj 5 java jboss web-applications maven wildfly

我正在尝试使用 Maven 编译一个项目(webapp),并且该项目“使用”位于 Wildfly 安装目录(.../Wildfly.../modules/...)中的 .jar。有没有一种简单的方法可以通过 POM 导入所有这些模块?我试过使用:

<dependency>
    <groupId>org.wildfly</groupId>
    <artifactId>wildfly-client-all</artifactId>
    <version>10.1.0.Final</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

它没有用。之后我尝试使用:

<dependency>
    <groupId>org.wildfly</groupId>
    <artifactId>wildfly-ejb-client-bom</artifactId>
    <version>10.1.0.Final</version>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>org.wildfly</groupId>
    <artifactId>wildfly-jms-client-bom</artifactId>
    <version>10.1.0.Final</version>
    <type>pom</type>
</dependency>
Run Code Online (Sandbox Code Playgroud)

也没有效果,给我以下错误:

Could not resolve dependencies for project 
someproject:someproject:war:0.0.1-SNAPSHOT: The following artifacts 
could not be resolved: org.apache.activemq:artemis-
commons:jar:1.1.0.wildfly-017, org.apache.activemq:artemis-core-
client:jar:1.1.0.wildfly-017, org.apache.activemq:artemis-hqclient-
protocol:jar:1.1.0.wildfly-017, org.apache.activemq:artemis-jms-
client:jar:1.1.0.wildfly-017, org.slf4j:jcl-over-slf4j:jar:1.7.7.jbossorg-1: 
Could not find artifact org.apache.activemq:artemis-
commons:jar:1.1.0.wildfly-017 in central 
(https://repo.maven.apache.org/maven2)
Run Code Online (Sandbox Code Playgroud)

任何提示将不胜感激。

hra*_*cek 1

wildlfy 功能包[ 1][2] 包含 Wildlfy 用于分发的几乎所有内容。但是,在大多数情况下,这具有您实际需要的更多依赖项。所以,请注意这一点。

您还可以查看Wildlfy BOM [3][4],这可能对您也有用。

快乐编码!


[1] https://mvnrepository.com/artifact/org.wildfly/wildfly-feature-pack/11.0.0.Final

[2] https://github.com/wildfly/wildfly/tree/master/feature-pack/src/main/resources/modules/system/layers/base

[3] https://mvnrepository.com/artifact/org.wildfly.bom/wildfly-javaee7

[4] https://github.com/wildfly/boms