diff --git a/README.md b/README.md
index 1b6c517..0a7f431 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ Include the plugin in your maven project, and use the pom.xml configuration dire
com.murphybob
spritepacker-maven-plugin
- 0.9
+ 0.10.0
${project.basedir}/src/images/sprites/
@@ -25,14 +25,14 @@ Include the plugin in your maven project, and use the pom.xml configuration dire
${project.build.directory}/images/assets-sprite.json
10
-
-
-
- compile
-
-
-
+
+
+
+ compile
+
+
+
Configuration
diff --git a/pom.xml b/pom.xml
index e223d5f..81752ad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,42 +1,68 @@
- 4.0.0
- com.murphybob
- spritepacker-maven-plugin
- 0.9.0
- maven-plugin
-
- src
-
-
- maven-compiler-plugin
- 2.3.2
-
- 1.6
- 1.6
-
-
-
-
-
-
- org.codehaus.jackson
- jackson-mapper-asl
- 1.9.11
-
-
- org.apache.maven
- maven-plugin-api
- 2.0
-
+ 4.0.0
+ com.murphybob
+ spritepacker-maven-plugin
+ 0.10.0
+ maven-plugin
+ spritepacker-maven-plugin Maven Mojo
+
+ 3.0.0
+
+
+ src
+
+
+ maven-compiler-plugin
+ 3.1
+
+ 1.6
+ 1.6
+
+
+
+ org.apache.maven.plugins
+ maven-plugin-plugin
+ 3.2
+
+
+ default-descriptor
+
+ descriptor
+
+ process-classes
+
+
+
+
+
+
+
+
+ org.apache.maven
+ maven-plugin-api
+ 3.0
+
+
+ org.apache.maven.plugin-tools
+ maven-plugin-annotations
+ 3.2
+ provided
+
+
+
+ org.codehaus.jackson
+ jackson-mapper-asl
+ 1.9.12
+
org.codehaus.plexus
plexus-utils
- 3.0
+ 3.0.17
org.sonatype.plexus
plexus-build-api
0.0.7
-
+
\ No newline at end of file
diff --git a/src/com/murphybob/spritepacker/Spritepacker.java b/src/com/murphybob/spritepacker/Spritepacker.java
index 94cb861..d08fec2 100644
--- a/src/com/murphybob/spritepacker/Spritepacker.java
+++ b/src/com/murphybob/spritepacker/Spritepacker.java
@@ -20,33 +20,33 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
/**
* Packs spritesheets from supplied images.
*
* @author Robert Murphy
- * @goal compile
- * @phase process-sources
*/
+@Mojo( name = "compile", defaultPhase = LifecyclePhase.PROCESS_SOURCES )
public class Spritepacker extends AbstractMojo {
private static long startTime = System.currentTimeMillis();
/**
* Output spritesheet image name
- *
- * @parameter expression="${spritepacker.output}"
- * @required
*/
- private static File output;
+ @Parameter( required = true )
+ private File output;
/**
* Output json(p) description file containing coords and dimensions.
- *
- * @parameter expression="${spritepacker.json}"
*/
- private static File json;
+ @Parameter
+ private File json;
/**
* Optional padding variable for jsonp files
@@ -54,41 +54,35 @@ public class Spritepacker extends AbstractMojo {
* { image: {...} }
* becomes
* jsonpVar = { image: {...} }
- *
- * @parameter expression="${spritepacker.jsonpVar}"
*/
- private static String jsonpVar;
+ @Parameter
+ private String jsonpVar;
/**
* The source directory containing the LESS sources.
- *
- * @parameter expression="${spritepacker.sourceDirectory}"
- * @required
*/
+ @Parameter( required = true )
private File sourceDirectory;
/**
* List of files to include. Specified as fileset patterns which are relative to the source directory. Default is all files.
- *
- * @parameter
*/
+ @Parameter
private String[] includes = new String[]{ "**/*" };
/**
* List of files to exclude. Specified as fileset patterns which are relative to the source directory.
- *
- * @parameter
*/
+ @Parameter
private String[] excludes = new String[] {};
/**
* Optional transparent padding added between images in spritesheet.
- *
- * @parameter expression="${spritepacker.padding}" default-value="0"
*/
- private static Integer padding;
+ @Parameter( defaultValue = "0" )
+ private Integer padding;
- /** @component */
+ @Component
private BuildContext buildContext;
/**
@@ -197,7 +191,7 @@ public int compare(ImageNode arg0, ImageNode arg1) {
int max1 = Math.max(arg1.image.getWidth(), arg1.image.getHeight());
return max1 - max0;
}
- });
+ });
}
private Node packImages( ArrayList images, Integer padding ){