mirror of https://github.com/apache/maven.git
get project reports working
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163376 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4e71f4f78a
commit
b005ece7c4
|
@ -9,3 +9,4 @@ dist
|
||||||
target
|
target
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
|
build.xml
|
||||||
|
|
|
@ -64,4 +64,8 @@
|
||||||
<url>scp://www.apache.org//www/maven.apache.org/m2</url>
|
<url>scp://www.apache.org//www/maven.apache.org/m2</url>
|
||||||
</site>
|
</site>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
<reports>
|
||||||
|
<report>mail-lists</report>
|
||||||
|
<report>dependencies</report>
|
||||||
|
</reports>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -12,6 +12,13 @@
|
||||||
<package>org.apache.maven.reporting</package>
|
<package>org.apache.maven.reporting</package>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- TODO: this dependency should not be needed - the manager needs to discover the reports, either via the plugin manager or using a similar technique -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>maven</groupId>
|
||||||
|
<artifactId>maven-project-reports-plugin</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<type>plugin</type>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>doxia</groupId>
|
<groupId>doxia</groupId>
|
||||||
<artifactId>doxia-core</artifactId>
|
<artifactId>doxia-core</artifactId>
|
||||||
|
@ -23,4 +30,10 @@
|
||||||
<version>3.8.1</version>
|
<version>3.8.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<preGoals>
|
||||||
|
<preGoal>
|
||||||
|
<name>compiler:compile</name>
|
||||||
|
<attain>plexus:descriptor</attain>
|
||||||
|
</preGoal>
|
||||||
|
</preGoals>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
package org.apache.maven.reporting;
|
package org.apache.maven.reporting;
|
||||||
|
|
||||||
|
import org.apache.maven.model.Model;
|
||||||
|
import org.codehaus.doxia.sink.Sink;
|
||||||
|
import org.codehaus.doxia.site.renderer.SiteRenderer;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2005 The Apache Software Foundation.
|
* Copyright 2005 The Apache Software Foundation.
|
||||||
*
|
*
|
||||||
|
@ -21,13 +27,23 @@ package org.apache.maven.reporting;
|
||||||
*
|
*
|
||||||
* @author Brett Porter
|
* @author Brett Porter
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
|
* @plexus.component
|
||||||
*/
|
*/
|
||||||
public class DefaultMavenReportManager
|
public class DefaultMavenReportManager
|
||||||
implements MavenReportManager
|
implements MavenReportManager
|
||||||
{
|
{
|
||||||
public MavenReport getReport( String name )
|
private Map mavenReports;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo we need some type of response
|
||||||
|
* @todo don't want to be passing in model - use report configuration
|
||||||
|
*/
|
||||||
|
public void executeReport( String name, Model model, SiteRenderer siteRenderer, String outputDirectory )
|
||||||
|
throws Exception
|
||||||
{
|
{
|
||||||
// TODO: return the report
|
MavenReport report = (MavenReport) mavenReports.get( name );
|
||||||
return null;
|
|
||||||
|
Sink sink = siteRenderer.createSink( outputDirectory, report.getOutputName() );
|
||||||
|
report.execute( model, sink );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ package org.apache.maven.reporting;
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.maven.model.Model;
|
||||||
import org.codehaus.doxia.sink.Sink;
|
import org.codehaus.doxia.sink.Sink;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,6 +29,9 @@ public interface MavenReport
|
||||||
{
|
{
|
||||||
String ROLE = MavenReport.class.getName();
|
String ROLE = MavenReport.class.getName();
|
||||||
|
|
||||||
void execute( Sink sink )
|
/** @todo don't want the model here long term. */
|
||||||
|
void execute( Model model, Sink sink )
|
||||||
throws MavenReportException;
|
throws MavenReportException;
|
||||||
|
|
||||||
|
String getOutputName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,9 @@ package org.apache.maven.reporting;
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.maven.model.Model;
|
||||||
|
import org.codehaus.doxia.site.renderer.SiteRenderer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage the set of available reports.
|
* Manage the set of available reports.
|
||||||
*
|
*
|
||||||
|
@ -26,5 +29,5 @@ public interface MavenReportManager
|
||||||
{
|
{
|
||||||
String ROLE = MavenReportManager.class.getName();
|
String ROLE = MavenReportManager.class.getName();
|
||||||
|
|
||||||
MavenReport getReport( String name );
|
void executeReport( String name, Model model, SiteRenderer siteRenderer, String outputDirectory ) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue