I’ve encountered a problem with the ‘maven-publish’ plugin when generating a POM for a griffon plugin project that uses the ‘griffon’ configuration supplied by the gradle-griffon-plugin. The griffon configuration is used to parse BOM files and may result in multiple dependencies being added to several configurations. This mechanism is triggered before incoming dependencies are resolved, as witnessed in the code at https://github.com/griffon/griffon/blob/development/subprojects/gradle-griffon-plugin/src/main/groovy/org/codehaus/griffon/gradle/GriffonPluginResolutionStrategy.groovy
Everything works fine when the code is compiled. The problem arises when the POM is generated. Take for example the following build file taken from the griffon-hibernate4-plugin (https://github.com/griffon-plugins/griffon-hibernate4-plugin/blob/master/subprojects/griffon-hibernate4-core/griffon-hibernate4-core.gradle)
dependencies {
compile "org.hibernate:hibernate-core:$hibernateVersion",
"org.hibernate:hibernate-entitymanager:$hibernateVersion"
griffon 'org.codehaus.griffon.plugins:griffon-datasource-plugin:1.1.0'
}
This results produces the same result as if the dependencies were expressed as
dependencies {
compile "org.hibernate:hibernate-core:$hibernateVersion",
"org.hibernate:hibernate-entitymanager:$hibernateVersion"
compile 'org.codehaus.griffon.plugins:griffon-datasource-core:1.1.0'
}
But the generated POM only contains the hibernate dependencies (those with explicit compile configuration) and ignores everything else, as witnessed by http://dl.bintray.com/griffon/griffon-plugins/org/codehaus/griffon/plugins/griffon-hibernate4-core/1.1.0/#griffon-hibernate4-core-1.1.0.pom
I wonder if the maven-publish plugin somehow parses dependencies ahead of time, before the griffon configuration has a chance to do its work. Or is it the case that the griffon configuration is doing its work too late?
Any hints would be greatly appreciated.