vdenotaris
vdenotaris

Reputation: 13637

Cross dependency issue with Google Collection and Google Guava on Shrinkwrap-resolver

I'm dealing with the development of a Java EE project that involves several tools such as jBPM, Hibernate, Resteasy, ect.

In order to manage dependencies, I'm using Maven: my pom.xml is available here.

Now, I'd like to use inside that project QueryDSL 3.4.3 that depends on Google Guava 14.0.1: unfortunately, something imports as dependency Google Collections 1.0 that generates a conflict with Google Guava 14.0.1.

  1. Is it possible to understand where Google Collections is from?
  2. Is there a way to resolve this issue safety? (Now, I'm just removing Google Collections's jar from the deployment folder)

Update

By using the command mvn dependency:tree, I found that Google Collections 1.0 comes from:

<dependency>
    <groupId>org.jboss.shrinkwrap.resolver</groupId>
    <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
</dependency>

Now, I've just to understand if it will work well also by excluding google-collections.

Upvotes: 3

Views: 2032

Answers (1)

vdenotaris
vdenotaris

Reputation: 13637

As said, Google Collection dependency comes from shrinkwrap-resolver-impl-maven.

I resolved that issue by editing the pom.xml as follows:

<!-- ShrinkWrap Maven Resolver for Arquillian Tests -->
<dependency>
    <groupId>org.jboss.shrinkwrap.resolver</groupId>
    <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
    <scope>test</scope>
    <exclusions>
        <exclusion>
            <groupId>com.google.collections</groupId>
            <artifactId>google-collections</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Then:

<!-- Arquillian profiles -->
<profiles>
    <!-- Arquillian test profile managed by JBoss AS 7 -->
    <profile>
        <id>arquillian-jbossas-managed</id>
        <dependencies>
            <dependency>
                <groupId>org.jboss.as</groupId>
                <artifactId>jboss-as-arquillian-container-managed</artifactId>
                <scope>test</scope>
                    <exclusions>
                        <exclusion>
                            <artifactId>google-collections</artifactId>
                            <groupId>com.google.collections</groupId>
                        </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </profile>
</profiles>

Now, it works fine.

Upvotes: 1

Related Questions