You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Christofer Dutz <ch...@c-ware.de> on 2014/10/03 16:31:02 UTC

Probjem with incompatable Guava versions in Falcon

Hi,

so I think I'm almost finished with adding Falcon support to Flexmojos. After being able to resolve all issues that I have come across, this one seems to be a blocker :-(

Falcon uses Guava ... Maven uses Guava too. Unfortunately the version Maven uses differs from the one Falcon uses. Especially one class (Eventually more than this) is causing trouble.

In the version Falcon is using the signature of "com.google.common.cache.CacheBuilder.build" is (guava.jar):

public <K1 extends K, V1 extends V> LoadingCache<K1, V1> build(CacheLoader<? super K1, V1> loader) {

in that of Maven it's (sisu-guava-0.9.9):

public <K1 extends K, V1 extends V> Cache<K1, V1> build(CacheLoader<? super K1, V1> loader) {

It seems that LoadingCache extends Cache so depending on Cache instead of LoadingCache would be an option, unfortunately the one method used throughout the code is "getUnchecked" but this is native to LoadingCache so it doesn't seem to be an option.

The problem ist hat Maven comes with guava ... the first maven version probably able to support a Flexmojos Build with Falcon will be 3.1.1 as this is the first version I found with guava 11 bundled, which seems to be the version the signature of the build-method changed.

Would it be difficult to change Falcon to be compatable with earlier versions of Maven?

Chris

AW: Probjem with incompatable Guava versions in Falcon

Posted by Christofer Dutz <ch...@c-ware.de>.
Falcon is the first project I have seen that is not directly a Maven project and that uses Guice. So I never had this problem.

The main problem ist hat Maven comes with some libs that are used in the versions that are in the maven installations lib directory. These always have priority over the versions sub-classloaders load. 

I tried several tricks, especially changing the type of the variable from LoadingCache to Cache und cast to LoadingCache wherever needed, but the JIT compiler of Java seems to detect the shortcut and replaces this with the right type :-(

Currently I'm sort of stuck and I coudln't find a way to override the version of maven ... think I'll post a question tot he maven dev list. Perhaps they can help.

Chris



-----Ursprüngliche Nachricht-----
Von: Alex Harui [mailto:aharui@adobe.com] 
Gesendet: Freitag, 3. Oktober 2014 16:55
An: 'dev@flex.apache.org'
Betreff: Re: Probjem with incompatable Guava versions in Falcon

Don¹t really know the answer.  Maybe Gordon or Darrell will have ideas.

Seems like if Maven is using older versions of popular JARs they must have hit issues like this before?  Are all Maven artifacts stuck to these older versions?

-Alex

On 10/3/14, 7:31 AM, "Christofer Dutz" <ch...@c-ware.de> wrote:

>Hi,
>
>so I think I'm almost finished with adding Falcon support to Flexmojos.
>After being able to resolve all issues that I have come across, this 
>one seems to be a blocker :-(
>
>Falcon uses Guava ... Maven uses Guava too. Unfortunately the version 
>Maven uses differs from the one Falcon uses. Especially one class 
>(Eventually more than this) is causing trouble.
>
>In the version Falcon is using the signature of 
>"com.google.common.cache.CacheBuilder.build" is (guava.jar):
>
>public <K1 extends K, V1 extends V> LoadingCache<K1, V1> 
>build(CacheLoader<? super K1, V1> loader) {
>
>in that of Maven it's (sisu-guava-0.9.9):
>
>public <K1 extends K, V1 extends V> Cache<K1, V1> build(CacheLoader<?
>super K1, V1> loader) {
>
>It seems that LoadingCache extends Cache so depending on Cache instead 
>of LoadingCache would be an option, unfortunately the one method used 
>throughout the code is "getUnchecked" but this is native to 
>LoadingCache so it doesn't seem to be an option.
>
>The problem ist hat Maven comes with guava ... the first maven version 
>probably able to support a Flexmojos Build with Falcon will be 3.1.1 as 
>this is the first version I found with guava 11 bundled, which seems to 
>be the version the signature of the build-method changed.
>
>Would it be difficult to change Falcon to be compatable with earlier 
>versions of Maven?
>
>Chris


Re: Probjem with incompatable Guava versions in Falcon

Posted by Gordon Smith <gs...@hotmail.com>.
I don't know Maven. It seems like it should have a way to build its targets using a classpath that is different from the classpath for running Maven itself.

- Gordon

> On Oct 3, 2014, at 8:01 AM, "Frédéric THOMAS" <we...@hotmail.com> wrote:
> 
> Not only this method is used in Falcon but also the CacheLoader to create new Scope Caches on the fly and CacheLoader seems to be introduced since the version 10.0
> 
> Frédéric THOMAS
> 
>> From: aharui@adobe.com
>> To: dev@flex.apache.org
>> Subject: Re: Probjem with incompatable Guava versions in Falcon
>> Date: Fri, 3 Oct 2014 14:54:41 +0000
>> 
>> Don¹t really know the answer.  Maybe Gordon or Darrell will have ideas.
>> 
>> Seems like if Maven is using older versions of popular JARs they must have
>> hit issues like this before?  Are all Maven artifacts stuck to these older
>> versions?
>> 
>> -Alex
>> 
>>> On 10/3/14, 7:31 AM, "Christofer Dutz" <ch...@c-ware.de> wrote:
>>> 
>>> Hi,
>>> 
>>> so I think I'm almost finished with adding Falcon support to Flexmojos.
>>> After being able to resolve all issues that I have come across, this one
>>> seems to be a blocker :-(
>>> 
>>> Falcon uses Guava ... Maven uses Guava too. Unfortunately the version
>>> Maven uses differs from the one Falcon uses. Especially one class
>>> (Eventually more than this) is causing trouble.
>>> 
>>> In the version Falcon is using the signature of
>>> "com.google.common.cache.CacheBuilder.build" is (guava.jar):
>>> 
>>> public <K1 extends K, V1 extends V> LoadingCache<K1, V1>
>>> build(CacheLoader<? super K1, V1> loader) {
>>> 
>>> in that of Maven it's (sisu-guava-0.9.9):
>>> 
>>> public <K1 extends K, V1 extends V> Cache<K1, V1> build(CacheLoader<?
>>> super K1, V1> loader) {
>>> 
>>> It seems that LoadingCache extends Cache so depending on Cache instead of
>>> LoadingCache would be an option, unfortunately the one method used
>>> throughout the code is "getUnchecked" but this is native to LoadingCache
>>> so it doesn't seem to be an option.
>>> 
>>> The problem ist hat Maven comes with guava ... the first maven version
>>> probably able to support a Flexmojos Build with Falcon will be 3.1.1 as
>>> this is the first version I found with guava 11 bundled, which seems to
>>> be the version the signature of the build-method changed.
>>> 
>>> Would it be difficult to change Falcon to be compatable with earlier
>>> versions of Maven?
>>> 
>>> Chris
>                         

RE: Probjem with incompatable Guava versions in Falcon

Posted by Frédéric THOMAS <we...@hotmail.com>.
Not only this method is used in Falcon but also the CacheLoader to create new Scope Caches on the fly and CacheLoader seems to be introduced since the version 10.0

Frédéric THOMAS

> From: aharui@adobe.com
> To: dev@flex.apache.org
> Subject: Re: Probjem with incompatable Guava versions in Falcon
> Date: Fri, 3 Oct 2014 14:54:41 +0000
> 
> Don¹t really know the answer.  Maybe Gordon or Darrell will have ideas.
> 
> Seems like if Maven is using older versions of popular JARs they must have
> hit issues like this before?  Are all Maven artifacts stuck to these older
> versions?
> 
> -Alex
> 
> On 10/3/14, 7:31 AM, "Christofer Dutz" <ch...@c-ware.de> wrote:
> 
> >Hi,
> >
> >so I think I'm almost finished with adding Falcon support to Flexmojos.
> >After being able to resolve all issues that I have come across, this one
> >seems to be a blocker :-(
> >
> >Falcon uses Guava ... Maven uses Guava too. Unfortunately the version
> >Maven uses differs from the one Falcon uses. Especially one class
> >(Eventually more than this) is causing trouble.
> >
> >In the version Falcon is using the signature of
> >"com.google.common.cache.CacheBuilder.build" is (guava.jar):
> >
> >public <K1 extends K, V1 extends V> LoadingCache<K1, V1>
> >build(CacheLoader<? super K1, V1> loader) {
> >
> >in that of Maven it's (sisu-guava-0.9.9):
> >
> >public <K1 extends K, V1 extends V> Cache<K1, V1> build(CacheLoader<?
> >super K1, V1> loader) {
> >
> >It seems that LoadingCache extends Cache so depending on Cache instead of
> >LoadingCache would be an option, unfortunately the one method used
> >throughout the code is "getUnchecked" but this is native to LoadingCache
> >so it doesn't seem to be an option.
> >
> >The problem ist hat Maven comes with guava ... the first maven version
> >probably able to support a Flexmojos Build with Falcon will be 3.1.1 as
> >this is the first version I found with guava 11 bundled, which seems to
> >be the version the signature of the build-method changed.
> >
> >Would it be difficult to change Falcon to be compatable with earlier
> >versions of Maven?
> >
> >Chris
> 
 		 	   		  

Re: Probjem with incompatable Guava versions in Falcon

Posted by Alex Harui <ah...@adobe.com>.
Don¹t really know the answer.  Maybe Gordon or Darrell will have ideas.

Seems like if Maven is using older versions of popular JARs they must have
hit issues like this before?  Are all Maven artifacts stuck to these older
versions?

-Alex

On 10/3/14, 7:31 AM, "Christofer Dutz" <ch...@c-ware.de> wrote:

>Hi,
>
>so I think I'm almost finished with adding Falcon support to Flexmojos.
>After being able to resolve all issues that I have come across, this one
>seems to be a blocker :-(
>
>Falcon uses Guava ... Maven uses Guava too. Unfortunately the version
>Maven uses differs from the one Falcon uses. Especially one class
>(Eventually more than this) is causing trouble.
>
>In the version Falcon is using the signature of
>"com.google.common.cache.CacheBuilder.build" is (guava.jar):
>
>public <K1 extends K, V1 extends V> LoadingCache<K1, V1>
>build(CacheLoader<? super K1, V1> loader) {
>
>in that of Maven it's (sisu-guava-0.9.9):
>
>public <K1 extends K, V1 extends V> Cache<K1, V1> build(CacheLoader<?
>super K1, V1> loader) {
>
>It seems that LoadingCache extends Cache so depending on Cache instead of
>LoadingCache would be an option, unfortunately the one method used
>throughout the code is "getUnchecked" but this is native to LoadingCache
>so it doesn't seem to be an option.
>
>The problem ist hat Maven comes with guava ... the first maven version
>probably able to support a Flexmojos Build with Falcon will be 3.1.1 as
>this is the first version I found with guava 11 bundled, which seems to
>be the version the signature of the build-method changed.
>
>Would it be difficult to change Falcon to be compatable with earlier
>versions of Maven?
>
>Chris