You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2011/03/16 20:37:58 UTC
svn commit: r1082274 - in /maven/plugins/trunk/maven-site-plugin/src:
it/MSITE-354/ it/MSITE-354/goals.txt it/MSITE-354/pom.xml
it/MSITE-354/verify.bsh
main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
Author: dennisl
Date: Wed Mar 16 19:37:58 2011
New Revision: 1082274
URL: http://svn.apache.org/viewvc?rev=1082274&view=rev
Log:
[MSITE-354] Generation of project-info.html cannot be omitted
Added:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/goals.txt (with props)
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/pom.xml (with props)
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/verify.bsh (with props)
Modified:
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/goals.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/goals.txt?rev=1082274&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/goals.txt (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/goals.txt Wed Mar 16 19:37:58 2011
@@ -0,0 +1 @@
+clean site:site
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/goals.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/goals.txt
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/pom.xml?rev=1082274&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/pom.xml Wed Mar 16 19:37:58 2011
@@ -0,0 +1,70 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.test</groupId>
+ <artifactId>MSITE-354</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>MSITE-354</name>
+ <url>http://maven.apache.org</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <generateProjectInfo>false</generateProjectInfo>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.3.1</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>dependencies</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/verify.bsh?rev=1082274&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/verify.bsh (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/verify.bsh Wed Mar 16 19:37:58 2011
@@ -0,0 +1,54 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.*;
+
+boolean result = true;
+
+try
+{
+ File target = new File( basedir, "target" );
+ if ( !target.exists() || !target.isDirectory() )
+ {
+ System.err.println( "target directory is missing or not a directory." );
+ return false;
+ }
+
+ File site = new File( target, "site" );
+ if ( !site.exists() || !site.isDirectory() )
+ {
+ System.err.println( "site directory is missing or not a directory." );
+ return false;
+ }
+
+ File projectInfo = new File ( site, "project-info.html" );
+ if ( projectInfo.exists() || projectInfo.isDirectory() )
+ {
+ System.err.println( "project-info.html file is present although it shouldn't, or is a directory." );
+ return false;
+ }
+}
+catch( IOException e )
+{
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/verify.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-354/verify.bsh
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java?rev=1082274&r1=1082273&r2=1082274&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java (original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java Wed Mar 16 19:37:58 2011
@@ -168,6 +168,15 @@ public abstract class AbstractSiteRender
*/
private boolean relativizeDecorationLinks;
+ /**
+ * Whether to generate the summary page for project reports: project-info.html.
+ *
+ * @parameter expression="${generateProjectInfo}" default-value="true"
+ *
+ * @since 2.3
+ */
+ private boolean generateProjectInfo;
+
protected List<MavenReport> filterReports( List<MavenReport> reports )
{
List<MavenReport> filteredReports = new ArrayList<MavenReport>( reports.size() );
@@ -379,7 +388,7 @@ public abstract class AbstractSiteRender
siteTool.populateReportsMenu( context.getDecoration(), locale, categories );
populateReportItems( context.getDecoration(), locale, reportsByOutputName );
- if ( categories.containsKey( MavenReport.CATEGORY_PROJECT_INFORMATION ) )
+ if ( categories.containsKey( MavenReport.CATEGORY_PROJECT_INFORMATION ) && generateProjectInfo )
{
List<MavenReport> categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_INFORMATION );