From: Mathieu Baudier Date: Fri, 5 Dec 2008 22:40:31 +0000 (+0000) Subject: Introduce custom lifecycle for type eclipseFeature X-Git-Tag: svn/tags/maven-plugins-0.3.0@2542~50 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=76839c8e51108b372e776ecc82eae31ec5b90798;p=gpl%2Fargeo-slc.git Introduce custom lifecycle for type eclipseFeature git-svn-id: https://svn.argeo.org/slc/trunk/maven@1886 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/plugins/maven-argeo-pde-plugin/pom.xml b/plugins/maven-argeo-pde-plugin/pom.xml index 83117ef80..ccc005ffb 100644 --- a/plugins/maven-argeo-pde-plugin/pom.xml +++ b/plugins/maven-argeo-pde-plugin/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - org.argeo.slc.maven.plugins - + org.argeo.slc.maven maven-argeo-pde-plugin 0.3.1-SNAPSHOT maven-plugin @@ -18,6 +17,11 @@ maven-script-ant 2.0.9 + + org.apache.maven + maven-project + 2.0.7 + ant-contrib ant-contrib diff --git a/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/EclipseTargetForkMojo.java b/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/EclipseTargetForkMojo.java deleted file mode 100644 index 2edc8f6fa..000000000 --- a/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/EclipseTargetForkMojo.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.argeo.slc.maven.plugins.pde; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -/** - * Forks a eclipseTarget lifecycle. - * - * @goal eclipseTarget-fork - * @execute lifecycle="eclipseTarget" phase="initialize" - */ -public class EclipseTargetForkMojo extends AbstractMojo { - public void execute() throws MojoExecutionException { - getLog().info("doing nothing here"); - } -} diff --git a/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/EclipseTargetMojo.java b/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/EclipseTargetMojo.java new file mode 100644 index 000000000..eff431748 --- /dev/null +++ b/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/EclipseTargetMojo.java @@ -0,0 +1,16 @@ +package org.argeo.slc.maven.plugins.pde; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; + +/** + * Forks a eclipseTarget lifecycle. + * + * @goal eclipseTarget + * @execute lifecycle="eclipseTarget" phase="initialize" + */ +public class EclipseTargetMojo extends AbstractMojo { + public void execute() throws MojoExecutionException { + getLog().info("EclipseTargetMojo done"); + } +} diff --git a/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/PackageElementMojo.java b/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/PackageElementMojo.java new file mode 100644 index 000000000..0505c2af1 --- /dev/null +++ b/plugins/maven-argeo-pde-plugin/src/main/java/org/argeo/slc/maven/plugins/pde/PackageElementMojo.java @@ -0,0 +1,38 @@ +package org.argeo.slc.maven.plugins.pde; + +import java.io.File; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.project.MavenProject; + +/** + * Builds an element and adds it as main artifact. + * + * @goal packageElement + * @phase package + * @execute goal="buildElement" + */ +public class PackageElementMojo extends AbstractMojo { + /** + * The Maven project. + * + * @parameter expression="${project}" + * @required + * @readonly + */ + private MavenProject project; + + /** + * The directory for the generated JAR. + * + * @parameter expression="${project.build.directory}" + * @required + */ + private String buildDirectory; + + public void execute() throws MojoExecutionException { + File file = new File(buildDirectory, project.getArtifactId() + ".zip"); + project.getArtifact().setFile(file); + } +} diff --git a/plugins/maven-argeo-pde-plugin/src/main/resources/META-INF/maven/lifecycle.xml b/plugins/maven-argeo-pde-plugin/src/main/resources/META-INF/maven/lifecycle.xml index c3429e936..9cc13514a 100644 --- a/plugins/maven-argeo-pde-plugin/src/main/resources/META-INF/maven/lifecycle.xml +++ b/plugins/maven-argeo-pde-plugin/src/main/resources/META-INF/maven/lifecycle.xml @@ -17,7 +17,7 @@ - eclipseTarget + eclipseTarget-collect diff --git a/plugins/maven-argeo-pde-plugin/src/main/resources/META-INF/plexus/components.xml b/plugins/maven-argeo-pde-plugin/src/main/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..7055dbab5 --- /dev/null +++ b/plugins/maven-argeo-pde-plugin/src/main/resources/META-INF/plexus/components.xml @@ -0,0 +1,48 @@ + + + + org.apache.maven.lifecycle.mapping.LifecycleMapping + + eclipseFeature + + org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping + + + + + default + + + org.argeo.slc.maven:maven-argeo-pde-plugin:eclipseTarget + + + org.argeo.slc.maven:maven-argeo-pde-plugin:packageElement + + + org.apache.maven.plugins:maven-install-plugin:install + + + org.apache.maven.plugins:maven-deploy-plugin:deploy + + + + + + + + org.apache.maven.artifact.handler.ArtifactHandler + + eclipseFeature + + org.apache.maven.artifact.handler.DefaultArtifactHandler + + + eclipseFeature + false + java + zip + false + + + + diff --git a/plugins/maven-argeo-pde-plugin/src/main/scripts/argeo-pde.build.xml b/plugins/maven-argeo-pde-plugin/src/main/scripts/argeo-pde.build.xml index c2fe0b17e..4029f6360 100644 --- a/plugins/maven-argeo-pde-plugin/src/main/scripts/argeo-pde.build.xml +++ b/plugins/maven-argeo-pde-plugin/src/main/scripts/argeo-pde.build.xml @@ -87,7 +87,7 @@ - + - - - - - - - - - - - - - - - - - - + - @@ -223,12 +196,6 @@ COMMON UTILITIES --> - @@ -240,13 +207,6 @@ - @@ -259,8 +219,6 @@ - -