Search code examples
grailsbuildwar

is it normal to build war in 40 minutes?


My grails project needs about 40 minutes for building WAR. The created WAR file size is about 70 MB. Is it normal? Can I tune / speed up the build WAR process? I use default setting for grails and java

My machine info:
- CPU: Intel(R) Xeon(R) CPU X3430  @ 2.40GHz
- RAM: 8GB
- OS: Ubuntu 18.04.1 LTS
- java: openjdk version "1.8.0_191"
- Grails version: 2.4.3

Solution

  • By a quick look I would say that there is something wrong in your build. So the answer is: No it's not normal.

    If you have a grails project that runs on the machine that you described I would say that it can't be that large that it would require that much time for just compiling the code. War sized at 70MB should build just in couple minutes, however things are not always that simple.

    Most likely there is something in your build chain that causes this. Maybe your build is doing several other things besides compiling code? Something that is required for the build, contacting external services or computes some kind of complex static values that takes a lot of time etc.

    To get in the bottom of this, you need to follow the build and see which step takes the most time and dive into them and see if you can do any optimization there.

    You can find out how much the actual code compilation takes by running grails clean-all and grails compile.

    If this becomes unfixable, consider using dedicated build server to build war so it does not stop your workflow.