Author: wsmoak Date: Tue Mar 20 21:14:37 2007 New Revision: 520740 URL: http://svn.apache.org/viewvc?view=rev&rev=520740 Log: [MPIR-63] Allow configuration of scm anonymous connection, developer connection and web access url for the SCM Report.
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/examples/scm-report.apt (with props) Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/index.apt maven/plugins/trunk/maven-project-info-reports-plugin/src/site/site.xml Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java?view=diff&rev=520740&r1=520739&r2=520740 ============================================================================== --- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java (original) +++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java Tue Mar 20 21:14:37 2007 @@ -61,6 +61,30 @@ private String checkoutDirectoryName; /** + * The scm anonymous connection url. + * + * @parameter default-value="${project.scm.connection}" + * @since 2.1 + */ + private String anonymousConnection; + + /** + * The scm developer connection url. + * + * @parameter default-value="${project.scm.developerConnection}" + * @since 2.1 + */ + private String developerConnection; + + /** + * The scm web access url. + * + * @parameter default-value="${project.scm.url}" + * @since 2.1 + */ + private String webAccessUrl; + + /** * @see org.apache.maven.reporting.MavenReport#getName(java.util.Locale) */ public String getName( Locale locale ) @@ -82,7 +106,8 @@ public void executeReport( Locale locale ) { ScmRenderer r = - new ScmRenderer( scmManager, getSink(), getProject().getModel(), i18n, locale, checkoutDirectoryName ); + new ScmRenderer( scmManager, getSink(), getProject().getModel(), i18n, locale, checkoutDirectoryName, + webAccessUrl, anonymousConnection, developerConnection ); r.render(); } @@ -115,7 +140,10 @@ private String checkoutDirectoryName; - ScmRenderer( ScmManager scmManager, Sink sink, Model model, I18N i18n, Locale locale, String checkoutDirName ) + private String webAccessUrl; + + ScmRenderer( ScmManager scmManager, Sink sink, Model model, I18N i18n, Locale locale, String checkoutDirName, + String webAccessUrl, String anonymousConnection, String devConnection ) { super( sink ); @@ -128,6 +156,13 @@ this.locale = locale; this.checkoutDirectoryName = checkoutDirName; + + this.webAccessUrl = webAccessUrl; + + this.anonymousConnection = anonymousConnection; + + this.devConnection = devConnection; + } /** @@ -155,9 +190,6 @@ return; } - anonymousConnection = scm.getConnection(); - devConnection = scm.getDeveloperConnection(); - if ( StringUtils.isEmpty( anonymousConnection ) && StringUtils.isEmpty( devConnection ) && StringUtils.isEmpty( scm.getUrl() ) ) { @@ -177,7 +209,7 @@ renderOverViewSection( anonymousRepository ); // Web access section - renderWebAccesSection( scm.getUrl() ); + renderWebAccesSection( webAccessUrl ); // Anonymous access section if needed renderAnonymousAccessSection( anonymousRepository ); Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/examples/scm-report.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/examples/scm-report.apt?view=auto&rev=520740 ============================================================================== --- maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/examples/scm-report.apt (added) +++ maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/examples/scm-report.apt Tue Mar 20 21:14:37 2007 @@ -0,0 +1,47 @@ + ------ + Maven 2 Project Info Report Plugin - SCM Report + ------ + The Maven Team + ------ + 12 March 2007 + +SCM Report + + By default, the SCM Report uses the information configured (or inherited) + in the <<<<scm>>>> element of <<<pom.xml>>>. To override these values, + you can configure the webAccessUrl, anonymousConnection and + developerConnection properties. + + This feature is useful when the project website is stored in + a separate module, and you want the SCM report to give instructions for + checking out the project trunk. + + <Note: this feature is available in version 2.1+> + ++-----------------+ + <project> + [...] + <scm> + <connection>scm:svn:http://svn.example.org/repo/project/trunk/site</connection> + <developerConnection>scm:svn:https://svn.example.org/repo/project/trunk/site</developerConnection> + <url>http://svn.example.org/viewvc/project/trunk/site</url> + </scm> + [...] + <reporting> + [...] + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + <configuration> + <webAccessUrl>http://svn.example.org/viewvc/project/trunk</webAccessUrl> + <anonymousConnection>scm:svn:http://svn.example.org/repo/project/trunk</anonymousConnection> + <developerConnection>scm:svn:https://svn.example.org/repo/project/trunk</developerConnection> + </configuration> + </plugin> + </plugins> + [...] + <reporting> + [...] + </project> ++-----------------+ Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/examples/scm-report.apt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/examples/scm-report.apt ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/index.apt?view=diff&rev=520740&r1=520739&r2=520740 ============================================================================== --- maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/index.apt (original) +++ maven/plugins/trunk/maven-project-info-reports-plugin/src/site/apt/index.apt Tue Mar 20 21:14:37 2007 @@ -53,6 +53,8 @@ * {{{examples/individual-reports.html}Running Individual Reports}} + * {{{examples/scm-report.html}Customizing the SCM Report}} + * {{{project-info.html}Overview of the reports generated for this plugin}} * Related Links Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/site/site.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/site/site.xml?view=diff&rev=520740&r1=520739&r2=520740 ============================================================================== --- maven/plugins/trunk/maven-project-info-reports-plugin/src/site/site.xml (original) +++ maven/plugins/trunk/maven-project-info-reports-plugin/src/site/site.xml Tue Mar 20 21:14:37 2007 @@ -26,7 +26,8 @@ </menu> <menu name="Examples"> <item name="Selective Reports" href="examples/selective-project-info-reports.html"/> - <item name="Individual Reports" href="examples/individual-reports.html"/> + <item name="Individual Reports" href="examples/individual-reports.html"/> + <item name="SCM Report" href="examples/scm-report.html"/> </menu> </body> </project>