I have a complex multi-project build that works fine with Gradle 2.2.1 but I get an error with Gradle 2.3-20150115093000+0000
-
Where: Build file ‘C:\dev\MyRootProject\MySubProject\build.gradle’ line: 41
-
What went wrong: A problem occurred evaluating project ‘:MySubProject’. > Cannot add task ‘:MySubProject:build’ as a task with that name already exists.
… Caused by: org.gradle.api.InvalidUserDataException: Cannot add task ‘:MySubProject:build’ as a task with that name already exists.
at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:60)
at org.gradle.api.internal.project.AbstractProject.task(AbstractProject.java:859)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:225)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:129)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
at build_7ehca2rcpl26u3efr983gkhy6.run(C:\dev\MyRootProject\MySubProject\build.gradle:41)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
… 32 more
The build script for the sub project starts like this:
buildscript { // this is to get the code for the 'release' plugin
project.ext.repoHost='dcm-artifactory-01.mydomain.local'
project.ext.repoURL = "http://${repoHost}/repo"
repositories { maven { url repoURL } }
dependencies { classpath 'com.github.townsfolk:gradle-release:1.2' }
}
apply plugin: 'maven'
apply from: '../versions.gradle'
// this just defines some properties
group = 'com.mydomain.myproject'
defaultTasks 'allRelease'
repositories {
maven { url repoURL }
}
// in here I just define a bunch of properties with project.ext.blah = 'blah'
// check a couple environment variables etc.
task build(dependsOn: 'allRelease')
// line 41 where it claims 'build' already exists
Does the ‘maven’ plugin now create a ‘build’ task?