0

我正在使用基于 jsf 的 Web 应用程序,并且我进行了一些使用 Arquillian 的功能测试。

我的 pom 文件的依赖项如下

<properties>
        <arquillian.version>1.1.14.Final</arquillian.version>
        <arquillian.graphene.version>2.2.1</arquillian.graphene.version>
        <arquillian.glassfish.version>1.0.1</arquillian.glassfish.version>
</properties>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>${arquillian.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

       <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.graphene</groupId>
            <artifactId>graphene-webdriver</artifactId>
            <version>${arquillian.graphene.version}</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-api-maven-archive</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-glassfish-remote-3.1</artifactId>
            <version>${arquillian.glassfish.version}</version>
            <scope>test</scope>
        </dependency>

我的部署方法从以下行开始

@Deployment
public static WebArchive createDeployment() throws IOException {
     MavenImporter x1 = ShrinkWrap.create(MavenImporter.class);
     ...
     ...
}

一切正常,但在 createDeployment 方法的第一行将 graphene-webdriver 依赖项从 2.2.1 更新到 2.3.2 后,会引发异常。

The current configuration has no mapping for type org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter, unable to determine extension. You should provide extension in the services descriptor file
    at org.jboss.shrinkwrap.api.UnknownExtensionTypeException.newInstance(UnknownExtensionTypeException.java:68)
    at org.jboss.shrinkwrap.api.UnknownExtensionTypeExceptionDelegator.newExceptionInstance(UnknownExtensionTypeExceptionDelegator.java:37)
    at org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader.findExtensionImpl(ServiceExtensionLoader.java:279)
    at org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader.loadExtensionMapping(ServiceExtensionLoader.java:246)
    at org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader.getExtensionFromExtensionMapping(ServiceExtensionLoader.java:160)
    at org.jboss.shrinkwrap.api.ArchiveFactory.create(ArchiveFactory.java:104)
    at org.jboss.shrinkwrap.api.ShrinkWrap.create(ShrinkWrap.java:136)

我做错了什么?你能帮助我吗?谢谢

4

1 回答 1

0

Now it's working. My pom looks like the following

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>1.1.15.Final</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.selenium</groupId>
            <artifactId>selenium-bom</artifactId>
            <version>3.8.1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-drone-bom</artifactId>
            <version>2.5.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.arquillian.graphene</groupId>
        <artifactId>graphene-webdriver</artifactId>
        <version>2.3.2</version>
        <type>pom/type>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
        <version>3.0.1</version>
        <scope>test</scope>
    </dependency>        
    <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
        <version>3.0.1</version>
        <scope>test</scope>
    </dependency>
    ...
    ...
</dependencies>
于 2017-12-23T21:48:48.323 回答