3

I have just read about Guava and checked out its source code but don't know how to build it to use. I built jar file using "mvn package" but it generates errors of Guava GWT.

[ERROR] Failed to execute goal on project guava-gwt: Could not resolve dependenc
ies for project com.google.guava:guava-gwt:jar:latest: Failure to find com.googl
e.guava:guava:jar:sources:latest in http://repo1.maven.org/maven2 was cached in
the local repository, resolution will not be reattempted until the update interv
al of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

enter image description here

emeraldhieu
  • 9,380
  • 19
  • 81
  • 139

1 Answers1

5

You might need to run "mvn install" first, as Charles Fry explained here:

http://groups.google.com/group/guava-discuss/browse_thread/thread/aac1ec01dc09f363

We have a funny setup where you have to build stuff using 'mvn install' before the other obvious stuff works.


You could also depend on the most recent release using a Maven dependency, if you don't care about TRUNK:

is guava-libraries available in maven repo?

Community
  • 1
  • 1
Etienne Neveu
  • 12,604
  • 9
  • 36
  • 59
  • now I get this error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2. 7.2:test (default-test) on project guava-tests: There are test failures. [ERROR] [ERROR] Please refer to D:\Guava\guava-tests\target\surefire-reports for the ind ividual test results. – emeraldhieu Oct 11 '11 at 13:27
  • What's the content of target/surefire-reports? This might give us a clue as to the problem. The Guava test suite was open sourced recently, and tests sometimes fail when building from TRUNK (in this case we'll open an issue on the Guava tracker). You could do "mvn clean install -Dmaven.test.skip" to ignore tests for now. That said, are you sure you want to depend on TRUNK instead of the latest release jar? – Etienne Neveu Oct 11 '11 at 14:40
  • Ok, I'll download and use release jar instead of using trunk. Guava-r09 deprecated but I think it's ok to use. – emeraldhieu Oct 11 '11 at 16:06
  • Yeah, guava r09 is good and stable. r10 has some nice new features, but you don't *have* to use it if you don't need them. – Etienne Neveu Oct 11 '11 at 22:01