[Git][java-team/maven-reporting-impl][upstream] 2 commits: New upstream version 3.1.0
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Mon Jan 9 14:26:44 GMT 2023
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / maven-reporting-impl
Commits:
ba302bf1 by Emmanuel Bourg at 2022-10-10T15:53:44+02:00
New upstream version 3.1.0
- - - - -
7fa2e031 by Emmanuel Bourg at 2022-10-10T15:53:51+02:00
New upstream version 3.2.0
- - - - -
11 changed files:
- + .asf.yaml
- + .gitignore
- + Jenkinsfile
- + README.md
- pom.xml
- src/it/setup-reporting-plugin/pom.xml
- src/it/use-as-site-report/pom.xml
- src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
- src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
- src/site/apt/index.apt.vm
- src/site/xdoc/download.xml.vm
Changes:
=====================================
.asf.yaml
=====================================
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+# see https://s.apache.org/asfyaml
+github:
+ description: "Apache Maven Reporting Implementation"
+ homepage: https://maven.apache.org/shared/maven-reporting-impl/
+ labels:
+ - java
+ - build-management
+ - maven-shared
+ - maven
=====================================
.gitignore
=====================================
@@ -0,0 +1,15 @@
+target/
+.project
+.classpath
+.settings/
+.svn/
+bin/
+# Intellij
+*.ipr
+*.iml
+.idea
+out/
+.DS_Store
+/bootstrap
+/dependencies.xml
+.java-version
=====================================
Jenkinsfile
=====================================
@@ -0,0 +1,20 @@
+/**
+ * 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.
+ */
+
+asfMavenTlpStdBuild()
=====================================
README.md
=====================================
@@ -0,0 +1,99 @@
+<!---
+ 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.
+-->
+Contributing to [Apache Maven Reporting Implementation](https://maven.apache.org.reporting/maven-reporting-impl/)
+======================
+
+[![ASF Jira](https://img.shields.io/endpoint?url=https%3A%2F%2Fmaven.apache.org%2Fbadges%2Fasf_jira-MSHARED.json)][jira]
+[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license]
+[![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.reporting/maven-reporting-impl.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.apache.maven.reporting/maven-reporting-impl)
+[![Jenkins Status](https://img.shields.io/jenkins/s/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-reporting-impl/job/master.svg)][build]
+[![Jenkins tests](https://img.shields.io/jenkins/t/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-reporting-impl/job/master.svg)][test-results]
+
+
+You have found a bug or you have an idea for a cool new feature? Contributing
+code is a great way to give something back to the open source community. Before
+you dig right into the code, there are a few guidelines that we need
+contributors to follow so that we can have a chance of keeping on top of
+things.
+
+Getting Started
+---------------
+
++ Make sure you have a [JIRA account](https://issues.apache.org/jira/).
++ Make sure you have a [GitHub account](https://github.com/signup/free).
++ If you're planning to implement a new feature, it makes sense to discuss your changes
+ on the [dev list][ml-list] first.
+ This way you can make sure you're not wasting your time on something that isn't
+ considered to be in Apache Maven's scope.
++ Submit a ticket for your issue, assuming one does not already exist.
+ + Clearly describe the issue, including steps to reproduce when it is a bug.
+ + Make sure you fill in the earliest version that you know has the issue.
++ Fork the repository on GitHub.
+
+Making and Submitting Changes
+--------------
+
+We accept Pull Requests via GitHub. The [developer mailing list][ml-list] is the
+main channel of communication for contributors.
+There are some guidelines which will make applying PRs easier for us:
++ Create a topic branch from where you want to base your work (this is usually the master branch).
+ Push your changes to a topic branch in your fork of the repository.
++ Make commits of logical units.
++ Respect the original code style: by using the same [codestyle][code-style],
+ patches should only highlight the actual difference, not being disturbed by any formatting issues:
+ + Only use spaces for indentation.
+ + Create minimal diffs - disable on save actions like reformat source code or organize imports.
+ If you feel the source code should be reformatted, create a separate PR for this change.
+ + Check for unnecessary whitespace with `git diff --check` before committing.
++ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue.
+```
+[MSHARED-XXX] - Subject of the JIRA Ticket
+ Optional supplemental description.
+```
++ Make sure you have added the necessary tests (JUnit/IT) for your changes.
++ Run all the tests with `mvn -Prun-its verify` to assure nothing else was accidentally broken.
++ Submit a pull request to the repository in the Apache organization.
++ Update your JIRA ticket and include a link to the pull request in the ticket.
+
+If you plan to contribute on a regular basis, please consider filing a [contributor license agreement][cla].
+
+Making Trivial Changes
+----------------------
+
+For changes of a trivial nature to comments and documentation, it is not always
+necessary to create a new ticket in JIRA. In this case, it is appropriate to
+start the first line of a commit with '(doc)' instead of a ticket number.
+
+Additional Resources
+--------------------
+
++ [Contributing patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch)
++ [Apache Maven Shared Components project page][jira]
++ [Contributor License Agreement][cla]
++ [General GitHub documentation](https://help.github.com/)
++ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
++ [Apache Maven Twitter Account](https://twitter.com/ASFMavenProject)
++ #Maven IRC channel on freenode.org
+
+[jira]: https://issues.apache.org/jira/projects/MSHARED/
+[license]: https://www.apache.org/licenses/LICENSE-2.0
+[ml-list]: https://maven.apache.org/mailing-lists.html
+[code-style]: https://maven.apache.org/developers/conventions/code.html
+[cla]: https://www.apache.org/licenses/#clas
+[maven-wiki]: https://cwiki.apache.org/confluence/display/MAVEN/Index
+[test-results]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-reporting-impl/job/master/lastCompletedBuild/testReport/
+[build]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-reporting-impl/job/master/
=====================================
pom.xml
=====================================
@@ -23,13 +23,13 @@
<parent>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-components</artifactId>
- <version>30</version>
- <relativePath>../../pom/maven/maven-shared-components/pom.xml</relativePath>
+ <version>34</version>
+ <relativePath />
</parent>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
- <version>3.0.0</version>
+ <version>3.2.0</version>
<name>Apache Maven Reporting Implementation</name>
<description>Abstract classes to manage report generation.</description>
@@ -47,34 +47,40 @@
</developers>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/maven/shared/tags/maven-reporting-impl-3.0.0</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/shared/tags/maven-reporting-impl-3.0.0</developerConnection>
- <url>http://svn.apache.org/viewvc/maven/shared/tags/maven-reporting-impl-3.0.0</url>
+ <connection>scm:git:https://gitbox.apache.org/repos/asf/maven-reporting-impl.git</connection>
+ <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-reporting-impl.git</developerConnection>
+ <url>https://github.com/apache/maven-reporting-impl/tree/${project.scm.tag}</url>
+ <tag>maven-reporting-impl-3.2.0</tag>
</scm>
<issueManagement>
<system>jira</system>
- <url>https://issues.apache.org/jira/browse/MSHARED/component/12326436</url>
+ <url>https://issues.apache.org/jira/issues/?jql=project%20%3D%20MSHARED%20AND%20component%20in%20(maven-reporting-impl)</url>
</issueManagement>
+ <ciManagement>
+ <system>Jenkins</system>
+ <url>https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-reporting-impl/</url>
+ </ciManagement>
<distributionManagement>
<site>
<id>apache.website</id>
- <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path}</url>
+ <url>scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path}</url>
</site>
</distributionManagement>
<properties>
- <mavenVersion>3.0</mavenVersion>
- <doxiaVersion>1.7</doxiaVersion>
- <doxiaSitetoolsVersion>1.7.4</doxiaSitetoolsVersion>
- <maven.compiler.source>1.6</maven.compiler.source>
- <maven.compiler.target>1.6</maven.compiler.target>
+ <javaVersion>7</javaVersion>
+ <mavenVersion>3.1.0</mavenVersion>
+ <doxiaVersion>1.11.1</doxiaVersion>
+ <doxiaSitetoolsVersion>1.11.1</doxiaSitetoolsVersion>
+ <reportingApiVersion>3.1.1</reportingApiVersion>
+ <project.build.outputTimestamp>2022-08-06T21:51:47Z</project.build.outputTimestamp>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
- <version>3.0</version>
+ <version>${reportingApiVersion}</version>
</dependency>
<!-- Maven -->
@@ -83,6 +89,11 @@
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>${mavenVersion}</version>
+ </dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
@@ -91,7 +102,7 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
- <version>3.2.0</version>
+ <version>3.3.4</version>
</dependency>
<!-- Doxia -->
@@ -110,6 +121,11 @@
<artifactId>doxia-core</artifactId>
<version>${doxiaVersion}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-integration-tools</artifactId>
+ <version>${doxiaSitetoolsVersion}</version>
+ </dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-site-renderer</artifactId>
@@ -125,14 +141,14 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>3.0.24</version>
+ <version>3.3.1</version>
</dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.2</version>
+ <version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -162,6 +178,8 @@
<properties>
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
+ <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting with Central -->
+ <https.protocols>${https.protocols}</https.protocols>
</properties>
</configuration>
<executions>
@@ -193,39 +211,5 @@
</plugins>
</reporting>
</profile>
-
- <profile>
- <id>jigsaw</id>
- <activation>
- <jdk>[9,)</jdk>
- </activation>
- <pluginRepositories>
- <pluginRepository>
- <id>oss-jfrog</id>
- <url>https://oss.jfrog.org/oss-snapshot-local/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</artifactId>
- <version>2.4.8-SNAPSHOT</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
</project>
=====================================
src/it/setup-reporting-plugin/pom.xml
=====================================
@@ -46,26 +46,26 @@ under the License.
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
- <version>3.0</version>
+ <version>@reportingApiVersion@</version>
</dependency>
<!-- plugin API and plugin-tools -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
- <version>3.0.5</version>
+ <version>@mavenVersion@</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
- <version>3.3</version>
+ <version>3.6.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
- <version>0.7</version>
+ <version>3.3.4</version>
</dependency>
</dependencies>
@@ -82,7 +82,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
- <version>3.3</version>
+ <version>3.6.4</version>
<executions>
<execution>
<id>default-descriptor</id>
@@ -93,44 +93,9 @@ under the License.
<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>
=====================================
src/it/use-as-site-report/pom.xml
=====================================
@@ -37,7 +37,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.4</version>
+ <version>3.11.0</version>
</plugin>
</plugins>
</build>
@@ -47,7 +47,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.7</version>
+ <version>3.4.0</version>
<reportSets>
<reportSet>
<reports>
=====================================
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
=====================================
@@ -19,6 +19,8 @@ package org.apache.maven.reporting;
* under the License.
*/
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkFactory;
import org.apache.maven.doxia.site.decoration.DecorationModel;
@@ -27,21 +29,25 @@ import org.apache.maven.doxia.siterenderer.RendererException;
import org.apache.maven.doxia.siterenderer.RenderingContext;
import org.apache.maven.doxia.siterenderer.SiteRenderingContext;
import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
+import org.apache.maven.doxia.tools.SiteTool;
+import org.apache.maven.doxia.tools.SiteToolException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.utils.WriterFactory;
-import org.apache.maven.shared.utils.io.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.HashMap;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -55,7 +61,6 @@ import java.util.Map;
* </ul>
*
* @author <a href="evenisse at apache.org">Emmanuel Venisse</a>
- * @version $Id: AbstractMavenReport.java 1777736 2017-01-06 23:54:39Z michaelo $
* @since 2.0
* @see #execute() <code>Mojo.execute()</code>, from maven-plugin-api
* @see #generate(Sink, SinkFactory, Locale) <code>MavenMultiPageReport.generate( Sink, SinkFactory, Locale )</code>,
@@ -92,6 +97,24 @@ public abstract class AbstractMavenReport
@Parameter( property = "outputEncoding", defaultValue = "${project.reporting.outputEncoding}", readonly = true )
private String outputEncoding;
+ /**
+ * The local repository.
+ */
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
+ protected ArtifactRepository localRepository;
+
+ /**
+ * Remote repositories used for the project.
+ */
+ @Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true, required = true )
+ protected List<ArtifactRepository> remoteRepositories;
+
+ /**
+ * SiteTool.
+ */
+ @Component
+ protected SiteTool siteTool;
+
/**
* Doxia Site Renderer component.
*/
@@ -111,9 +134,9 @@ public abstract class AbstractMavenReport
* This method is called when the report generation is invoked directly as a standalone Mojo.
*
* @throws MojoExecutionException if an error occurs when generating the report
- * @see org.apache.maven.plugins.site.ReportDocumentRender
* @see org.apache.maven.plugin.Mojo#execute()
*/
+ @Override
public void execute()
throws MojoExecutionException
{
@@ -122,24 +145,23 @@ public abstract class AbstractMavenReport
return;
}
- Writer writer = null;
- try
- {
- File outputDirectory = new File( getOutputDirectory() );
+ File outputDirectory = new File( getOutputDirectory() );
+
+ String filename = getOutputName() + ".html";
- String filename = getOutputName() + ".html";
+ Locale locale = Locale.getDefault();
- Locale locale = Locale.getDefault();
+ try
+ {
+ SiteRenderingContext siteContext = createSiteRenderingContext( locale );
- SiteRenderingContext siteContext = new SiteRenderingContext();
- siteContext.setDecoration( new DecorationModel() );
- siteContext.setTemplateName( "org/apache/maven/doxia/siterenderer/resources/default-site.vm" );
- siteContext.setLocale( locale );
- siteContext.setTemplateProperties( getTemplateProperties() );
+ // copy resources
+ getSiteRenderer().copyResources( siteContext, outputDirectory );
- RenderingContext context = new RenderingContext( outputDirectory, filename );
+ // TODO Replace null with real value
+ RenderingContext docRenderingContext = new RenderingContext( outputDirectory, filename, null );
- SiteRendererSink sink = new SiteRendererSink( context );
+ SiteRendererSink sink = new SiteRendererSink( docRenderingContext );
generate( sink, null, locale );
@@ -147,45 +169,33 @@ public abstract class AbstractMavenReport
{
outputDirectory.mkdirs();
- writer =
- new OutputStreamWriter( new FileOutputStream( new File( outputDirectory, filename ) ),
- getOutputEncoding() );
-
- getSiteRenderer().generateDocument( writer, sink, siteContext );
-
- //getSiteRenderer().copyResources( siteContext, new File( project.getBasedir(), "src/site/resources" ),
- // outputDirectory );
+ try ( Writer writer =
+ new OutputStreamWriter( new FileOutputStream( new File( outputDirectory, filename ) ),
+ getOutputEncoding() ) )
+ {
+ // render report
+ getSiteRenderer().mergeDocumentIntoSite( writer, sink, siteContext );
+ }
}
+
+ // copy generated resources also
+ getSiteRenderer().copyResources( siteContext, outputDirectory );
}
- catch ( RendererException e )
- {
- throw new MojoExecutionException(
- "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation.", e );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException(
- "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation.", e );
- }
- catch ( MavenReportException e )
+ catch ( RendererException | IOException | MavenReportException e )
{
throw new MojoExecutionException(
"An error has occurred in " + getName( Locale.ENGLISH ) + " report generation.", e );
}
- finally
- {
- IOUtil.close( writer );
- }
}
- /**
- * create template properties like done in maven-site-plugin's
- * <code>AbstractSiteRenderingMojo.createSiteRenderingContext( Locale )</code>
- * @return properties
- */
- private Map<String, Object> getTemplateProperties()
+ private SiteRenderingContext createSiteRenderingContext( Locale locale )
+ throws MavenReportException, IOException
{
- Map<String, Object> templateProperties = new HashMap<String, Object>();
+ DecorationModel decorationModel = new DecorationModel();
+
+ Map<String, Object> templateProperties = new HashMap<>();
+ // We tell the skin that we are rendering in standalone mode
+ templateProperties.put( "standalone", Boolean.TRUE );
templateProperties.put( "project", getProject() );
templateProperties.put( "inputEncoding", getInputEncoding() );
templateProperties.put( "outputEncoding", getOutputEncoding() );
@@ -194,7 +204,32 @@ public abstract class AbstractMavenReport
{
templateProperties.put( (String) entry.getKey(), entry.getValue() );
}
- return templateProperties;
+
+ SiteRenderingContext context;
+ try
+ {
+ Artifact skinArtifact =
+ siteTool.getSkinArtifactFromRepository( localRepository, remoteRepositories, decorationModel );
+
+ getLog().info( buffer().a( "Rendering content with " ).strong( skinArtifact.getId()
+ + " skin" ).a( '.' ).toString() );
+
+ context = siteRenderer.createContextForSkin( skinArtifact, templateProperties, decorationModel,
+ project.getName(), locale );
+ }
+ catch ( SiteToolException e )
+ {
+ throw new MavenReportException( "Failed to retrieve skin artifact", e );
+ }
+ catch ( RendererException e )
+ {
+ throw new MavenReportException( "Failed to create context for skin", e );
+ }
+
+ // Generate static site
+ context.setRootDirectory( project.getBasedir() );
+
+ return context;
}
/**
@@ -205,6 +240,8 @@ public abstract class AbstractMavenReport
* @throws MavenReportException if any
* @deprecated use {@link #generate(Sink, SinkFactory, Locale)} instead.
*/
+ @Deprecated
+ @Override
public void generate( org.codehaus.doxia.sink.Sink sink, Locale locale )
throws MavenReportException
{
@@ -217,9 +254,9 @@ public abstract class AbstractMavenReport
* @param sink
* @param locale
* @throws MavenReportException
- * @see org.apache.maven.reporting.MavenReport#generate(org.apache.maven.doxia.sink.Sink, java.util.Locale)
* @deprecated use {@link #generate(Sink, SinkFactory, Locale)} instead.
*/
+ @Deprecated
public void generate( Sink sink, Locale locale )
throws MavenReportException
{
@@ -234,6 +271,7 @@ public abstract class AbstractMavenReport
* @param locale
* @throws MavenReportException
*/
+ @Override
public void generate( Sink sink, SinkFactory sinkFactory, Locale locale )
throws MavenReportException
{
@@ -254,15 +292,15 @@ public abstract class AbstractMavenReport
}
/**
- * {@inheritDoc}
* @return CATEGORY_PROJECT_REPORTS
*/
+ @Override
public String getCategoryName()
{
return CATEGORY_PROJECT_REPORTS;
}
- /** {@inheritDoc} */
+ @Override
public File getReportOutputDirectory()
{
if ( reportOutputDirectory == null )
@@ -273,7 +311,7 @@ public abstract class AbstractMavenReport
return reportOutputDirectory;
}
- /** {@inheritDoc} */
+ @Override
public void setReportOutputDirectory( File reportOutputDirectory )
{
this.reportOutputDirectory = reportOutputDirectory;
@@ -341,14 +379,15 @@ public abstract class AbstractMavenReport
/**
* @see org.apache.maven.reporting.MavenReport#isExternalReport()
- * @return <tt>false</tt> by default.
+ * @return {@code false} by default.
*/
+ @Override
public boolean isExternalReport()
{
return false;
}
- /** {@inheritDoc} */
+ @Override
public boolean canGenerateReport()
{
return true;
=====================================
src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
=====================================
@@ -20,6 +20,7 @@ package org.apache.maven.reporting;
*/
import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
import org.apache.maven.doxia.util.HtmlTools;
import org.apache.maven.shared.utils.StringUtils;
@@ -32,17 +33,17 @@ import java.util.Map;
import java.util.Properties;
/**
- * An abstract class to manage report generation, with many helper methods to ease the job: you just need to
- * implement getTitle() and renderBody().
+ * <p>An abstract class to manage report generation, with many helper methods to ease the job: you just need to
+ * implement getTitle() and renderBody().</p>
+ *
+ * <p><strong>TODO</strong> Later it may be appropriate to create something like a VelocityMavenReportRenderer
+ * that could take a velocity template and pipe that through Doxia rather than coding them
+ * up like this.</p>
*
* @author <a href="mailto:jason at maven.org">Jason van Zyl</a>
* @author <a href="evenisse at apache.org">Emmanuel Venisse</a>
* @author <a href="mailto:vincent.siveton at gmail.com">Vincent Siveton</a>
- * @version $Id: AbstractMavenReportRenderer.java 1781702 2017-02-04 20:15:14Z michaelo $
* @since 2.0
- * @TODO Later it may be appropriate to create something like a VelocityMavenReportRenderer
- * that could take a velocity template and pipe that through Doxia rather than coding them
- * up like this.
* @see #getTitle()
* @see #renderBody()
*/
@@ -66,6 +67,7 @@ public abstract class AbstractMavenReportRenderer
}
/** {@inheritDoc} */
+ @Override
public void render()
{
sink.head();
@@ -179,7 +181,7 @@ public abstract class AbstractMavenReportRenderer
* @see Sink#section3_()
* @see Sink#section4_()
* @see Sink#section5_()
- * @IllegalStateException if too many closing sections.
+ * @throws IllegalStateException if too many closing sections.
*/
protected void endSection()
{
@@ -291,7 +293,7 @@ public abstract class AbstractMavenReportRenderer
* <p>If <code>asHtml</code> is true, add the text as Html</p>
*
* @param text the text to put in this cell, could be null.
- * @param asHtml <tt>true</tt> to add the text as Html, <tt>false</tt> otherwise.
+ * @param asHtml {@code true} to add the text as Html, {@code false} otherwise.
* @see #linkPatternedText(String)
* @see Sink#tableCell()
* @see Sink#tableCell_()
@@ -445,7 +447,7 @@ public abstract class AbstractMavenReportRenderer
*/
protected void verbatimText( String text )
{
- sink.verbatim( true );
+ sink.verbatim( SinkEventAttributeSet.BOXED );
text( text );
@@ -470,7 +472,7 @@ public abstract class AbstractMavenReportRenderer
}
else
{
- sink.verbatim( true );
+ sink.verbatim( SinkEventAttributeSet.BOXED );
link( href, text );
@@ -606,7 +608,7 @@ public abstract class AbstractMavenReportRenderer
// Map defined by key/value name/href
// If href == null, it means
- List<String> segments = new ArrayList<String>();
+ List<String> segments = new ArrayList<>();
// TODO Special case http://jira.codehaus.org/browse/MEV-40
if ( text.indexOf( "${" ) != -1 )
@@ -725,7 +727,7 @@ public abstract class AbstractMavenReportRenderer
// Abstract methods
// ----------------------------------------------------------------------
- /** {@inheritDoc} */
+ @Override
public abstract String getTitle();
/**
=====================================
src/site/apt/index.apt.vm
=====================================
@@ -45,15 +45,6 @@ ${project.name}
* History
-** Inclusion in Maven core
-
- Until Maven 2.0.4, <<<maven-reporting-impl>>> was included in Maven 2 core distribution: version
- used was completely driven by Maven version used.
-
- The module was removed from Maven core starting with Maven 2.0.5 and
- moved to shared components to improve fexibility: starting with Maven 2.0.5, each plugin can choose its
- <<<maven-reporting-impl>>> version independently from Maven.
-
** Doxia runtime
When used as a direct standalone goal invocation, Doxia implementation used is the version used during plugin compilation.
@@ -65,8 +56,6 @@ ${project.name}
** Doxia dependency
- <<<maven-reporting-impl 2.0.x>>> use Doxia 1.0, then is used for reporting plugins wanting Maven 2.0.x compatibility.
-
From <<<maven-reporting-impl 2.1>>> to <<<maven-reporting-impl 2.3>>>, Doxia version used ranges from 1.1 to 1.4.
When creating a reporting plugin using one of these <<<maven-reporting-impl>>> versions,
take care to use corresponding <<<doxia-sink-api>>>:
=====================================
src/site/xdoc/download.xml.vm
=====================================
@@ -34,7 +34,7 @@ under the License.
<p>In order to guard against corrupted downloads/installations, it is highly recommended to
<a href="http://www.apache.org/dev/release-signing#verifying-signature">verify the signature</a>
- of the release bundles against the public <a href="http://www.apache.org/dist/maven/KEYS">KEYS</a> used by the Apache Maven
+ of the release bundles against the public <a href="https://www.apache.org/dist/maven/KEYS">KEYS</a> used by the Apache Maven
developers.</p>
<p>${project.name} is distributed under the <a href="http://www.apache.org/licenses/">Apache License, version 2.0</a>.</p>
@@ -108,8 +108,8 @@ under the License.
<tr>
<td>${project.name} ${project.version} (Source zip)</td>
<td><a href="[preferred]maven/reporting/${project.artifactId}-${project.version}-source-release.zip">maven/reporting/${project.artifactId}-${project.version}-source-release.zip</a></td>
- <td><a href="http://www.apache.org/dist/maven/reporting/${project.artifactId}-${project.version}-source-release.zip.md5">maven/reporting/${project.artifactId}-${project.version}-source-release.zip.md5</a></td>
- <td><a href="http://www.apache.org/dist/maven/reporting/${project.artifactId}-${project.version}-source-release.zip.asc">maven/reporting/${project.artifactId}-${project.version}-source-release.zip.asc</a></td>
+ <td><a href="https://www.apache.org/dist/maven/reporting/${project.artifactId}-${project.version}-source-release.zip.sha512">maven/reporting/${project.artifactId}-${project.version}-source-release.zip.sha512</a></td>
+ <td><a href="https://www.apache.org/dist/maven/reporting/${project.artifactId}-${project.version}-source-release.zip.asc">maven/reporting/${project.artifactId}-${project.version}-source-release.zip.asc</a></td>
</tr>
</tbody>
</table>
View it on GitLab: https://salsa.debian.org/java-team/maven-reporting-impl/-/compare/72d6f2245e487f6d47733eb5af7f1eb0af1b76a1...7fa2e031a22623201fe96429da0c47eeed309748
--
View it on GitLab: https://salsa.debian.org/java-team/maven-reporting-impl/-/compare/72d6f2245e487f6d47733eb5af7f1eb0af1b76a1...7fa2e031a22623201fe96429da0c47eeed309748
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20230109/841ac14d/attachment.htm>
More information about the pkg-java-commits
mailing list