I’m trying to externalize the configuration and dependencies of a set of plugins we use on our project. I’ve created a boilerplate gradle file setting up a buildscript block with repository definition and plugin versions.
buildscript {
repositories {
mavenRepo url: "http://nexus.stibo.dk/content/groups/public/"
}
dependencies {
classpath(group: 'com.stibo', name: 'com.stibo.gradle.plugin.stibodefaults', version: '1.3.0')
// and more plugins..
}
}
apply plugin: com.stibo.gradle.plugin.stibodefaults.StiboDefaults
// and more applications...
In each of our modules, I want to apply these common settings by applying the boilerplate gradle file:
apply from:'http://buildstrap.stibo.dk/boilerplate/boilerplate-1.0.0.gradle'
I get an error: No such property: com for class: org.gradle.api.internal.initialization.DefaultScriptHandler
I’ve been searching this forum for hints, and I’ve found a couple of relevant postings:
- http://forums.gradle.org/gradle/topics/how_do_i_include_buildscript_block_from_external_gradle_script - http://forums.gradle.org/gradle/topics/how_do_i_apply_a_plugin_to_a_project_from_a_shared_applied_gradle_file - http://forums.gradle.org/gradle/topics/how_can_you_use_an_init_script_to_specify_a_repo_dependency_for_a_plugin_jar_but_allow_version_to - http://forums.gradle.org/gradle/topics/how_to_configure_buildscript_and_plugin_through_apply_from
The common line here is that it can’t be (easily) done.
The newest post on the issue is much more positive, as it suggests that it does indeed work.
Do you have an up to date answer, reflecting the possibilities with the newest version of gradle?
Regards /Jesper