I am getting the following error for the following war block in the build.gradle file:
war {
from file("${buildDir}/pad.checkpoint")
archiveBaseName = 'x'
archiveFileName 'x.war'
manifest {
attributes("Implementation-Title": "X",
"Implementation-Version": "${checkpoint_version}") //CHANGED: using checkpoint version, 4/29/2019
}
}
* What went wrong:
A problem occurred evaluating project ':x'.
> No signature of method: build_bwabkxkz50kzi9n1i5g4tpde.war() is applicable for argument types: (build_bwabkxkz50kzi9n1i5g4tpde$_run_closure7) values: [build_bwabkxkz50kzi9n1i5g4tpde$_run_closure7@459c6649]
Possible solutions: wait(), wait(long), tap(groovy.lang.Closure), run(), run(), any()
It was working before with the deprecated variables baseName and archiveName. I think it is happening because the war closure hasn't been set for receiving the new upgraded variables.
Spring boot version being used: springBootVers = '2.2.6.RELEASE'
Yeah, errors when using the Groovy DSL can sometimes be swallowed in these generic MissingMethodException" problems. It means that something inside the closure couldn't be resolved. I find that the easiest way to figure out what is wrong is to comment out code until the closure can be resolved.
In your case, it is the line archiveFileName 'x.war'. In groovy, parenthesis are (sometimes) optional, so this is equivalent to archiveFileName('x.war').
However, as you can see from the War API documentation, archiveBaseName is a property and not a method. So to fix it, change it to an assignment instead: archiveFileName = 'x.war'.
You will most likely not need both archiveBaseName and archiveFileName at the same time though.
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