Ubuntu buildWar gradle error

Per the documentation, I added the following code to my build.gradle file for a project:

task buildWar(type: CubaWarBuilding) {
    coreContextXmlPath = 'modules/core/web/META-INF/context.xml'
    webXmlPath = 'modules/web/web/WEB-INF/web.xml'
    appProperties = ['cuba.automaticDatabaseUpdate':'true' ]
    includeContextXml = true
    includeJdbcDriver = true
    appHome = './schweitzer'
    singleWar = false

I then changed into my project directory and did this:
$ gradle buildWar
FAILURE: Build failed with an exception.
* What went wrong:
org.gradle.api.internal.MissingMethodException: Could not find method mustRunAfter() for arguments [[task ‘:schweitzer-core:deploy’, task ‘:schweitzer-web:deploy’]] on task ‘:start’.
> Could not find method mustRunAfter() for arguments [[task ‘:schweitzer-core:deploy’, task ‘:schweitzer-web:deploy’]] on task ‘:start’.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


Where did I go wrong?

As usual, I think I found my own error. :-/ Ubuntu 12.04 installs gradle 1.4. mustRunAfter() requires a later version. I installed from the gradle PPA: https://launchpad.net/~cwchien/+archive/ubuntu/gradle

Hope this helps somebody else.

Hi Eric,

you can also use the gradle wrapper of the CUBA project. This will eliminate all version problems with the project and gradle.

Just create the gradle wrapper binaries through studio (Build > Create / update gradle wrapper) and then instead of using “gradle” on the CLI, you have to use “./gradlew”.


Thank you. I will try that, since my production Tomcat deployment has errors and won’t start. :-/ I will start another post about them as this particular question is resolved.