如何在Graphene 2.3上制作MavenImporter

时间:2017-11-19 19:02:50

标签: jboss-arquillian arquillian-drone graphene2

我正在使用基于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)

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

1 个答案:

答案 0 :(得分:0)

现在它正在运作。我的pom看起来如下

<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>