1

We are in the process of upgrading our grails 2.0.3 application to grails 2.2.0 with groovy 2 and jdk 1.7. However, we found that grails 2.2.0 comes with protobuf-java 2.4.1 which is causing a mismatch with a jar that our application uses to talk to the backend. That system uses protobuf-java 2.3.0. So any communication with that system fails.

We have tried excluding protobuf-java using the excludes tag in BuildConfig.groovy like so -

inherits("global") { excludes 'protobuf-java' }

We thought this would exclude only the version 2.4.1 that we got from grails. However, that seems to exclude all versions of this jar, even the one that we get as a transitive dependency from this jar we are using. If we try to use the excludes tag and then include the protobuf-java as a dependency in our pom with a version of 2.3.0, application restart fails with grails errors.

My questions:

  1. Is there a way that I can exclude only the specific version of protobuf-java jar (ie 2.4.1) using the excludes jar

  2. Is excluding one of the inherited dependencies of grails (protobuf java 2.4.1 in our case) and using a downgraded version advisable

If exclusion is not an option, is there any other better way of solving this issue

Jay Walker
  • 4,654
  • 5
  • 47
  • 53
mpandit
  • 11
  • 2

1 Answers1

0

We had a similar issue with Grails 2.0.3 and a library pulling in protobuf-java 3.4.0. We worked around it by running the war instead of 'grails run-app':

$ grails -Dgrails.env=dev war && java -jar target/com.acme.app-2.3.0.war

The class reloading features don't work well with this project anyway.

David Tinker
  • 9,383
  • 9
  • 66
  • 98