diff --git a/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/MultiPageReport.java b/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/MultiPageReport.java new file mode 100644 index 0000000..b8c88bb --- /dev/null +++ b/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/MultiPageReport.java @@ -0,0 +1,65 @@ +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 java.io.IOException; +import org.apache.maven.doxia.sink.Sink; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.reporting.MavenReportException; +import org.apache.maven.reporting.MavenReportRenderer; + +/** + * Sample multi-page report. + */ +@Mojo( name = "multi-page" ) +public class MultiPageReport + extends CustomReportWithRenderer +{ + public String getOutputName() + { + return "multi-page"; + } + + public String getName( Locale locale ) + { + return "Multi Page Maven Report"; + } + + public String getDescription( Locale locale ) + { + return "Multi Page Maven Report Description"; + } + + protected void executeReport( Locale locale ) + throws MavenReportException + { + super.executeReport(locale); + + try { + Sink second = getSinkFactory().createSink(outputDirectory, "multi-second.html"); + MavenReportRenderer r = new CustomReportRenderer(second); + r.render(); + } catch (IOException e) { + throw new MavenReportException("Could not create sink", e); + } + } +} diff --git a/src/it/use-as-direct-mojo-markup/invoker.properties b/src/it/use-as-direct-mojo-markup/invoker.properties index a0197fd..484a522 100644 --- a/src/it/use-as-direct-mojo-markup/invoker.properties +++ b/src/it/use-as-direct-mojo-markup/invoker.properties @@ -18,3 +18,4 @@ invoker.goals.1 = custom-reporting:custom -Doutput.format=xdoc invoker.goals.2 = custom-reporting:custom-renderer -Doutput.format=apt invoker.goals.3 = custom-reporting:external -Doutput.format=anything +invoker.goals.4 = custom-reporting:multi-page -Doutput.format=xhtml diff --git a/src/it/use-as-direct-mojo-markup/verify.groovy b/src/it/use-as-direct-mojo-markup/verify.groovy index c4a6bc3..4050c90 100644 --- a/src/it/use-as-direct-mojo-markup/verify.groovy +++ b/src/it/use-as-direct-mojo-markup/verify.groovy @@ -31,4 +31,9 @@ f = new File( outputDir, 'external/report.html' ); assert f.exists(); assert f.text.contains( '