I get the source and jar but not the javadoc jar. Is there a way to get Gradle to pull the javadoc jar, commons-math3-3.0-javadoc in this case?
I am using Gradle in Eclipse and it would be nice to be able to go look at the javadoc for a dependency without having to separately go download or view online (as I’m often offline).
After adding math3 dependency and refreshing I noted in console that Gradle download source and jar but did not see javadoc jar.
When I select @Javadoc view in STS Eclipse I see basic blurb of class but when I select “Open attached JavaDoc in browswer” I get
The documentation location for 'MersenneTwister' has not been configured. For elements from libraries specify the Javadoc location URL on the properties page of the parent JAR.
('C:\Users\pjc\.gradle\caches\artifacts-13\filestore\org.apache.commons\commons-math3.0\jar\......\commons.math3-3.0.jar')
Works fine for me. Did you select “Gradle Project” when importing the project into the IDE? Also make sure you use latest version of STS and Gradle (also in Eclipse).
Peter, many thanks for your help. I was using an old version of STS-GG (3.0 milestone) but after downloading latest and attempting the the following experiment I still have the same problem - no javadoc jar is being downloaded with the jar and source jar.
Here are the details.
I downloaded and installed latest version of STS-GG 3.0 Rel
Groovy/Grails Tool Suite
Version: 3.0.0.RELEASE
Build Id: 201208091018
I checked Gradle version as 1.1, the latest
------------------------------------------------------------
Gradle 1.1
------------------------------------------------------------
Gradle build time: Tuesday, July 31, 2012 1:24:32 PM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_05 (Oracle Corporation 23.1-b03)
OS: Windows 7 6.1 amd64
I deleted the .gradle folder to remove all old cache data from local machine.
I created a new Gradle project from the New menu in STS-GG 3.0 Rel, picked Quick Start Java project. I added a math3 dependency to the default collections dependency for good measure. Here is the gradle.build file for the new project:
I ran update dependencies from Gradle menu in STS-GG. Here is the console output from the dependency update for the above gradle.build with no local cache at all (deleted .gradle directory):
Yes, quite right. The Gradle Distribution is set to “Use Gradle wrapper’s default”. I am not sure where to check that but in the .gradle/wrapper/dists folder there is gradle-1.0-bin folder so presumably STS-GG is using 1.0 not 1.1. This gradle-1.0-bin must have been installed by eclipse STS-GG-3.0Rel because I deleted .gradle directory as part of the clean up above to test this issue.
If your project is wrapper-enabled, then STS will also use the wrapper, and you won’t have to change anything. Sometimes I’ve see STS jump back to a fixed Gradle version though, in which case I had to set it back to use the wrapper.
I see this now after I run a wrapper task and it creates the gradle dir in project directory with gradle/wrapper/gradle-wrapper.properties file. The STS Gradle extension now appears to refer to the gradle-wrapper.properties file and runs gradle 1.1. Is it preferred practice even in STS to run wrapper task to create wrapper gradle directory and properties file? Even if preferred it seems STS Gradle extension should use latest available version or Gradle or at least provide a way to change it without requiring separate wrapper task step?
In any case, many thanks for all your time and help.
As I said, you can manually set a Gradle distribution in Preferences->Gradle. In that case you have to download Gradle yourself though. And if your projects use different Gradle versions, you’ll have to manually switch forth and back in Eclipse.