Updated Branches: refs/heads/master 64cb4003b -> 7028fc8de
updated refpack mojo Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/7028fc8d Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/7028fc8d Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/7028fc8d Branch: refs/heads/master Commit: 7028fc8de0a0c1b0c5617ba43dbd4fb27c7790d6 Parents: 64cb400 Author: Sebastian Schaffert <[email protected]> Authored: Wed Apr 10 15:18:04 2013 +0200 Committer: Sebastian Schaffert <[email protected]> Committed: Wed Apr 10 15:18:04 2013 +0200 ---------------------------------------------------------------------- build/plugins/refpack-maven-plugin/pom.xml | 15 ++++++ .../maven/plugins/refpack/RefPackMojo.java | 34 +++++--------- 2 files changed, 27 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/7028fc8d/build/plugins/refpack-maven-plugin/pom.xml ---------------------------------------------------------------------- diff --git a/build/plugins/refpack-maven-plugin/pom.xml b/build/plugins/refpack-maven-plugin/pom.xml index 3a89d0e..85117c7 100644 --- a/build/plugins/refpack-maven-plugin/pom.xml +++ b/build/plugins/refpack-maven-plugin/pom.xml @@ -62,6 +62,21 @@ <artifactId>jcabi-aether</artifactId> <version>0.7.8</version> </dependency> + <!-- dependencies to annotations --> + <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + <version>3.2</version> + <!-- annotations are not needed for plugin execution so you can remove this dependency + for execution with using provided scope --> + <scope>provided</scope> + </dependency> + <!-- generated help mojo has a dependency to plexus-utils --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>3.0.10</version> + </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/7028fc8d/build/plugins/refpack-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/refpack/RefPackMojo.java ---------------------------------------------------------------------- diff --git a/build/plugins/refpack-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/refpack/RefPackMojo.java b/build/plugins/refpack-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/refpack/RefPackMojo.java index b898ec6..b0c3c48 100644 --- a/build/plugins/refpack-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/refpack/RefPackMojo.java +++ b/build/plugins/refpack-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/refpack/RefPackMojo.java @@ -31,7 +31,11 @@ import org.apache.maven.model.Model; import org.apache.maven.model.building.ModelBuildingRequest; 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; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; @@ -54,13 +58,9 @@ import org.sonatype.aether.resolution.DependencyResult; import org.sonatype.aether.util.artifact.DefaultArtifact; /** - * Goal which touches a timestamp file. - * - * @requiresDependencyResolution compile - * @goal generate - * - * @phase validate + * Generate IzPack refpack descriptions from Maven dependencies */ +@Mojo(name = "generate", defaultPhase = LifecyclePhase.VALIDATE, requiresDependencyResolution = ResolutionScope.COMPILE) public class RefPackMojo extends AbstractMojo { /** @@ -83,33 +83,23 @@ public class RefPackMojo extends AbstractMojo { /** * The entry point to Aether, i.e. the component doing all the work. * - * @component */ + @Component private RepositorySystem repoSystem; - /** - * @parameter default-value="${repositorySystemSession}" - * @readonly - */ + @Parameter(defaultValue = "${repositorySystemSession}", readonly = true) private RepositorySystemSession session; /** * The project's remote repositories to use for the resolution of project dependencies. - * - * @parameter default-value="${project.remoteProjectRepositories}" - * @readonly */ + @Parameter(defaultValue = "${project.remoteProjectRepositories}", readonly = true) private List<RemoteRepository> projectRepos; - /** - * @component - */ + @Component private ProjectBuilder projectBuilder; - - /** - * @component - */ + @Component private ArtifactFactory artifactFactory; /** @@ -131,7 +121,7 @@ public class RefPackMojo extends AbstractMojo { getLog().info("generating reference packs for group id "+moduleGroupId); - for(org.apache.maven.artifact.Artifact artifact : (Set<org.apache.maven.artifact.Artifact>)project.getArtifacts()) { + for(org.apache.maven.artifact.Artifact artifact : project.getArtifacts()) { if(artifact.getGroupId().equals(moduleGroupId)) { DefaultArtifact aetherArtifact = new DefaultArtifact(artifact.getGroupId(),artifact.getArtifactId(), artifact.getType(), artifact.getVersion());
