maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r759553 - in /maven/components/branches/MNG-2766: ./ maven-core/src/main/java/org/apache/maven/execution/ maven-core/src/main/java/org/apache/maven/plugin/ maven-reporting-api/
Date Sat, 28 Mar 2009 19:02:59 GMT
Author: jvanzyl
Date: Sat Mar 28 19:02:58 2009
New Revision: 759553

URL: http://svn.apache.org/viewvc?rev=759553&view=rev
Log:
o removing reporting completely

Modified:
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
    maven/components/branches/MNG-2766/maven-reporting-api/pom.xml
    maven/components/branches/MNG-2766/pom.xml

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java?rev=759553&r1=759552&r2=759553&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
Sat Mar 28 19:02:58 2009
@@ -52,8 +52,6 @@
     private MavenExecutionRequest request;
 
     private MavenProject currentProject;
-
-    private Map reports = new LinkedHashMap();
         
     // Used by the embedder to verifyPlugin
     public MavenSession( PlexusContainer container, MavenExecutionRequest request )
@@ -150,47 +148,6 @@
         return currentProject;
     }
 
-    /**
-     * Retrieve the list of reports ({@link MavenReport} instances) that have been executed
against
-     * this project, for use in another mojo's execution.
-     */
-    public List getReports()
-    {
-        if ( reports == null )
-        {
-            return Collections.EMPTY_LIST;
-        }
-
-        return new ArrayList( reports.values() );
-    }
-
-    /**
-     * Clear the reports for this project
-     */
-    public void clearReports()
-    {
-        reports.clear();
-    }
-
-    /**
-     * Add a newly-executed report ({@link MavenReport} instance) to the reports collection,
for
-     * future reference.
-     */
-    public void addReport( MojoDescriptor mojoDescriptor, MavenReport report )
-    {
-        reports.put( mojoDescriptor, report );
-    }
-
-    public Set getReportMojoDescriptors()
-    {
-        if ( reports == null )
-        {
-            return Collections.EMPTY_SET;
-        }
-
-        return reports.keySet();
-    }
-
     public ProjectBuilderConfiguration getProjectBuilderConfiguration()
     {
         return request.getProjectBuildingConfiguration();

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=759553&r1=759552&r2=759553&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
Sat Mar 28 19:02:58 2009
@@ -55,7 +55,6 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.model.PluginExecution;
-import org.apache.maven.model.ReportPlugin;
 import org.apache.maven.monitor.logging.DefaultLog;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.plugin.descriptor.Parameter;
@@ -583,15 +582,6 @@
             {
                 throw new PluginExecutionException( mojoExecution, project, e );
             }
-
-            // NEW: If the mojo that just executed is a report, store it in the LifecycleExecutionContext
-            // for reference by future mojos.
-            if ( mojo instanceof MavenReport )
-            {
-                session.addReport( mojoDescriptor, (MavenReport) mojo );
-            }
-
-            //dispatcher.dispatchEnd( event, goalExecId );
         }
         catch ( MojoExecutionException e )
         {
@@ -629,70 +619,6 @@
         }
     }
 
-    public MavenReport getReport( MavenProject project, MojoExecution mojoExecution, MavenSession
session )
-        throws ArtifactNotFoundException, PluginConfigurationException, PluginManagerException,
ArtifactResolutionException
-    {
-        MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
-        PluginDescriptor descriptor = mojoDescriptor.getPluginDescriptor();
-        Xpp3Dom dom = project.getReportConfiguration( descriptor.getGroupId(), descriptor.getArtifactId(),
mojoExecution.getExecutionId() );
-        if ( mojoExecution.getConfiguration() != null )
-        {
-            dom = Xpp3Dom.mergeXpp3Dom( dom, mojoExecution.getConfiguration() );
-        }
-
-        return (MavenReport) getConfiguredMojo( session, dom, project, true, mojoExecution
);
-    }
-
-    public PluginDescriptor verifyReportPlugin( ReportPlugin reportPlugin, MavenProject project,
MavenSession session )
-        throws PluginVersionResolutionException, ArtifactResolutionException, ArtifactNotFoundException,
InvalidPluginException, PluginManagerException, PluginNotFoundException,
-        PluginVersionNotFoundException
-    {
-        String version = reportPlugin.getVersion();
-
-        if ( version == null )
-        {
-            version = resolveReportPluginVersion( reportPlugin.getGroupId(), reportPlugin.getArtifactId(),
project, session );
-
-            reportPlugin.setVersion( version );
-        }
-
-        Plugin plugin = new Plugin();
-
-        plugin.setGroupId( reportPlugin.getGroupId() );
-        plugin.setArtifactId( reportPlugin.getArtifactId() );
-        plugin.setVersion( version );
-        
-        try
-        {            
-            addPlugin( plugin, project, session );
-        }
-        catch ( ArtifactNotFoundException e )
-        {
-            String groupId = plugin.getGroupId();
-
-            String artifactId = plugin.getArtifactId();
-
-            String pluginVersion = plugin.getVersion();
-
-            if ( ( groupId == null ) || ( artifactId == null ) || ( pluginVersion == null
) )
-            {
-                throw new PluginNotFoundException( plugin, e );
-            }
-            else if ( groupId.equals( e.getGroupId() ) && artifactId.equals( e.getArtifactId()
) && pluginVersion.equals( e.getVersion() ) && "maven-plugin".equals( e.getType()
) )
-            {
-                throw new PluginNotFoundException( plugin, e );
-            }
-            else
-            {
-                throw e;
-            }
-        }
-
-        PluginDescriptor pluginDescriptor = pluginCollector.getPluginDescriptor( plugin );
-
-        return pluginDescriptor;        
-    }
-
     private Mojo getConfiguredMojo( MavenSession session, Xpp3Dom dom, MavenProject project,
boolean report, MojoExecution mojoExecution )
         throws PluginConfigurationException, PluginManagerException
     {
@@ -735,12 +661,6 @@
                 logger.warn( "No luck." );
             }
 
-            if ( report && !( mojo instanceof MavenReport ) )
-            {
-                // TODO: the mojoDescriptor should actually capture this information so we
don't get this far
-                return null;
-            }
-
             if ( mojo instanceof ContextEnabled )
             {
                 Map<String,Object> pluginContext = session.getPluginContext( pluginDescriptor,
project );
@@ -1397,42 +1317,6 @@
         plugin.setVersion( version );
     }
 
-    public String resolveReportPluginVersion( String groupId, String artifactId, MavenProject
project, MavenSession session )
-        throws PluginVersionResolutionException, InvalidPluginException, PluginVersionNotFoundException
-    {
-        String version = null;
-        
-        if ( project.getReportPlugins() != null )
-        {
-            for ( Iterator it = project.getReportPlugins().iterator(); it.hasNext() &&
( version == null ); )
-            {
-                ReportPlugin plugin = (ReportPlugin) it.next();
-
-                if ( groupId.equals( plugin.getGroupId() ) && artifactId.equals(
plugin.getArtifactId() ) )
-                {
-                    version = plugin.getVersion();
-                }
-            }
-        }
-        
-        // final pass...retrieve the version for RELEASE and also set that resolved version
as the <useVersion/>
-        // in settings.xml.
-        if ( StringUtils.isEmpty( version ) || Artifact.RELEASE_VERSION.equals( version )
)
-        {
-            // 1. resolve the version to be used
-            version = resolveMetaVersion( groupId, artifactId, project, session.getLocalRepository(),
Artifact.RELEASE_VERSION );
-            logger.debug( "Version from RELEASE metadata: " + version );
-        }
-
-        // if we still haven't found a version, then fail early before we get into the update
goop.
-        if ( StringUtils.isEmpty( version ) )
-        {
-            throw new PluginVersionNotFoundException( groupId, artifactId );
-        }
-
-        return version;
-    }
-
     private String resolveMetaVersion( String groupId, String artifactId, MavenProject project,
ArtifactRepository localRepository, String metaVersionId )
         throws PluginVersionResolutionException, InvalidPluginException
     {
@@ -1650,49 +1534,6 @@
             }
         }
     }           
-
-    /**
-     * Load the {@link PluginDescriptor} instance for the specified report plugin, using
the project for
-     * the {@link ArtifactRepository} and other supplemental report/plugin information as
necessary.
-     */
-    public PluginDescriptor loadReportPlugin( ReportPlugin plugin, MavenProject project,
MavenSession session )
-        throws PluginLoaderException
-    {
-        // TODO: Shouldn't we be injecting pluginManagement info here??
-
-        try
-        {
-            return verifyReportPlugin( plugin, project, session );
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " +
e.getMessage(), e );
-        }
-        catch ( ArtifactNotFoundException e )
-        {
-            throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " +
e.getMessage(), e );
-        }
-        catch ( PluginNotFoundException e )
-        {
-            throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " +
e.getMessage(), e );
-        }
-        catch ( PluginVersionResolutionException e )
-        {
-            throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " +
e.getMessage(), e );
-        }
-        catch ( InvalidPluginException e )
-        {
-            throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " +
e.getMessage(), e );
-        }
-        catch ( PluginManagerException e )
-        {
-            throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " +
e.getMessage(), e );
-        }
-        catch ( PluginVersionNotFoundException e )
-        {
-            throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " +
e.getMessage(), e );
-        }
-    }
     
     public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, MavenSession session
)
         throws PluginLoaderException

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java?rev=759553&r1=759552&r2=759553&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java
Sat Mar 28 19:02:58 2009
@@ -15,16 +15,11 @@
  * the License.
  */
 
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Plugin;
-import org.apache.maven.model.ReportPlugin;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.plugin.descriptor.PluginDescriptor;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
-import org.apache.maven.reporting.MavenReport;
 
 /**
  * @author Jason van Zyl
@@ -46,18 +41,5 @@
     
     //!!jvz The current project is contained in the session
     void executeMojo( MavenProject project, MojoExecution execution, MavenSession session
)
-        throws MojoFailureException, PluginExecutionException, PluginConfigurationException;
-        
-    //!!jvz 
-    // Reporting    
-    // As a function inside Maven is wrong. This needs to be entirely delegated to an external
system. We need to provide an extension
-    // point for any tools that want to hook into the lifecycle but burning reporting into
the core is extremely bad coupling. We need
-    // an aliasing mechanism for the POM as not to break backward compat. During 3.0 we can
support this and at 3.1 with changes to the
-    // model we turf it.
-    
-    MavenReport getReport( MavenProject project, MojoExecution mojoExecution, MavenSession
session )
-        throws ArtifactNotFoundException, PluginConfigurationException, PluginManagerException,
ArtifactResolutionException;
-    
-    PluginDescriptor loadReportPlugin( ReportPlugin reportPlugin, MavenProject project, MavenSession
session )
-        throws PluginLoaderException;    
+        throws MojoFailureException, PluginExecutionException, PluginConfigurationException;
      
 }
\ No newline at end of file

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java?rev=759553&r1=759552&r2=759553&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
Sat Mar 28 19:02:58 2009
@@ -203,10 +203,6 @@
         {
             value = context.getSortedProjects();
         }
-        else if ( "reports".equals( expression ) )
-        {
-            value = context.getReports();
-        }
         else if ("mojoExecution".equals(expression))
         {
         	value = mojoExecution;

Modified: maven/components/branches/MNG-2766/maven-reporting-api/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-reporting-api/pom.xml?rev=759553&r1=759552&r2=759553&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-reporting-api/pom.xml (original)
+++ maven/components/branches/MNG-2766/maven-reporting-api/pom.xml Sat Mar 28 19:02:58 2009
@@ -43,6 +43,7 @@
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-sink-api</artifactId>
+      <version>1.0-alpha-9</version>
     </dependency>
   </dependencies>
 </project>

Modified: maven/components/branches/MNG-2766/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/pom.xml?rev=759553&r1=759552&r2=759553&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/pom.xml (original)
+++ maven/components/branches/MNG-2766/pom.xml Sat Mar 28 19:02:58 2009
@@ -45,13 +45,6 @@
   <properties>
     <classWorldsVersion>1.3</classWorldsVersion>
     <commonsCliVersion>1.0</commonsCliVersion>
-    <!-- 
-    
-    Do not update this, Doxia will be decoupled completely from 3.x and someone can
-    create a rendering engine for it if they like when the release stabilizes. JVZ 
-    
-    -->
-    <doxiaVersion>1.0-alpha-9</doxiaVersion>
     <easyMockVersion>1.2_Java1.3</easyMockVersion>
     <junitVersion>3.8.1</junitVersion>    
     <plexusVersion>1.0-beta-3.0.6</plexusVersion>
@@ -240,7 +233,6 @@
     <module>maven-model</module>
     <module>maven-plugin-api</module>
     <module>maven-project</module>
-    <module>maven-reporting-api</module>
     <module>maven-project-builder</module>
     <module>maven-mercury</module>
     <module>maven-embedder</module>
@@ -412,12 +404,6 @@
         <artifactId>wagon-ssh-external</artifactId>
         <version>${wagonVersion}</version>
       </dependency>
-      <!--  Doxia -->
-      <dependency>
-        <groupId>org.apache.maven.doxia</groupId>
-        <artifactId>doxia-sink-api</artifactId>
-        <version>${doxiaVersion}</version>
-      </dependency>
       <!--  Maven Shared -->
       <dependency>
         <groupId>org.sonatype.spice</groupId>



Mime
View raw message