The problem was rather in the setup of the repository :-(
classpathResolvers.add(new FileSystemResolver()) {
...
artifactPatterns = [
"${ivyRepBase}/FILES/[organisation]/[module]/[artifact]-[revision].[type]" ]
}
will crash during resolving before the compilation, as artifactPatterns is a
set to a list of GStrings instead of Strings like here:
artifactPatterns = [ ivyRepBase +
'/FILES/[organisation]/[module]/[artifact]-[revision].[type]' ]
(Any other configuration than "compile" will not throw an error, as the
dependency is irrelevant for compilation!).
However, finding the error was made more difficult as necessary, as the
compile task will just throw a NullPointerException, if any resolving
failed, either because of a incorrectly set up repository or misspelling,
e.g.
compile "org.apache:commons-loggnig:1.1"
Please, change this to display the dependency, which could not be resolved.
Will gradle be enhanced to allow a simple definition of configuration
dependencies?
My code currently is as follows:
DefaultDependencyDescriptor dd(String conf, String descr, List depConf =
[ "default" ], boolean changing = false) {
String[] parts = descr.split(":");
DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
new ModuleRevisionId(new ModuleId(parts[0], parts[1]),
parts[2]), false, changing)
depConf.each { dd.addDependencyConfiguration(conf, it) }
return dd
}
dependencies {
...
dependencyDescriptors.add dd("compile", "org.apache.cxf:cxf:2.0.6",
[ "default", "jaxws", "spring", "http" ])
compile "org.apache:commons-httpclient:3.+"
...
Or should the default dependent configuration rather be "compile" instead of
"default"?
--
View this message in context:
http://www.nabble.com/Dependency-to-a-module-configuration--tp19990983p20086162.html
Sent from the gradle-user mailing list archive at Nabble.com.