You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2006/07/24 19:33:57 UTC

svn commit: r425129 - in /maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven: lifecycle/ plugin/ plugin/version/

Author: carlos
Date: Mon Jul 24 10:33:57 2006
New Revision: 425129

URL: http://svn.apache.org/viewvc?rev=425129&view=rev
Log:
Merged rev# 425096 from trunk. Added PluginException to aggregate the different plugin exceptions

Added:
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginException.java   (with props)
Modified:
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginException.java
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginConfigurationException.java
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionNotFoundException.java
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java

Modified: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=425129&r1=425128&r2=425129&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java (original)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java Mon Jul 24 10:33:57 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.lifecycle;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
@@ -34,11 +35,11 @@
 import org.apache.maven.model.ReportSet;
 import org.apache.maven.monitor.event.EventDispatcher;
 import org.apache.maven.monitor.event.MavenEvents;
-import org.apache.maven.plugin.InvalidPluginException;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.PluginConfigurationException;
+import org.apache.maven.plugin.PluginException;
 import org.apache.maven.plugin.PluginManager;
 import org.apache.maven.plugin.PluginManagerException;
 import org.apache.maven.plugin.PluginNotFoundException;
@@ -46,8 +47,6 @@
 import org.apache.maven.plugin.descriptor.PluginDescriptor;
 import org.apache.maven.plugin.lifecycle.Execution;
 import org.apache.maven.plugin.lifecycle.Phase;
-import org.apache.maven.plugin.version.PluginVersionNotFoundException;
-import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.apache.maven.reporting.MavenReport;
@@ -1256,7 +1255,7 @@
             throw new LifecycleExecutionException(
                 "Internal error in the plugin manager getting plugin '" + plugin.getKey() + "': " + e.getMessage(), e );
         }
-        catch ( PluginVersionResolutionException e )
+        catch ( PluginException e )
         {
             throw new LifecycleExecutionException( e.getMessage(), e );
         }
@@ -1264,19 +1263,7 @@
         {
             throw new LifecycleExecutionException( e.getMessage(), e );
         }
-        catch ( InvalidPluginException e )
-        {
-            throw new LifecycleExecutionException( e.getMessage(), e );
-        }
-        catch ( ArtifactNotFoundException e )
-        {
-            throw new LifecycleExecutionException( e.getMessage(), e );
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            throw new LifecycleExecutionException( e.getMessage(), e );
-        }
-        catch ( PluginVersionNotFoundException e )
+        catch ( AbstractArtifactResolutionException e )
         {
             throw new LifecycleExecutionException( e.getMessage(), e );
         }
@@ -1296,7 +1283,7 @@
             throw new LifecycleExecutionException(
                 "Internal error in the plugin manager getting report '" + plugin.getKey() + "': " + e.getMessage(), e );
         }
-        catch ( PluginVersionResolutionException e )
+        catch ( PluginException e )
         {
             throw new LifecycleExecutionException( e.getMessage(), e );
         }
@@ -1304,19 +1291,7 @@
         {
             throw new LifecycleExecutionException( e.getMessage(), e );
         }
-        catch ( InvalidPluginException e )
-        {
-            throw new LifecycleExecutionException( e.getMessage(), e );
-        }
-        catch ( ArtifactNotFoundException e )
-        {
-            throw new LifecycleExecutionException( e.getMessage(), e );
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            throw new LifecycleExecutionException( e.getMessage(), e );
-        }
-        catch ( PluginVersionNotFoundException e )
+        catch ( AbstractArtifactResolutionException e )
         {
             throw new LifecycleExecutionException( e.getMessage(), e );
         }

Modified: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginException.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginException.java?rev=425129&r1=425128&r2=425129&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginException.java (original)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginException.java Mon Jul 24 10:33:57 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.plugin;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
  * @version $Id$
  */
 public class InvalidPluginException
-    extends Exception
+    extends PluginException
 {
     public InvalidPluginException( String message, Exception e )
     {

Modified: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginConfigurationException.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginConfigurationException.java?rev=425129&r1=425128&r2=425129&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginConfigurationException.java (original)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginConfigurationException.java Mon Jul 24 10:33:57 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.plugin;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@
  * @version $Id$
  */
 public class PluginConfigurationException
-    extends Exception
+    extends PluginException
 {
     private final PluginDescriptor pluginDescriptor;
 

Added: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginException.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginException.java?rev=425129&view=auto
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginException.java (added)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginException.java Mon Jul 24 10:33:57 2006
@@ -0,0 +1,38 @@
+package org.apache.maven.plugin;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Marker exception to aggregate all kind of plugin exceptions.
+ *
+ * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
+ * @version $Id$
+ * @since 2.0.5
+ */
+public abstract class PluginException
+    extends Exception
+{
+    public PluginException( String message )
+    {
+        super( message );
+    }
+
+    public PluginException( String message, Throwable t )
+    {
+        super( message, t );
+    }
+}

Propchange: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginException.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java?rev=425129&r1=425128&r2=425129&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java (original)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java Mon Jul 24 10:33:57 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
@@ -54,12 +55,20 @@
 
     Plugin getPluginDefinitionForPrefix( String prefix, MavenSession session, MavenProject project );
 
+    /**
+     * TODO should throw {@link PluginException} and {@link AbstractArtifactResolutionException}
+     * instead of all the subclasses
+     */
     PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, Settings settings,
                                    ArtifactRepository localRepository )
         throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException,
         InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException,
         PluginVersionNotFoundException;
 
+    /**
+     * TODO should throw {@link PluginException} and {@link AbstractArtifactResolutionException}
+     * instead of all the subclasses
+     */
     PluginDescriptor verifyReportPlugin( ReportPlugin reportPlugin, MavenProject project, MavenSession session )
         throws PluginVersionResolutionException, ArtifactResolutionException, ArtifactNotFoundException,
         InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException,

Modified: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionNotFoundException.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionNotFoundException.java?rev=425129&r1=425128&r2=425129&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionNotFoundException.java (original)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionNotFoundException.java Mon Jul 24 10:33:57 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.plugin.version;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,10 @@
  * limitations under the License.
  */
 
+import org.apache.maven.plugin.PluginException;
+
 public class PluginVersionNotFoundException
-    extends Exception
+    extends PluginException
 {
     private final String groupId;
 

Modified: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java?rev=425129&r1=425128&r2=425129&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java (original)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java Mon Jul 24 10:33:57 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.plugin.version;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,10 @@
  * limitations under the License.
  */
 
+import org.apache.maven.plugin.PluginException;
+
 public class PluginVersionResolutionException
-    extends Exception
+    extends PluginException
 {
     private final String groupId;