自 Wildfly 15 起,Arquillian 托管测试不再有效

很长一段时间以来,我一直在使用 Wildlfy 进行 Arquillian 测试。目前我从 Wildfly 14 更新到 Wildfly 17。但是现在,所有 Arquillian 测试都失败了。我将其简化为单个 POM 和 arquillian.xml,主要取自网络中的教程和示例,结果发现,所有这些都适用于 Wildfly 14,而不是不适用于 Wildfly 15、16 或 17。


pom.xml:


<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>


    <groupId>org.jboss.arquillian</groupId>

    <artifactId>wildfly-arquillian-managed-example</artifactId>

    <version>1.0-SNAPSHOT</version>

    <properties>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    </properties>


    <dependencyManagement>

        <dependencies>

            <dependency>

                <groupId>org.jboss.arquillian</groupId>

                <artifactId>arquillian-bom</artifactId>

                <version>1.5.0.Final</version>

                <scope>import</scope>

                <type>pom</type>

            </dependency>

        </dependencies>

    </dependencyManagement>

    <dependencies>

        <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.12</version>

        </dependency>

        <dependency>

            <groupId>org.jboss.arquillian.junit</groupId>

            <artifactId>arquillian-junit-container</artifactId>

        </dependency>

        <dependency>

            <groupId>org.wildfly</groupId>

            <artifactId>wildfly-arquillian-container-managed</artifactId>

            <version>8.2.1.Final</version>

            <scope>test</scope>

        </dependency>

    </dependencies>



慕桂英3389331
浏览 53回答 1
1回答

汪汪一只猫

好的,我找到了答案!问题是 pom.xml 中的错误依赖项!错误的是:<dependency>&nbsp; &nbsp; <groupId>org.wildfly</groupId>&nbsp; &nbsp; <artifactId>wildfly-arquillian-container-managed</artifactId>&nbsp; &nbsp; <version>8.2.1.Final</version>&nbsp; &nbsp; <scope>test</scope></dependency>正确的是:<dependency>&nbsp; &nbsp; <groupId>org.wildfly.arquillian</groupId>&nbsp; &nbsp; <artifactId>wildfly-arquillian-container-managed</artifactId>&nbsp; &nbsp; <version>2.1.1.Final</version>&nbsp; &nbsp; <scope>test</scope></dependency>我刚刚在谷歌上搜索了“wildfly-arquillian-container-management”并使用了最高版本号。但这一次,较高的数字是较旧的状态,可能与 Wildfly 8.2.1 同步,但不再与 Wildfly 15 或更高版本一起使用。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java