PR: MNG-1034

Submitted by: Johnny R. Ruiz III
Reviewed by:  Brett Porter
switch plugins to use the outputDirectory field of <reporting>

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@306506 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-10-06 03:09:20 +00:00
parent fa968c9a87
commit 36b0bfffaf
11 changed files with 107 additions and 135 deletions

View File

@ -17,12 +17,12 @@ package org.apache.maven.plugin.clover;
*/ */
import com.cenqua.clover.reporters.html.HtmlReporter; import com.cenqua.clover.reporters.html.HtmlReporter;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException; import org.apache.maven.reporting.MavenReportException;
import org.apache.maven.plugin.MojoExecutionException;
import org.codehaus.doxia.site.renderer.SiteRenderer;
import org.codehaus.doxia.sink.Sink; import org.codehaus.doxia.sink.Sink;
import org.codehaus.doxia.site.renderer.SiteRenderer;
import java.util.Locale; import java.util.Locale;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@ -35,7 +35,8 @@ import java.util.ResourceBundle;
* @goal clover * @goal clover
* @execute phase="test" lifecycle="clover" * @execute phase="test" lifecycle="clover"
*/ */
public class CloverReportMojo extends AbstractMavenReport public class CloverReportMojo
extends AbstractMavenReport
{ {
/** /**
* @parameter expression="${project.build.directory}/clover/clover.db" * @parameter expression="${project.build.directory}/clover/clover.db"
@ -44,15 +45,13 @@ public class CloverReportMojo extends AbstractMavenReport
private String cloverDatabase; private String cloverDatabase;
/** /**
* @parameter expression="${project.build.directory}/site/clover" * @parameter expression="${project.reporting.outputDirectory}/clover"
* @required * @required
*/ */
private String outputDirectory; private String outputDirectory;
/** /**
* @parameter expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}" * @component
* @required
* @readonly
*/ */
private SiteRenderer siteRenderer; private SiteRenderer siteRenderer;
@ -157,8 +156,8 @@ public class CloverReportMojo extends AbstractMavenReport
} }
catch ( Exception e ) catch ( Exception e )
{ {
throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH ) throw new MojoExecutionException(
+ " report generation.", e ); "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation.", e );
} }
} }

View File

@ -60,9 +60,7 @@ public class PluginReport
/** /**
* Doxia Site Renderer. * Doxia Site Renderer.
* *
* @parameter expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}" * @component
* @required
* @readonly
*/ */
private SiteRenderer siteRenderer; private SiteRenderer siteRenderer;
@ -78,8 +76,7 @@ public class PluginReport
/** /**
* Mojo scanner tools. * Mojo scanner tools.
* *
* @parameter expression="${component.org.apache.maven.tools.plugin.scanner.MojoScanner}" * @component
* @required
*/ */
protected MojoScanner mojoScanner; protected MojoScanner mojoScanner;

View File

@ -23,7 +23,6 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.AbstractMavenReportRenderer; import org.apache.maven.reporting.AbstractMavenReportRenderer;
import org.apache.maven.reporting.MavenReportException; import org.apache.maven.reporting.MavenReportException;
import org.codehaus.doxia.sink.Sink; import org.codehaus.doxia.sink.Sink;
import org.codehaus.doxia.site.renderer.SiteRenderer; import org.codehaus.doxia.site.renderer.SiteRenderer;
import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.StringUtils;
@ -36,10 +35,9 @@ import java.util.ResourceBundle;
/** /**
* Generates the Project Continuous Integration System report. * Generates the Project Continuous Integration System report.
* *
* @goal cim
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a> * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
* @version $Id$ * @version $Id$
* @goal cim
*/ */
public class CimReport public class CimReport
extends AbstractMavenReport extends AbstractMavenReport
@ -51,7 +49,7 @@ public class CimReport
/** /**
* Report output directory. * Report output directory.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private String outputDirectory; private String outputDirectory;
@ -215,16 +213,15 @@ public class CimReport
String address = getBundle( locale ).getString( "report.cim.notifiers.column.address" ); String address = getBundle( locale ).getString( "report.cim.notifiers.column.address" );
String configuration = getBundle( locale ).getString( "report.cim.notifiers.column.configuration" ); String configuration = getBundle( locale ).getString( "report.cim.notifiers.column.configuration" );
tableHeader( new String[] { type, address, configuration } ); tableHeader( new String[]{type, address, configuration} );
for ( Iterator i = notifiers.iterator(); i.hasNext(); ) for ( Iterator i = notifiers.iterator(); i.hasNext(); )
{ {
Notifier notifier = (Notifier) i.next(); Notifier notifier = (Notifier) i.next();
tableRow( new String[] { tableRow( new String[]{notifier.getType(),
notifier.getType(),
createLinkPatternedText( notifier.getAddress(), notifier.getAddress() ), createLinkPatternedText( notifier.getAddress(), notifier.getAddress() ),
propertiesToString( notifier.getConfiguration() ) } ); propertiesToString( notifier.getConfiguration() )} );
} }
endTable(); endTable();

View File

@ -49,7 +49,7 @@ public class DependenciesReport
/** /**
* Report output directory. * Report output directory.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private String outputDirectory; private String outputDirectory;
@ -245,9 +245,10 @@ public class DependenciesReport
} }
catch ( ProjectBuildingException e ) catch ( ProjectBuildingException e )
{ {
throw new IllegalArgumentException( "Can't find a valid Maven project in the repository for the artifact [" throw new IllegalArgumentException(
+ artifact.getGroupId() + ":" + artifact.getArtifactId() "Can't find a valid Maven project in the repository for the artifact [" +
+ ":" + artifact.getVersion() + "]." ); artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion() +
"]." );
} }
tableRow( new String[]{artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), tableRow( new String[]{artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
@ -289,10 +290,10 @@ public class DependenciesReport
catch ( ProjectBuildingException e ) catch ( ProjectBuildingException e )
{ {
// TODO: better exception handling needed - log PBE // TODO: better exception handling needed - log PBE
throw new IllegalArgumentException( "Can't find a valid Maven project in the repository for the artifact [" throw new IllegalArgumentException(
+ artifact.getGroupId() + ":" "Can't find a valid Maven project in the repository for the artifact [" +
+ artifact.getArtifactId() + ":" artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion() +
+ artifact.getVersion() + "]." ); "]." );
} }
tableRow( new String[]{artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), tableRow( new String[]{artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
artifactProject.getDescription(), artifactProject.getDescription(),
@ -352,11 +353,14 @@ public class DependenciesReport
if ( !"pom".equals( artifact.getType() ) ) if ( !"pom".equals( artifact.getType() ) )
{ {
projectArtifact = artifactFactory.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getScope() ); projectArtifact = artifactFactory.createProjectArtifact( artifact.getGroupId(),
artifact.getArtifactId(),
artifact.getVersion(), artifact.getScope() );
} }
// TODO: we should use the MavenMetadataSource instead // TODO: we should use the MavenMetadataSource instead
return mavenProjectBuilder.buildFromRepository( projectArtifact, project.getRepositories(), localRepository ); return mavenProjectBuilder.buildFromRepository( projectArtifact, project.getRepositories(),
localRepository );
} }
} }

View File

@ -26,17 +26,15 @@ import org.codehaus.doxia.sink.Sink;
import org.codehaus.doxia.site.renderer.SiteRenderer; import org.codehaus.doxia.site.renderer.SiteRenderer;
import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.StringUtils;
import java.io.IOException;
import java.util.Locale; import java.util.Locale;
import java.util.ResourceBundle; import java.util.ResourceBundle;
/** /**
* Generates the Project Issue Tracking report. * Generates the Project Issue Tracking report.
* *
* @goal issue-tracking
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a> * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
* @version $Id$ * @version $Id$
* @goal issue-tracking
*/ */
public class IssueTrackingReport public class IssueTrackingReport
extends AbstractMavenReport extends AbstractMavenReport
@ -44,7 +42,7 @@ public class IssueTrackingReport
/** /**
* Report outpur directory. * Report outpur directory.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private String outputDirectory; private String outputDirectory;

View File

@ -53,7 +53,7 @@ public class LicenseReport
/** /**
* Report output directory. * Report output directory.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private String outputDirectory; private String outputDirectory;

View File

@ -44,7 +44,7 @@ public class MailingListsReport
/** /**
* Report output directory. * Report output directory.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private String outputDirectory; private String outputDirectory;

View File

@ -41,10 +41,9 @@ import java.util.ResourceBundle;
/** /**
* Generates the Project Source Code Management report. * Generates the Project Source Code Management report.
* *
* @goal scm
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a> * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
* @version $Id$ * @version $Id$
* @goal scm
*/ */
public class ScmReport public class ScmReport
extends AbstractMavenReport extends AbstractMavenReport
@ -52,7 +51,7 @@ public class ScmReport
/** /**
* Report output directory. * Report output directory.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private String outputDirectory; private String outputDirectory;
@ -160,7 +159,9 @@ public class ScmReport
private ScmManager scmManager; private ScmManager scmManager;
/** To support more SCM */ /**
* To support more SCM
*/
private String anonymousConnection; private String anonymousConnection;
private String devConnection; private String devConnection;
@ -204,8 +205,7 @@ public class ScmReport
anonymousConnection = scm.getConnection(); anonymousConnection = scm.getConnection();
devConnection = scm.getDeveloperConnection(); devConnection = scm.getDeveloperConnection();
if ( StringUtils.isEmpty( anonymousConnection ) && if ( StringUtils.isEmpty( anonymousConnection ) && StringUtils.isEmpty( devConnection ) &&
StringUtils.isEmpty( devConnection ) &&
StringUtils.isEmpty( scm.getUrl() ) ) StringUtils.isEmpty( scm.getUrl() ) )
{ {
startSection( getTitle() ); startSection( getTitle() );
@ -307,10 +307,9 @@ public class ScmReport
*/ */
private void renderAnonymousAccessSection( ScmRepository anonymousRepository ) private void renderAnonymousAccessSection( ScmRepository anonymousRepository )
{ {
if ( ( isScmSystem( anonymousRepository, "clearcase" ) ) if ( ( isScmSystem( anonymousRepository, "clearcase" ) ) ||
|| ( isScmSystem( anonymousRepository, "perforce" ) ) ( isScmSystem( anonymousRepository, "perforce" ) ) ||
|| ( isScmSystem( anonymousRepository, "starteam" ) ) ( isScmSystem( anonymousRepository, "starteam" ) ) || ( StringUtils.isEmpty( anonymousConnection ) ) )
|| ( StringUtils.isEmpty( anonymousConnection ) ) )
{ {
return; return;
} }
@ -493,9 +492,8 @@ public class ScmReport
* <p>cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login</p> * <p>cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login</p>
* <p>cvs -z3 -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co maven-plugins/dist</p> * <p>cvs -z3 -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co maven-plugins/dist</p>
* *
* @see <a href="https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115">https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115</a>
*
* @param cvsRepo * @param cvsRepo
* @see <a href="https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115">https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115</a>
*/ */
private void anonymousAccessCVS( CvsScmProviderRepository cvsRepo ) private void anonymousAccessCVS( CvsScmProviderRepository cvsRepo )
{ {
@ -516,9 +514,8 @@ public class ScmReport
* <p>cvs -d :pserver:username@cvs.apache.org:/home/cvs login</p> * <p>cvs -d :pserver:username@cvs.apache.org:/home/cvs login</p>
* <p>cvs -z3 -d :ext:username@cvs.apache.org:/home/cvs co maven-plugins/dist</p> * <p>cvs -z3 -d :ext:username@cvs.apache.org:/home/cvs co maven-plugins/dist</p>
* *
* @see <a href="https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115">https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115</a>
*
* @param cvsRepo * @param cvsRepo
* @see <a href="https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115">https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115</a>
*/ */
private void developerAccessCVS( CvsScmProviderRepository cvsRepo ) private void developerAccessCVS( CvsScmProviderRepository cvsRepo )
{ {
@ -543,9 +540,8 @@ public class ScmReport
* <p>p4 -H hostname -p port -u username -P password path</p> * <p>p4 -H hostname -p port -u username -P password path</p>
* <p>p4 -H hostname -p port -u username -P password path submit -c changement</p> * <p>p4 -H hostname -p port -u username -P password path submit -c changement</p>
* *
* @see <a href="http://www.perforce.com/perforce/doc.051/manuals/cmdref/index.html">http://www.perforce.com/perforce/doc.051/manuals/cmdref/index.html</>
*
* @param perforceRepo * @param perforceRepo
* @see <a href="http://www.perforce.com/perforce/doc.051/manuals/cmdref/index.html">http://www.perforce.com/perforce/doc.051/manuals/cmdref/index.html</>
*/ */
private void developerAccessPerforce( PerforceScmProviderRepository perforceRepo ) private void developerAccessPerforce( PerforceScmProviderRepository perforceRepo )
{ {
@ -609,9 +605,8 @@ public class ScmReport
* For example, generate the following command line: * For example, generate the following command line:
* <p>svn checkout http://svn.apache.org/repos/asf/maven/components/trunk maven</p> * <p>svn checkout http://svn.apache.org/repos/asf/maven/components/trunk maven</p>
* *
* @see <a href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>
*
* @param svnRepo * @param svnRepo
* @see <a href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>
*/ */
private void anonymousAccessSVN( SvnScmProviderRepository svnRepo ) private void anonymousAccessSVN( SvnScmProviderRepository svnRepo )
{ {
@ -629,9 +624,8 @@ public class ScmReport
* <p>svn checkout https://svn.apache.org/repos/asf/maven/components/trunk maven</p> * <p>svn checkout https://svn.apache.org/repos/asf/maven/components/trunk maven</p>
* <p>svn commit --username your-username -m "A message"</p> * <p>svn commit --username your-username -m "A message"</p>
* *
* @see <a href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>
*
* @param svnRepo * @param svnRepo
* @see <a href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>
*/ */
private void developerAccessSVN( SvnScmProviderRepository svnRepo ) private void developerAccessSVN( SvnScmProviderRepository svnRepo )
{ {
@ -682,11 +676,10 @@ public class ScmReport
* Convenience method that return true is the defined <code>SCM repository</code> is a known provider. * Convenience method that return true is the defined <code>SCM repository</code> is a known provider.
* <p>Actually, we fully support Clearcase, CVS, Perforce, Starteam, SVN by the maven-scm-providers component.</p> * <p>Actually, we fully support Clearcase, CVS, Perforce, Starteam, SVN by the maven-scm-providers component.</p>
* *
* @see <a href="http://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-providers/">maven-scm-providers</a>
*
* @param scmRepository a SCM repository * @param scmRepository a SCM repository
* @param scmProvider a SCM provider name * @param scmProvider a SCM provider name
* @return true if the provider of the given SCM repository is equal to the given scm provider. * @return true if the provider of the given SCM repository is equal to the given scm provider.
* @see <a href="http://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-providers/">maven-scm-providers</a>
*/ */
private static boolean isScmSystem( ScmRepository scmRepository, String scmProvider ) private static boolean isScmSystem( ScmRepository scmRepository, String scmProvider )
{ {

View File

@ -36,10 +36,9 @@ import java.util.ResourceBundle;
/** /**
* Generates the Project Team report. * Generates the Project Team report.
* *
* @goal project-team
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a> * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
* @version $Id$ * @version $Id$
* @goal project-team
*/ */
public class TeamListReport public class TeamListReport
extends AbstractMavenReport extends AbstractMavenReport
@ -47,7 +46,7 @@ public class TeamListReport
/** /**
* Report output directory. * Report output directory.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private String outputDirectory; private String outputDirectory;
@ -173,7 +172,8 @@ public class TeamListReport
.append( " var now = new Date();\n" ) .append( " var now = new Date();\n" )
.append( " var nowTime = now.getTime();\n" ) .append( " var nowTime = now.getTime();\n" )
.append( " var localOffset = now.getTimezoneOffset();\n" ) .append( " var localOffset = now.getTimezoneOffset();\n" )
.append( " var developerTime = nowTime + ( offset * 60 * 60 * 1000 ) + ( localOffset * 60 * 1000 );\n" ) .append(
" var developerTime = nowTime + ( offset * 60 * 60 * 1000 ) + ( localOffset * 60 * 1000 );\n" )
.append( " var developerDate = new Date(developerTime);\n" ).append( "\n" ) .append( " var developerDate = new Date(developerTime);\n" ).append( "\n" )
.append( " document.getElementById(id).innerHTML = developerDate;\n" ).append( "}\n" ) .append( " document.getElementById(id).innerHTML = developerDate;\n" ).append( "}\n" )
.append( "\n" ) .append( "\n" )
@ -209,17 +209,8 @@ public class TeamListReport
String actualTime = getBundle( locale ).getString( "report.team-list.developers.actualtime" ); String actualTime = getBundle( locale ).getString( "report.team-list.developers.actualtime" );
String properties = getBundle( locale ).getString( "report.team-list.developers.properties" ); String properties = getBundle( locale ).getString( "report.team-list.developers.properties" );
tableHeader( new String[] { tableHeader( new String[]{id, name, email, url, organization, organizationUrl, roles, timeZone,
id, actualTime, properties} );
name,
email,
url,
organization,
organizationUrl,
roles,
timeZone,
actualTime,
properties } );
// To handle JS // To handle JS
int developersRows = 0; int developersRows = 0;
@ -240,7 +231,8 @@ public class TeamListReport
tableCell( developer.getOrganization() ); tableCell( developer.getOrganization() );
tableCell( createLinkPatternedText( developer.getOrganizationUrl(), developer.getOrganizationUrl() ) ); tableCell(
createLinkPatternedText( developer.getOrganizationUrl(), developer.getOrganizationUrl() ) );
if ( developer.getRoles() != null ) if ( developer.getRoles() != null )
{ {
@ -313,16 +305,8 @@ public class TeamListReport
String actualTime = getBundle( locale ).getString( "report.team-list.contributors.actualtime" ); String actualTime = getBundle( locale ).getString( "report.team-list.contributors.actualtime" );
String properties = getBundle( locale ).getString( "report.team-list.contributors.properties" ); String properties = getBundle( locale ).getString( "report.team-list.contributors.properties" );
tableHeader( new String[] { tableHeader( new String[]{name, email, url, organization, organizationUrl, roles, timeZone, actualTime,
name, properties} );
email,
url,
organization,
organizationUrl,
roles,
timeZone,
actualTime,
properties } );
// To handle JS // To handle JS
int contributorsRows = 0; int contributorsRows = 0;

View File

@ -52,7 +52,7 @@ public class SiteDeployMojo
extends AbstractMojo extends AbstractMojo
{ {
/** /**
* @parameter alias="siteDirectory" expression="${project.build.directory}/site" * @parameter alias="siteDirectory" expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private File inputDirectory; private File inputDirectory;

View File

@ -113,7 +113,7 @@ public class SiteMojo
/** /**
* Directory containing the generated project sites and report distributions. * Directory containing the generated project sites and report distributions.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.reporting.outputDirectory}"
* @required * @required
*/ */
private File outputDirectory; private File outputDirectory;