How to build Guava from latest source?

684 views
Skip to first unread message

Markus Jais

unread,
Apr 4, 2012, 5:04:07 AM4/4/12
to guava-...@googlegroups.com
Hello,

I am currently trying to build the latest source (just made git pull). At first maven complains that guava-gwt is not
available. I just removed this from the pom.xml as I don't need the gwt stuff right now.

I did some google search and read that one should do a "maven install" first before building anything.
I did: 
mvn clean install -DskipTests=true


and get this error:
[ERROR] /home/mjais/workspace/guava-libraries/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java:[135,10] error: name clash: apply(T#1) in Predicate and apply(F) in Function have the same erasure, yet neither overrides the other
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Guava Maven Parent ................................ SUCCESS [0.898s]
[INFO] Guava: Google Core Libraries for Java ............. SUCCESS [22.523s]
[INFO] Guava Testing Library ............................. SUCCESS [6.778s]
[INFO] Guava Unit Tests .................................. FAILURE [12.273s]
[INFO] ------------------------------------------------------------------------


Is this just a problem for the current trunk or am I doing anything wrong while building guava?

It would be good if there was a small "README.build" or something like that. If there is then I am blind and
couldn't find it and I am sorry for asking.

Regards,

Markus

Christian Edward Gruber

unread,
Apr 4, 2012, 8:51:39 AM4/4/12
to Markus Jais, guava-...@googlegroups.com
We can dig into this.  These are passing in our continuous integration.  What JVM and platform are you using?

Christian.


Markus Jais

unread,
Apr 4, 2012, 4:23:43 PM4/4/12
to guava-...@googlegroups.com
Hi Christian,

I use:
java version "1.7.0_03"

and build it with:
maven 3.0.4

Markus



Von: Christian Edward Gruber <cgr...@google.com>
An: Markus Jais <marku...@yahoo.de>
CC: "guava-...@googlegroups.com" <guava-...@googlegroups.com>
Gesendet: 14:51 Mittwoch, 4.April 2012
Betreff: Re: [guava] How to build Guava from latest source?

Christian Edward Gruber

unread,
Apr 4, 2012, 5:19:09 PM4/4/12
to Markus Jais, guava-...@googlegroups.com
Ah - we haven't validated any of this with 1.7 yet, and there are parts of Guava that may not even be relevant (stuff in com.google.common.io) in 1.7.  I expect chunks in reflect and io will have to go.

Since this is erasure conflicts, can you build it in 1.6, and use it in 1.7?  as in, can you use the 12.0-rc1 in your code running on 1.7?

Christian.

Kevin Bourrillion

unread,
Apr 4, 2012, 5:24:53 PM4/4/12
to Christian Edward Gruber, Markus Jais, guava-...@googlegroups.com
On Wed, Apr 4, 2012 at 2:19 PM, Christian Edward Gruber <cgr...@google.com> wrote:
Ah - we haven't validated any of this with 1.7 yet,

Not strictly true, Chris did some work to get all our tests passing when run on 1.7.  For example, we would accept "192.+168.0.1" as a valid IP address, because we were relying on Integer.parseInt() to catch some problems with the octets, and it changes to allow a leading plus sign in JDK 7 -- Chris fixed that.

 
and there are parts of Guava that may not even be relevant (stuff in com.google.common.io) in 1.7.  I expect chunks in reflect and io will have to go.

Slight correction:  we would like to know that Guava 12.0 functions 100% correctly in either environment, and that should be attainable (although, yes, there could be remaining issues with building it in the 1.7 environment that will get sorted out later).  In the future, when we get to the point of having some Guava-prime that actually requires 1.7, then a lot of stuff can go, for sure.


--
Kevin Bourrillion @ Google

Christian Edward Gruber

unread,
Apr 4, 2012, 5:30:43 PM4/4/12
to Kevin Bourrillion, Markus Jais, guava-...@googlegroups.com
Yeah - what Kevin said. :D

More accurately then, we're not (currently) actively testing in 1.7 so things liek an erasure issue in 1.7 can creep out.  I'm setting up continuous integration for the open-source'd Guava, which should help with some of this, as I'll run it on several VM versions.  We have internal continuous integration at Google, but our internal CI environments may not match yours, so it won't be enough.

Christian.

Markus Jais

unread,
Apr 5, 2012, 2:58:41 AM4/5/12
to Christian Edward Gruber, Kevin Bourrillion, guava-...@googlegroups.com
Hi,

I've used some parts of Guava 11 with JDK. Mostly some small stuff with ListenableFutures, etc. Worked without problems.
I can use it with 1.6. No problem.

I will also have a look at this error. I am quite new to the Guava src code but want to have a closer look (particularly at the concurrency stuff) anyway for
I talk I will give on futures (JDK, Guava, Akka). Maybe I can find something and help.

BTW: I love Guava. Really great stuff. Thanks for all the work!

Markus


Von: Christian Edward Gruber <cgr...@google.com>
An: Kevin Bourrillion <kev...@google.com>
CC: Markus Jais <marku...@yahoo.de>; "guava-...@googlegroups.com" <guava-...@googlegroups.com>
Gesendet: 23:30 Mittwoch, 4.April 2012

Betreff: Re: [guava] How to build Guava from latest source?

Markus Jais

unread,
Apr 5, 2012, 8:48:00 AM4/5/12
to guava-...@googlegroups.com
What I learned so far is that it runs without problems within Eclipse (3.7.1) when I start a Unit Test.
Weird but not the first time that Eclipse and maven have different opinions :-)
All with 1.7. (testet with both 1.7.0.2 and 1.7.0.3).

Markus


Von: Markus Jais <marku...@yahoo.de>
An: Christian Edward Gruber <cgr...@google.com>; Kevin Bourrillion <kev...@google.com>
CC: "guava-...@googlegroups.com" <guava-...@googlegroups.com>
Gesendet: 8:58 Donnerstag, 5.April 2012

Christian Edward Gruber

unread,
Apr 5, 2012, 4:11:38 PM4/5/12
to Markus Jais, guava-...@googlegroups.com
I definitely know that JDK vs. Eclipse's compiler have some subtle differences in interpretations of generics.  Or at least, I've seen code that Eclipse can compile not work on OpenJDK, with bugs filed, and no intentions to fix.   We can dig into this a bit more, but I suspect we won't until we get Guava 12 released.  Can't speak for the team - that's just my guess.

Christian.
Reply all
Reply to author
Forward
0 new messages