Author: ltheussl
Date: Fri Jul 15 09:17:26 2011
New Revision: 1147048
URL: http://svn.apache.org/viewvc?rev=1147048&view=rev
Log:
[MSITE-550] attributes parameter does not work
Added:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/pom.xml
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/apt/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/apt/index.apt
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.vm
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.xml
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/verify.bsh
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-550/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/pom.xml?rev=1147048&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/pom.xml Fri Jul 15
09:17:26 2011
@@ -0,0 +1,30 @@
+<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>test</groupId>
+ <artifactId>MSITE-550</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <templateFile>${basedir}/src/site/site.vm</templateFile>
+ <generateReports>false</generateReports>
+ <attributes>
+ <att1>val1</att1>
+ </attributes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <dummy>value</dummy>
+ </properties>
+
+</project>
Added:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/apt/index.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/apt/index.apt?rev=1147048&view=auto
==============================================================================
---
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/apt/index.apt
(added)
+++
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/apt/index.apt
Fri Jul 15 09:17:26 2011
@@ -0,0 +1,17 @@
+ -----
+ Title Here
+ -----
+ Author Here
+ -----
+ -----
+
+Maven Site for your project
+
+ Congratulations! If you are looking at this page then you have successfully
generated a
+ template site employing the site archetype and you have run:
+
++-----+
+
+mvn site
+
++-----+
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.vm
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.vm?rev=1147048&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.vm
(added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.vm Fri
Jul 15 09:17:26 2011
@@ -0,0 +1,2 @@
+dummy=$dummy
+att1=$att1
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.xml?rev=1147048&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.xml
(added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/src/site/site.xml
Fri Jul 15 09:17:26 2011
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project name="Maven" xmlns="http://maven.apache.org/DECORATION/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0
http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+ <body>
+ <links>
+ <item name="Maven" href="http://maven.apache.org/"/>
+ </links>
+
+ <menu name="Documentation">
+ <!--<item name="Xdoc Example" href="xdoc.html"/>-->
+ </menu>
+ </body>
+</project>
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/verify.bsh
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/verify.bsh?rev=1147048&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/verify.bsh (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-550/verify.bsh Fri Jul
15 09:17:26 2011
@@ -0,0 +1,51 @@
+
+/*
+ * 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.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+ File index = new File( basedir, "target/site/index.html" );
+ if ( !index.exists() || index.isDirectory() )
+ {
+ System.err.println( "no index file or is a directory." );
+ result = false;
+ }
+
+ String content = FileUtils.fileRead( index, "UTF-8" );
+ int index1 = content.indexOf( "dummy=value" );
+ int index2 = content.indexOf( "att1=val1" );
+
+ if ( index1 < 0 || index2 < 0 )
+ {
+ System.err.println( "index.html not resolved!" );
+ result = false;
+ }
+}
+catch ( IOException e )
+{
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
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=1147048&r1=1147047&r2=1147048&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
Fri Jul 15 09:17:26 2011
@@ -120,7 +120,7 @@ public abstract class AbstractSiteRender
/**
* The template properties for rendering the site.
*
- * @parameter expression="${attributes}"
+ * @parameter
*/
private Map<String, Object> attributes;