Author: hboutemy
Date: Sun Dec 7 16:04:32 2014
New Revision: 1643693
URL: http://svn.apache.org/r1643693
Log:
[MSHARED-388] created ITs to show how to implement reporting plugins and make
tests
Added:
maven/shared/trunk/maven-reporting-impl/src/it/
maven/shared/trunk/maven-reporting-impl/src/it/settings.xml (with props)
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/invoker.properties
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/pom.xml
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReport.java
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportRenderer.java
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportWithRenderer.java
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/invoker.properties
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/pom.xml
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/verify.groovy
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/invoker.properties
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/pom.xml
(with props)
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/verify.groovy
(with props)
Removed:
maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java
maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/DemoReportRenderer.java
Modified:
maven/shared/trunk/maven-reporting-impl/pom.xml
maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt.vm
Modified: maven/shared/trunk/maven-reporting-impl/pom.xml
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/pom.xml?rev=1643693&r1=1643692&r2=1643693&view=diff
==============================================================================
--- maven/shared/trunk/maven-reporting-impl/pom.xml (original)
+++ maven/shared/trunk/maven-reporting-impl/pom.xml Sun Dec 7 16:04:32 2014
@@ -135,6 +135,37 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <configuration>
+ <debug>true</debug>
+ <projectsDirectory>src/it</projectsDirectory>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <preBuildHookScript>setup</preBuildHookScript>
+ <postBuildHookScript>verify</postBuildHookScript>
+
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
<profiles>
<profile>
<id>reporting</id>
Added: maven/shared/trunk/maven-reporting-impl/src/it/settings.xml
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/settings.xml?rev=1643693&view=auto
==============================================================================
--- maven/shared/trunk/maven-reporting-impl/src/it/settings.xml (added)
+++ maven/shared/trunk/maven-reporting-impl/src/it/settings.xml Sun Dec 7
16:04:32 2014
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<settings>
+ <profiles>
+ <profile>
+ <id>it-repo</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+</settings>
Propchange: maven/shared/trunk/maven-reporting-impl/src/it/settings.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-reporting-impl/src/it/settings.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/shared/trunk/maven-reporting-impl/src/it/settings.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/invoker.properties?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/invoker.properties
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/invoker.properties
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.goals = install
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/invoker.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/pom.xml
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/pom.xml?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/pom.xml
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/pom.xml
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.apache.maven.reporting.its</groupId>
+ <artifactId>custom-reporting-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+
+ <name>maven-reporting-impl IT: custom reporting plugin based on
maven-reporting-impl</name>
+ <description>
+ Demo to show how to write a reporting plugin based on maven-reporting-impl.
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-impl</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-api</artifactId>
+ <version>3.0</version>
+ </dependency>
+
+ <!-- plugin API and plugin-tools -->
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>3.0.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.3</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ <version>0.7</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.5.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.3</version>
+ <executions>
+ <execution>
+ <id>default-descriptor</id>
+ <phase>process-classes</phase>
+ </execution>
+ <execution>
+ <id>generated-helpmojo</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ <configuration><!-- TODO: remove when upgrading plugin-tools to
3.4: see MPLUGIN-238 -->
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>maven-2</id><!-- only necessary to build with Maven 2 -->
+ <activation>
+ <file>
+ <!-- This employs that the basedir expression is only recognized by
Maven 3.x (see MNG-2363) -->
+ <missing>${basedir}</missing>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <configuration>
+ <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ <executions>
+ <execution>
+ <id>mojo-descriptor</id>
+ <goals><!-- Maven 2 does not support phase overriding: need to
add an execution -->
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReport.java
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReport.java?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReport.java
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReport.java
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,75 @@
+package org.apache.maven.reporting.its.custom;
+
+/*
+ * 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.util.Locale;
+
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.reporting.MavenReportException;
+
+/**
+ * Typical code to copy as a reporting plugin start: choose the goal name,
then implement getOutputName(),
+ * getName( Locale ), getDescription( Locale ) and of course executeReport(
Locale ).
+ */
+@Mojo( name = "custom" )
+public class CustomReport
+ extends AbstractMavenReport
+{
+ public String getOutputName()
+ {
+ return "custom-report";
+ }
+
+ public String getName( Locale locale )
+ {
+ return "Custom Maven Report";
+ }
+
+ public String getDescription( Locale locale )
+ {
+ return "Custom Maven Report Description";
+ }
+
+ @Override
+ protected void executeReport( Locale locale )
+ throws MavenReportException
+ {
+ // direct report generation using Doxia: compare with
CustomReportRenderer to see the benefits of using
+ // ReportRenderer
+ getSink().head();
+ getSink().title();
+ getSink().text( "Custom Report Title" );
+ getSink().title_();
+ getSink().head_();
+
+ getSink().body();
+
+ getSink().section1();
+ getSink().sectionTitle1();
+ getSink().text( "section" );
+ getSink().sectionTitle1_();
+
+ getSink().text( "Custom Maven Report content." );
+ getSink().section1_();
+
+ getSink().body_();
+ }
+}
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReport.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReport.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportRenderer.java
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportRenderer.java?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportRenderer.java
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportRenderer.java
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,49 @@
+package org.apache.maven.reporting.its.custom;
+
+/*
+ * 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 org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.reporting.AbstractMavenReportRenderer;
+
+/**
+ * A report renderer, subclassing AbstractMavenReportRenderer to benefit from
helpers.
+ */
+public class CustomReportRenderer
+ extends AbstractMavenReportRenderer
+{
+ public CustomReportRenderer( Sink sink )
+ {
+ super( sink );
+ }
+
+ public String getTitle()
+ {
+ return "Custom Report Renderer Title";
+ }
+
+ public void renderBody()
+ {
+ startSection( "section" );
+
+ text( "Custom Maven Report with Renderer content." );
+
+ endSection();
+ }
+}
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportRenderer.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportRenderer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportWithRenderer.java
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportWithRenderer.java?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportWithRenderer.java
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportWithRenderer.java
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,61 @@
+package org.apache.maven.reporting.its.custom;
+
+/*
+ * 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.util.Locale;
+
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.reporting.MavenReportException;
+import org.apache.maven.reporting.MavenReportRenderer;
+
+/**
+ * Typical code to copy as a reporting plugin start: choose the goal name,
then implement getOutputName(),
+ * getName( Locale ), getDescription( Locale ) and of course executeReport(
Locale ).
+ * Notice the implementation of the rendering is done in a separate class to
improve separation of concerns
+ * and to benefit from helpers.
+ */
+@Mojo( name = "custom-renderer" )
+public class CustomReportWithRenderer
+ extends AbstractMavenReport
+{
+ public String getOutputName()
+ {
+ return "custom-report-with-renderer";
+ }
+
+ public String getName( Locale locale )
+ {
+ return "Custom Maven Report with Renderer";
+ }
+
+ public String getDescription( Locale locale )
+ {
+ return "Custom Maven Report with Renderer Description";
+ }
+
+ protected void executeReport( Locale locale )
+ throws MavenReportException
+ {
+ // use a AbstractMavenReportRenderer subclass to benefit from helpers
+ MavenReportRenderer r = new CustomReportRenderer( getSink() );
+ r.render();
+ }
+}
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportWithRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportWithRenderer.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/CustomReportWithRenderer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/invoker.properties?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/invoker.properties
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/invoker.properties
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,19 @@
+# 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.
+
+invoker.goals.1 =
org.apache.maven.reporting.its:custom-reporting-plugin:1.0-SNAPSHOT:custom
+invoker.goals.2 =
org.apache.maven.reporting.its:custom-reporting-plugin:1.0-SNAPSHOT:custom-renderer
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/invoker.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/pom.xml
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/pom.xml?rev=1643693&view=auto
==============================================================================
--- maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/pom.xml
(added)
+++ maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/pom.xml
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.apache.maven.reporting.its</groupId>
+ <artifactId>use-as-direct-mojo</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>Use report as direct mojo</name>
+ <description>Use report directly as mojo: "mvn
my-plugin:my-report"</description>
+</project>
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/verify.groovy
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/verify.groovy?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/verify.groovy
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/verify.groovy
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+File site = new File( basedir, 'target/site/' )
+
+File f = new File( site, 'custom-report.html' );
+assert f.exists();
+assert f.text.contains( 'Custom Maven Report content.' );
+
+f = new File( site, 'custom-report-with-renderer.html' );
+assert f.exists();
+assert f.text.contains( 'Custom Maven Report with Renderer content.' );
+
+return true;
\ No newline at end of file
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/verify.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-direct-mojo/verify.groovy
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/invoker.properties?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/invoker.properties
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/invoker.properties
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.goals = site
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/invoker.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/pom.xml
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/pom.xml?rev=1643693&view=auto
==============================================================================
--- maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/pom.xml
(added)
+++ maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/pom.xml
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.apache.maven.reporting.its</groupId>
+ <artifactId>use-as-site-report</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>Use report as site report</name>
+ <description>use the report configured in reporting section of pom and
generated during "mvn site"</description>
+ <url>http://maven.apache.org</url>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.4</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.7</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>index</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.reporting.its</groupId>
+ <artifactId>custom-reporting-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/verify.groovy
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/verify.groovy?rev=1643693&view=auto
==============================================================================
---
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/verify.groovy
(added)
+++
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/verify.groovy
Sun Dec 7 16:04:32 2014
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+File site = new File( basedir, 'target/site/' )
+
+File f = new File( site, 'custom-report.html' );
+assert f.exists();
+assert f.text.contains( 'Custom Maven Report content.' );
+
+f = new File( site, 'custom-report-with-renderer.html' );
+assert f.exists();
+assert f.text.contains( 'Custom Maven Report with Renderer content.' );
+
+return true;
\ No newline at end of file
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/verify.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/shared/trunk/maven-reporting-impl/src/it/use-as-site-report/verify.groovy
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt.vm
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt.vm?rev=1643693&r1=1643692&r2=1643693&view=diff
==============================================================================
--- maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt.vm (original)
+++ maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt.vm Sun Dec
7 16:04:32 2014
@@ -3,7 +3,7 @@
-----
Hervé Boutemy
-----
- 2013-07-24
+ 2014-12-07
-----
~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -40,9 +40,8 @@ ${project.name}
* Usage
- Creating a new report plugin can be done by copying
-
<<<{{{./xref-test/org/apache/maven/reporting/AbstractMavenReportTest.html}AbstractMavenReportTest.java}}>>>
- structure and implement a few methods.
+ A full working sample is included in <<<maven-reporting-impl>>> ITs, which
are part of
+ {{{../source-repository.html}the component source tree}}: see
<<<src/it/setup-reporting-plugin>>>.
* History