5

Trying to move from run-app(which works fine, no problems at all) to running on Tomcat. However when we run grails test war the Building War File... step fails.

Here is the console output, I'm not sure how to force it to tell me the problem with the build.

Loading Grails 2.2.0
| Configuring classpath.
| Environment set to test.....
| Packaging Grails application.....
| Compiling 1 source files.....
| Compiling 33 GSP files for package [infogriz]..
| Compiling 5 GSP files for package [debug].
| Compiling 4 GSP files for package [databaseMigration]..
| Building WAR file.....

And the popup window opens up with 'grails test war' has encountered a problem. Problem executing: test war. Real helpful.

The "Details" Button gives this as more detail.

Problem executing: test war --stacktrace --verbose
Command terminated with an error code (see details for output)
------System.out:-----------
Loading Grails 2.2.0
| Configuring classpath.
| Environment set to test.....
| Packaging Grails application.....
| Compiling 2 source files.....
| Compiling 33 GSP files for package [infogriz]..
| Compiling 5 GSP files for package [debug].
| Compiling 4 GSP files for package [databaseMigration]..
| Building WAR file.....
------System.err:-----------

Any ideas? I tried adding --stacktrace but it still doesn't tell me why it's failing.

Edit.

Running from the command line thanks to Ian's comment. The new error is:

`| Error Error executing script War: : c:\Users\me\git\infogriz\grails -app\migrations does not exist.

Guess I'll be building that file after lunch?

idonaldson
  • 465
  • 1
  • 14
  • 33
  • "the popup window opens up" suggests you're running this in an IDE, do you get any more useful output if you run it from the command line instead? – Ian Roberts Mar 26 '13 at 17:04
  • Yes I am running this in the GGTS. I will try and run from the command line. – idonaldson Mar 26 '13 at 17:20
  • Try `grails test war --stacktrace --verbose` for more info – Burt Beckwith Mar 26 '13 at 17:25
  • @BurtBeckwith See my updated question. Adding in verbose didn't help either. Looks like I need to install Grails outside of the IDE before I can build it from the command line >. – idonaldson Mar 26 '13 at 17:33
  • If you run `grails wrapper` once from within GGTS you can then use `grailsw` on the command line without a separate Grails installation and it will auto-download what it needs from the internet - `./grailsw test war --stacktrace --verbose` – Ian Roberts Mar 26 '13 at 17:40
  • @IanRoberts the `grails wrapper` ran fine. From the command line, now when i run `grails test war --stacktrace --verbose` it tells me it's missing 'server' JVM in the jre7 folder. – idonaldson Mar 26 '13 at 17:54
  • Nevermind, found the solution here http://stackoverflow.com/questions/5941796/no-server-jvm-at – idonaldson Mar 26 '13 at 18:02
  • possible duplicate of [Making WAR file in Grails](http://stackoverflow.com/questions/12166694/making-war-file-in-grails) – AA. Jul 22 '13 at 18:30

2 Answers2

6

I had that error once and I fixed it by creating the migrations folder at the expected location...

You probably updated to a newer version of Grails recently or you used a Grails version which was newer than the configured Grails version in the project properties.

rimero
  • 2,383
  • 1
  • 14
  • 8
0

Are you using version control for your project?

A similar error occurred for me when I had CVS configured to prune empty directories. I turned off this feature and the Grails build completed successfully.

GeoGriffin
  • 1,065
  • 11
  • 26