# Application/Distribution plugin discrepancy

**URL:** <https://discuss.gradle.org/t/application-distribution-plugin-discrepancy/10993>\
**Category:** Bugs\
**Created:** [August 4, 2015, 3:54pm UTC](https://discuss.gradle.org/t/application-distribution-plugin-discrepancy/10993 "2015-08-04T15:54:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Don](https://discuss.gradle.org/u/Don)\
**Post date:** [August 4, 2015, 3:54pm UTC](https://discuss.gradle.org/t/application-distribution-plugin-discrepancy/10993/1 "2015-08-04T15:54:24Z")

</div>

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 {
compositeJar
}
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
from(compositeJar)
// 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(AbstractDynamicObject.java:68)  
at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:56)  
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:172)  
at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)  
at build\_6mog33379cd2v0ks0zepygbgf.run(C:…mypath…\standalone\build.gradle:27)  
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
