Make Gradle include all sources from entire dependency tree

Gradle is an excellent dependency manager. However, there does not seem to be an obvious way with the Java plugin to pull the source artifacts from an entire dependency tree.

Building with GWT requires .java source files, not .class bytecode files.

When declaring dependencies among my own Gradle projects, I can define a custom Gradle configuration and extend the Jar task type to produce a custom source artifact. From the parent project, I can then easily rely on the subproject's sources in a loosely-coupled way.

But what if my subproject then relies on some non-source dependencies from mavenCentral()? How do I get the parent project to pull the sources from those transitive dependencies (the whole tree), assuming they are available?


There isn't an easy way to resolve a configuration's source Jars at the moment. (You'd essentially have to reimplement what the eclipse and idea plugins do). The next Gradle version (1.12) will provide a new artifact resolution API, which will make this a lot easier.

Need Your Help

RavenDb on Azure Websites - Access Denied azure ravendb azure-web-sites

I'm playing around with the new Websites feature on Azure and trying to get an MVC site running with RavenDB in embedded mode. Everything works fine locally but running the deployed site in azure I...

Problems connecting to weblogic 10.3.6 JMS Queue with authentication from MDB in JBoss 5.1.0 GA

jms weblogic ejb-3.0 jboss5.x jboss-mdb

I'm using sun-jms-adapter.rar. All my configuration works fine before starting to use authentication. I also tried accessing to queue from a standalone application and stateless bean (this is used to