Specify earlier dated version of requestfactory-server-2.8.0-SNAPSHOT with Maven

214 views
Skip to first unread message

Seth

unread,
May 4, 2016, 2:46:03 PM5/4/16
to GWT Users

Hi all,


After some jar hell, I figured out that the requestfactory-server-2.8.0-SNAPSHOT after March 20, 2016 (or so) seems to be including some Gson classes (and it doesn't seem to use a dependency). These Gson classes are causing some classpath problems with another dependency that depends on Gson 2.2.4 release resulting in some not-so-nice NoClassDefFound exceptions.


The only remedy I found was to replace the requestfactory-server-2.8.0-SNAPSHOT maven includes with a version from March 20, 2016 (or earlier). 


Does anyone know how to specify a more detailed version for the requestfactory-server-2.8.0-SNAPSHOT  so that Maven will just build with the snapshot version from March 20, 2016?


I understand that SNAPSHOT means latest and there's a beta1, but the 2.8 beta1 is almost 6 months old now. And it seems as though it will be much harder to get an actual Gson dependency for requestfactory-server (or to resolve the class duplication) in the short term.


Many thanks in advance,


-Seth

Thomas Broyer

unread,
May 5, 2016, 5:34:34 AM5/5/16
to GWT Users


On Wednesday, May 4, 2016 at 8:46:03 PM UTC+2, Seth wrote:

Hi all,


After some jar hell, I figured out that the requestfactory-server-2.8.0-SNAPSHOT after March 20, 2016 (or so) seems to be including some Gson classes (and it doesn't seem to use a dependency). These Gson classes are causing some classpath problems with another dependency that depends on Gson 2.2.4 release resulting in some not-so-nice NoClassDefFound exceptions.


Thanks for the report, I'll get it fixed.
 

The only remedy I found was to replace the requestfactory-server-2.8.0-SNAPSHOT maven includes with a version from March 20, 2016 (or earlier). 


Does anyone know how to specify a more detailed version for the requestfactory-server-2.8.0-SNAPSHOT  so that Maven will just build with the snapshot version from March 20, 2016?


You should be able to specify a timestamped version, e.g. 2.8.0-20160502.055217-237 for May, 5th build; but beware that older snapshots are regularly deleted.
(see https://oss.sonatype.org/content/repositories/google-snapshots/com/google/web/bindery/requestfactory-server/2.8.0-SNAPSHOT/ for available versions; unfortunately, while the history might look big, only signatures are kept –for some reason, probably a bug in the cleanup task on Sonatype's side– for older snapshots, and you won't find builds as old as the one you'd like)
 

I understand that SNAPSHOT means latest and there's a beta1, but the 2.8 beta1 is almost 6 months old now. And it seems as though it will be much harder to get an actual Gson dependency for requestfactory-server (or to resolve the class duplication) in the short term.


Your best short-term bets are to either:
  • build a version yourself that you deploy into your own repo, with a non-snapshot version (e.g. 2.8.0-seth-20160405-g5d64514)
  • pre-process the snapshot JAR to remove the offending classes: use a Maven module that depends on the snapshot jar (with scope=provided) and repacks it without the offending classes (might be possible and easy with the maven-shade-plugin); then have your app depends on that module instead of the snapshot.

Thomas Broyer

unread,
May 5, 2016, 7:18:04 AM5/5/16
to GWT Users


On Thursday, May 5, 2016 at 11:34:34 AM UTC+2, Thomas Broyer wrote:


On Wednesday, May 4, 2016 at 8:46:03 PM UTC+2, Seth wrote:

Hi all,


After some jar hell, I figured out that the requestfactory-server-2.8.0-SNAPSHOT after March 20, 2016 (or so) seems to be including some Gson classes (and it doesn't seem to use a dependency). These Gson classes are causing some classpath problems with another dependency that depends on Gson 2.2.4 release resulting in some not-so-nice NoClassDefFound exceptions.


Thanks for the report, I'll get it fixed.

Proposed fix: https://gwt-review.googlesource.com/14790 (needs testing)

Seth

unread,
May 6, 2016, 1:09:42 AM5/6/16
to GWT Users
Hi Thomas,

Thanks so much. I thought that the timestamped snapshot would be available if it was listed, this is probably why it wasn't working for me when I tried with the specific earlier version. I ran into the maven-shade-plugin too, looks like it's a nice option. Thanks for the details on the approach. I'm guessing your fix will be in the snapshot soon, so will definitely test it out to confirm that it fixed the issue.

Thanks again.
Reply all
Reply to author
Forward
0 new messages