groovy - Gradle createPom doesn't seem to read gradle.properties -
please note: although mention shadowjar plugin in question, providing full context. confident gradle guru can answer this, regardless of knowledge level of shadowjar.
currently groovy project built following gradle build invocation:
gradle clean build shadowjar
running invocation produces packaged fat jar under build/libs
version
property specified in gradle.properties
file. instance, if gradle.properties
has version=1.2.3
, above invocation produces build/libs/myapp-1.2.3.jar
.
what doesn't produce, however, valid pom app. , found this answer , modified bit produce:
task createpom << { pom { project { groupid ${group} artifactid 'myapp' version ${version} } }.writeto("build/libs/pom.xml") }
my thinking group
, version
(both specified in gradle.properties
) "injected", , should produce pom.xml
in same directory fat jar.
after adding createpom
task, run:
gradle clean build shadowjar createpom
and error:
failure: build failed exception. * where: build file 'd:\workspace\blah\myapp\build.gradle' line: 89 * went wrong: execution failed task ':createpom'. > no signature of method: java.lang.object.$() applicable argument types: (java.util.collections$emptymap, null) values: [[:], null] possible solutions: any(), is(java.lang.object), wait(), find(), dump(), grep() * try: run --stacktrace option stack trace. run --info or --debug option more log output. build failed total time: 11.673 secs
what going on here?
the lines:
groupid ${group} artifactid 'myapp' version ${version}
are not valid groovy, , should be:
groupid "${group}" artifactid 'myapp' version "${version}"
Comments
Post a Comment