Application/Distribution plugin discrepancy

Using 2.5, if I shift from distribution plugin to application plugin, my distribution syntax is rejected. The documentation simply says that application “automatically applies” the distribution plugin, not that it applies a different, undocumented one.

def compositeJarSubprojects = [':P1', ':P2', ':P3'] task compositeJar(type: Jar , dependsOn: compositeJarSubprojects.collect{ it + ":compileJava"}) { baseName = 'composite' from files(compositeJarSubprojects.collect{ project(it).sourceSets.main.output }) }

artifacts {

distributions {
main {
baseName = 'cmpst’
contents {
// compositeJar names a jar task and and the artifact produced by the task; it brings in the single jar produced from the classes from a list of subprojects
// this brings in all jars except the jars produced by the subprojects included in the compositeJar
from compositeJarSubprojects.collect{ project(it).configurations.runtime {
exclude serverJarSubprojects.collect{project(it).jar.archiveName }
exclude 'a*.jar’
exclude ‘b*.jar’
} }
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

Exception comes from application plugin only: distribution plugin accepts the syntax. Thus it appears that application plugin applies a private, different distribution plugin. The exception occurs with a variety of combinations of lines in the distribution block commented out.

Caused by: org.gradle.api.internal.MissingMethodException: Could not find method distributions() for arguments [build_6mog33379cd2v0ks0zepygbgf$_run_closure4@73e1ec2e] on project ‘:standalone’.
at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(
at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(
at org.gradle.groovy.scripts.BasicScript.methodMissing(
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$