0

I'm new to maven. My gwt-compatible project uses PlayN, which has a dependency on Google Guava r09:

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>r09</version>
</dependency>

(The project isn't GWT itself, but it is a dependency of a GWT project, so everything in it needs to be GWT compatible.)

I want to use the gwt compatible version of r12. What is the best way to do this? I tried adding r12 to my own pom:

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava-gwt</artifactId>
        <version>12.0</version>
    </dependency>

But Eclipse reports that r12 is "omitted for conflict with r09". I tried excluding r09 from PlayN, but that didn't work:

<dependency>
            <groupId>com.googlecode.playn</groupId>
            <artifactId>playn-java</artifactId>
            <version>1.1.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>guava</artifactId>
                    <groupId>com.google.guava</groupId>
                </exclusion>
            </exclusions>
        </dependency>

What is the best way to be able to use r12 in my project?

Nick Heiner
  • 119,074
  • 188
  • 476
  • 699

2 Answers2

0

I was able to use Guava r11 with my project. I provide step-by-step instructions, which I would expect them to work equally well for r12, here:

I try to know as little as possible about the mechanics of Maven, but I don't see any exclusions in my pom file. You can find a full copy of the file here:

Community
  • 1
  • 1
klenwell
  • 6,978
  • 4
  • 45
  • 84
0

I would say that it is safer to specify the version you aim to use, and exclude the transitive dependencies that could lead to trouble.

If you want further support on this, you can run

mvn dependency:tree

before or after you add the exclusion, and post the result here

Samuel EUSTACHI
  • 3,116
  • 19
  • 24