diff --git a/README.md b/README.md index 174a2f7eb7a..2f3a95d585d 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ The framework also serves as the foundation for [Python](https://github.com/SpringSource/spring-python) variants are available as well. ## Downloading artifacts -Instructions on -[downloading Spring artifacts](https://github.com/SpringSource/spring-framework/wiki/Downloading-Spring-artifacts) -via Maven and other build systems are available via the project wiki. +See [downloading Spring artifacts](https://github.com/SpringSource/spring-framework/wiki/Downloading-Spring-artifacts) +for Maven repository information. Unable to use Maven or other transitive dependency management tools? +See [building a distribution with dependencies](https://github.com/SpringSource/spring-framework/wiki/Building-a-distribution-with-dependencies). ## Documentation See the current [Javadoc](http://static.springsource.org/spring-framework/docs/current/api) diff --git a/build.gradle b/build.gradle index 5ae49217aac..c2b1bcbcdbc 100644 --- a/build.gradle +++ b/build.gradle @@ -640,7 +640,7 @@ configure(rootProject) { description = "Builds -${classifier} archive, containing all jars and docs, " + "suitable for community download page." - def baseDir = "${project.name}-${project.version}"; + ext.baseDir = "${project.name}-${project.version}"; from('src/dist') { include 'readme.txt' @@ -671,6 +671,36 @@ configure(rootProject) { } } + // Create an distribution that contains all dependencies (required and optional). + // Not published by default; only for use when building from source. + task depsZip(type: Zip, dependsOn: distZip) { zipTask -> + group = 'Distribution' + classifier = 'dist-with-deps' + description = "Builds -${classifier} archive, containing everything " + + "in the -${distZip.classifier} archive plus all runtime dependencies." + + from zipTree(distZip.archivePath) + + gradle.taskGraph.whenReady { taskGraph -> + if (taskGraph.hasTask(":${zipTask.name}")) { + def projectNames = rootProject.subprojects*.name + def artifacts = new HashSet() + subprojects.each { subproject -> + subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact -> + def dependency = artifact.moduleVersion.id + if (!projectNames.contains(dependency.name)) { + artifacts << artifact.file + } + } + } + + zipTask.from(artifacts) { + into "${distZip.baseDir}/deps" + } + } + } + } + artifacts { archives docsZip archives schemaZip