kordamp / kordamp-gradle-plugins

A collection of Gradle plugins
https://kordamp.org/kordamp-gradle-plugins/
Apache License 2.0
138 stars 25 forks source link

org.kordamp.gradle.bom not working #477

Closed xhaimxd closed 3 years ago

xhaimxd commented 3 years ago

I just wanna use this plugin to do dependency management but, I tried to config it like docs like:

config{
  bom{
    dependency('aaa:bbb:ccc')
  }
}

it doesn't work. published pom file only has this project's module. some other dependency like commons-io:commons-io:1.3.2 was missed. And I found the parameter in method 'dependency' in BomPlugin is type of Dependency, so i tried that:

config{
  bom{
    dependency(dependency('aaa:bbb:ccc'))
  }
}

second dependency was used cuz i need a Dependency Object. but when I tried to publish, error shown that:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':xxxxx:generatePomFileForMainPublication'.
    at 
Caused by: org.gradle.api.UncheckedIOException: Could not write to file '******\pom-default.xml'.
    at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:152)
    at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:127)
    at org.gradle.internal.IoActions.writeTextFile(IoActions.java:45)
Caused by: org.gradle.api.InvalidUserCodeException: Could not apply withXml() to generated POM
    at org.gradle.api.internal.UserCodeAction.execute(UserCodeAction.java:41)
    at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:225)
    at org.gradle.internal.MutableActionSet.execute(MutableActionSet.java:38)
Caused by: groovy.lang.MissingPropertyException: No such property: platform for class: org.kordamp.gradle.plugin.base.model.artifact.internal.DependencyImpl
    at org.kordamp.gradle.plugin.bom.BomPlugin$_updatePublications_closure3$_closure4$_closure6$_closure7$_closure9.doCall(BomPlugin.groovy:180)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

and i found the source code line 181 : if (d.platform) the interface 'Dependecy' really do not have this property