In my root build.gradle file I apply common tasks for all components:
apply from: rootProject.file('common/component.gradle')
In subproject i define componentTitle:
ext {
componentTitle = 'application1'
}
component.gradle:
jar {
manifest {
attributes 'Implementation-Title': componentTitle
}
}
I am getting error:
A problem occurred evaluating script.
> No such property: componentTitle for class: org.gradle.api.java.archives.internal.DefaultManifest
It seems, that you've applied this common configuration not only to subprojects, but to the root project too, though it doesn't have such a property. To apply it to subprojects only, configuration could be made like so:
subprojects {
apply from: rootProject.file('/component.gradle')
}
But even now Gradle won't find the componentTitle
property if you pass it the way you did (as a part of subproject script body). You need to make a gradle.properties
file in all subprojects directories and move this property into this properties file, as usual:
componentTitle=application1
Then Gradle will be able to locate it during the configuration phase
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With