Closed angryziber closed 3 years ago
It's interesting that this does not work. The code is actually trying to ask Gradle for the location of webAppDirName
, but WarPluginConvention
insists that the path is the default src/main/webapp
.
Thank you for providing the workaround.
Right, so this is an artifact of this plugin being originally written to do too much. The plugin is doing best effort to detect if there is an appengine-web.xml
, however this detection happens before projects are configured. See configuration phases: https://docs.gradle.org/current/userguide/build_lifecycle.html#sec:build_phases
We can't see the custom webAppDirName
because it is not set when we are trying to read the value (before project's are configured, and user configuration is loaded).
We can't use the project.afterEvaluate{}
block to make sure the variable is set, because it would be too late (after project configuration) to apply either the correct plugin (appenginewebxml or appyaml).
Thanks, @loosebazooka ! I'll document this limitation.
It seems it looks for
src/main/webapp
, howeverwar
plugins supports overriding the location with:It confuses the plugin and
appengine-web.xml
is not detected. By default, the yml version is selected, which doesn't have theappengineRun
taks that is referenced in the documentation.Workaround: specify the xml plugin explicitly: apply plugin: 'com.google.cloud.tools.appengine-appenginewebxml'