package com.atlassian.maven.plugins.amps;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.jfrog.maven.annomojo.annotations.MojoGoal;
import org.jfrog.maven.annomojo.annotations.MojoParameter;

/**
 * Compresses JavaScript resources with the YUI compressor Maven plugin.  Creates compressed versions of all
 * JavaScript resources by attaching the '-min' suffix.
 *
 * @since 3.2
 */
@MojoGoal("compress-resources")
public class CompressResourcesMojo extends AbstractAmpsMojo
{
    /**
     * Whether to compress the resources or not.  Defaults to true.
     */
    @MojoParameter(defaultValue = "true")
    private boolean compressResources;

    public void execute() throws MojoExecutionException, MojoFailureException
    {
        if (compressResources)
        {
            getMavenGoals().compressResources();
        }
        else
        {
            getLog().debug("Compressing resources disabled");
        }
    }
}

package com.atlassian.maven.plugins.amps;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.jfrog.maven.annomojo.annotations.MojoGoal;

@MojoGoal("compress-resources")
public class CompressResourcesMojo extends AbstractAmpsMojo
{
    public void execute() throws MojoExecutionException, MojoFailureException
    {
        getMavenGoals().compressResources();
    }
}

--- 
+++ 
@@ -3,12 +3,32 @@
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.jfrog.maven.annomojo.annotations.MojoGoal;
+import org.jfrog.maven.annomojo.annotations.MojoParameter;
 
+/**
+ * Compresses JavaScript resources with the YUI compressor Maven plugin.  Creates compressed versions of all
+ * JavaScript resources by attaching the '-min' suffix.
+ *
+ * @since 3.2
+ */
 @MojoGoal("compress-resources")
 public class CompressResourcesMojo extends AbstractAmpsMojo
 {
+    /**
+     * Whether to compress the resources or not.  Defaults to true.
+     */
+    @MojoParameter(defaultValue = "true")
+    private boolean compressResources;
+
     public void execute() throws MojoExecutionException, MojoFailureException
     {
-        getMavenGoals().compressResources();
+        if (compressResources)
+        {
+            getMavenGoals().compressResources();
+        }
+        else
+        {
+            getLog().debug("Compressing resources disabled");
+        }
     }
 }
AMPS-373: Allow resource compression to be disabled

git-svn-id: 883a21d237c46b75e72c0e9117e1cd5e6516cdf8@112480 2c54a935-e501-0410-bc05-97a93f6bca70
