Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven dependency conversion issues #2961

Closed
dconnelly opened this issue Apr 29, 2017 · 6 comments
Closed

Maven dependency conversion issues #2961

dconnelly opened this issue Apr 29, 2017 · 6 comments
Assignees

Comments

@dconnelly
Copy link
Contributor

dconnelly commented Apr 29, 2017

Please answer these questions before submitting your issue.

What version of gRPC are you using?

1.3.0

What JVM are you using (java -version)?

1.8.0_121

What did you do?

mvn compile

If possible, provide a recipe for reproducing the error.

Have the following dependencies in Maven:

<dependency>
  <groupId>io.grpc</groupId>
  <artifactId>grpc-netty</artifactId>
  <version>1.3.0</version> 
</dependency>
<dependency>
  <groupId>io.grpc</groupId>
  <artifactId>grpc-protobuf</artifactId>
  <version>1.3.0</version>
</dependency>
<dependency>
  <groupId>io.grpc</groupId>
  <artifactId>grpc-stub</artifactId>
  <version>1.3.0</version>
</dependency>

Looks like artifact com.google.api.grpc:grpc-google-common-protos has a dependency
on grpc-all:1.0.1 which causes a convergence issue if you have the above dependencies and you use the dependency enforcer plugin in Maven.

The workaround is to add grpc-all as an exclusion for that dependency which is always a bit scary.

What did you expect to see?

No dependency conversion issues.

What did you see instead?

Dependency conversion failure in Maven.

@pambrose
Copy link

I am seeing the same issue.

@ejona86
Copy link
Member

ejona86 commented May 1, 2017

Your example did not include your Maven enforcer configuration. As an aside, Maven enforcer's requireSameVersions rule is silly. requireUpperBoundDeps is quite sensible though, because it verifies that Maven is doing what it should have done to begin with.

Eww... grpc-google-common-protos:0.1.6 depends on grpc-all. We should upgrade to the latest (0.1.9) which depends on grpc-stub instead. But even better, the grpc and proto artifacts have been split so we can use proto-google-common-protos instead, which has no grpc dependency.

@ejona86
Copy link
Member

ejona86 commented May 1, 2017

Hmm... actually, we do have an exclusion in place:

    <dependency>
      <groupId>com.google.api.grpc</groupId>
      <artifactId>grpc-google-common-protos</artifactId>
      <version>0.1.6</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>io.grpc</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>com.google.api</groupId>
        </exclusion>
      </exclusions>
    </dependency>

But it uses wildcards, so maybe it is a wildcard issue. I see wildcards were apparently added in Maven 3 (ish). Simply updating Maven may fix the issue for you.

@dconnelly
Copy link
Contributor Author

Yeah, we are running enforcer with the dependencyConvergence rule enabled. I will try switching to requireUpperBoundDeps which definitely seems more sensible.

Also, we are running Maven 3.3.9 which I believe has the wildcard fix. I wonder if the exclusion is not being picked up transitively somehow?

@ejona86
Copy link
Member

ejona86 commented May 5, 2017

@dconnelly, well, I guess it doesn't matter why the wildcard doesn't work, since it isn't really necessary. My only concern is that the problem won't be resolved since it seems we have an incomplete understanding of what is causing the breakage. I just uploaded a 1.4.0-SNAPSHOT to https://oss.sonatype.org/content/repositories/snapshots/ . Could you try it out? If things look good, then we can release a 1.3.1 at some point.

(Note: When you try it out, there should be no reason that you need to upgrade the code generator.)

@ejona86
Copy link
Member

ejona86 commented Jun 1, 2017

Closing, since this was resolved in #2965.

@ejona86 ejona86 closed this as completed Jun 1, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Sep 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants