2

how do I specify build goals like development, test or production environment in the maven grails plugin when packaging a war file for deployment?

Thanks

Gambo
  • 1,572
  • 3
  • 26
  • 52

2 Answers2

2

Set grails.env when running maven:

mvn package -Dgrails.env=development

If you omit this option, the environment defaults to production.

Antoine
  • 5,158
  • 1
  • 24
  • 37
  • Thank you, is this documented somewhere? – Gambo Nov 22 '11 at 10:53
  • You can use this variable for any grails command. See Packaging and Running for Different Environments at http://grails.org/doc/latest/guide/3.%20Configuration.html#3.2 Environments – Antoine Nov 22 '11 at 11:47
1

You can also set it in the <configuration> section

    <plugin>
        <groupId>org.grails</groupId>
        <artifactId>grails-maven-plugin</artifactId>
        <version>1.3.7</version>
        <executions>
            <execution>
                <goals>
                    <goal>maven-war</goal>
                </goals>
                <configuration>
                    <env>prod</env>
                </configuration>
            </execution>
         </executions>
    </plugin>
leebutts
  • 4,882
  • 1
  • 23
  • 25