I want to uglify my javascript code before deployment on aws. I do not want to uglify the code during development. Do I need two separate pom files or is there a smart way to tell maven about that? I am using the uglifyjs plugin for maven.
Ren
Credit to @Michael for answering this, I will still answer formally in order to close this thread.
Here is what my maven profiles look like, note the activation block at the top, this is here to specify how to use this profile over the default profile, in this case I need to give the extra argument:
$ mvn -Ddeployment
<profiles>
<profile>
<activation>
<property>
<name>deployment</name>
</property>
</activation>
<pluginRepositories>
<pluginRepository>
<id>uglifyjs-maven-plugin</id>
<url>https://raw.github.com/tqh/uglifyjs-maven-plugin/master/repo</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>net.tqh.plugins</groupId>
<artifactId>uglifyjs-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<sourceDirectory>target/snapshot/javascript</sourceDirectory>
<outputDirectory>target/snapshot/javascript</outputDirectory>
</configuration>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>uglify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
... other plugins here ...
</plugin>
</plugins>
</build>
</profile>
</profiles>