From 046dc5d63cb4d665a7266b4c3d29b03cc296eebc Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Mon, 20 Jun 2005 22:35:26 +0000 Subject: [PATCH] make mojos backwards compat with alpha-2, and run with the eclipse test unmodified git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@191579 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/plugin/eclipse/EclipsePlugin.java | 11 +++++++---- .../java/org/apache/maven/plugin/idea/IdeaMojo.java | 10 +++++++--- maven-plugins/pom.xml | 3 +-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java b/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java index 066a346311..7a5b97e9a9 100644 --- a/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java +++ b/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java @@ -28,7 +28,7 @@ import java.io.File; * * @goal eclipse * @requiresDependencyResolution test - * @execute phase="generate-sources" + * @executePhase="generate-sources" * * @author Trygve Laugstøl * @version $Id$ @@ -47,10 +47,7 @@ public class EclipsePlugin private MavenProject project; /** - * The project whose project files to create. - * * @parameter expression="${executedProject}" - * @required */ private MavenProject executedProject; @@ -94,6 +91,12 @@ public class EclipsePlugin { eclipseWriter.setLocalRepositoryFile( new File ( localRepository.getBasedir() ) ); + if ( executedProject == null ) + { + // backwards compat with alpha-2 only + executedProject = project; + } + eclipseWriter.write( project, executedProject ); } catch ( EclipsePluginException e ) diff --git a/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java b/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java index 582b77d2d2..c8a3bfa9e0 100644 --- a/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java +++ b/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java @@ -40,7 +40,7 @@ import java.util.Iterator; * Goal for generating IDEA files from a POM. * * @goal idea - * @execute phase="generate-sources" + * @executePhase "generate-sources" * @requiresDependencyResolution test * @todo use dom4j or something. Xpp3Dom can't cope properly with entities and so on */ @@ -56,14 +56,18 @@ public class IdeaMojo /** * @parameter expression="${executedProject}" - * @required - * @readonly */ private MavenProject executedProject; public void execute() throws MojoExecutionException { + if ( executedProject == null ) + { + // backwards compat with alpha-2 only + executedProject = project; + } + rewriteModule(); rewriteProject(); diff --git a/maven-plugins/pom.xml b/maven-plugins/pom.xml index 0a34b61596..b2d51e3154 100644 --- a/maven-plugins/pom.xml +++ b/maven-plugins/pom.xml @@ -90,8 +90,7 @@ maven-clean-plugin maven-compiler-plugin maven-deploy-plugin - - + maven-eclipse-plugin maven-ejb-plugin maven-idea-plugin maven-install-plugin