Skip to content

Commit

Permalink
Merge pull request #1038 from l0s/1037_maven-site-4.x
Browse files Browse the repository at this point in the history
Support Maven Site Plugin 3.12.0+
  • Loading branch information
hcoles committed Jun 22, 2022
2 parents 37152be + c40f054 commit 2f11641
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 33 deletions.
11 changes: 10 additions & 1 deletion pitest-maven-verification/pom.xml
Expand Up @@ -59,7 +59,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -107,4 +107,13 @@
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.6</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Expand Up @@ -13,7 +13,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
Expand Up @@ -13,7 +13,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
Expand Up @@ -13,7 +13,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
Expand Up @@ -13,7 +13,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
Expand Up @@ -20,7 +20,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
Expand Up @@ -13,7 +13,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
Expand Up @@ -13,7 +13,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
59 changes: 45 additions & 14 deletions pitest-maven/pom.xml
Expand Up @@ -46,7 +46,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5</version>
<version>3.6.4</version>
<executions>
<execution>
<id>default-descriptor</id>
Expand Down Expand Up @@ -82,18 +82,19 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
<version>3.8.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<version>3.6.4</version>
<scope>provided</scope><!-- annotations are needed only to build the plugin -->
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>${maven.version}</version>
<version>3.1.0</version>
</dependency>
<!-- commons-collections, commons-beanutils, and plexus-utils specified
due to vulnerable versions used by maven-reporting-impl:2.0.4.3-->
Expand All @@ -110,18 +111,18 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>2.0.4.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${maven.version}</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
Expand Down Expand Up @@ -159,12 +160,14 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
<version>3.8.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-toolchain</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -185,15 +188,43 @@

<!-- test dependencies -->
<dependency>
<groupId>org.apache.maven.shared</groupId>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>1.1</version>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.8.6</version>
<scope>test</scope>
</dependency>

</dependencies>

<properties>
<scm.version>1.9.4</scm.version>
<surefire.version>3.0.0-M7</surefire.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interpolation</artifactId>
<version>1.21</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Expand Up @@ -14,6 +14,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -61,8 +62,8 @@ protected void executeReport(final Locale locale)
}

final ReportAggregator reportAggregator = reportAggregationBuilder
.inputCharSet(this.getInputEncoding())
.outputCharset(this.getOutputEncoding())
.inputCharSet(Charset.forName(this.getInputEncoding()))
.outputCharset(Charset.forName(this.getOutputEncoding()))
.resultOutputStrategy(new DirectoryResultOutputStrategy(
getReportsDirectory().getAbsolutePath(),
new UndatedReportDirCreationStrategy()))
Expand Down
Expand Up @@ -185,18 +185,18 @@ public List<String> getSourceDataFormats() {
return this.sourceDataFormats;
}

public Charset getInputEncoding() {
public String getInputEncoding() {
if (inputEncoding != null) {
return Charset.forName(inputEncoding);
return inputEncoding;
}
return Charset.defaultCharset();
return Charset.defaultCharset().name();
}

public Charset getOutputEncoding() {
public String getOutputEncoding() {
if (outputEncoding != null) {
return Charset.forName(outputEncoding);
return outputEncoding;
}
return Charset.defaultCharset();
return Charset.defaultCharset().name();
}

private ReportGenerationContext buildReportGenerationContext(Locale locale) {
Expand Down
Expand Up @@ -14,7 +14,7 @@
*/
package org.pitest.maven.report;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.verify;
Expand Down Expand Up @@ -93,7 +93,7 @@ public void testGenerateReport() throws Exception {
assertThat(actualContext.getReportsDataDirectory(),
sameInstance(this.reportsDirectory));
assertThat(actualContext.getSink(), sameInstance(this.sink));
assertThat(actualContext.getSiteDirectory().getPath(), is("abspath"
assertThat(actualContext.getSiteDirectory().getPath(), endsWith("abspath"
+ File.separator + "pit-reports"));
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -403,7 +403,7 @@
<junit.version>4.11</junit.version>
<maven.version>2.2.1</maven.version>
<powermock.version>1.7.3</powermock.version>
<surefire.version>2.17</surefire.version>
<surefire.version>2.18.1</surefire.version> <!-- [2.19, 3.0.0-M7] seem to cause ASM-related test failures -->
<slf4j.version>1.7.12</slf4j.version>

<maven.failsafe-plugin.version>${surefire.version}</maven.failsafe-plugin.version>
Expand Down

0 comments on commit 2f11641

Please sign in to comment.