From d6567987c5283a83bc603222cb37d2a2234e7dd6 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sat, 14 May 2005 12:18:59 +0000 Subject: [PATCH] o provide a message when there is no POM, which the eclipse plugin requires to work correctly. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@170135 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/plugin/eclipse/EclipsePlugin.java | 5 +++++ .../src/test/projects/project-1/.classpath | 2 +- .../src/test/projects/project-2/.classpath | 2 +- 3 files changed, 7 insertions(+), 2 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 c96211a5bb..a34e804214 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 @@ -60,6 +60,11 @@ public class EclipsePlugin public void execute() throws MojoExecutionException { + if ( project.getFile() == null || !project.getFile().exists() ) + { + throw new MojoExecutionException( "There must be a POM in the current working directory for the Eclipse plugin to work." ); + } + try { eclipseWriter.write( project ); diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-1/.classpath b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-1/.classpath index e1b10830c5..1d941a2d3d 100644 --- a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-1/.classpath +++ b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-1/.classpath @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-2/.classpath b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-2/.classpath index 65275a7070..693dd3ca71 100644 --- a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-2/.classpath +++ b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-2/.classpath @@ -5,5 +5,5 @@ - + \ No newline at end of file