Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent version clashes with aggregate goal when plugins use jackson #1329

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion pitest-aggregator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,39 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.fasterxml.jackson.dataformat:*</include>
<include>com.fasterxml.jackson.core:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>pitest.fasterxml.jackson</shadedPattern>
</relocation>
</relocations>
<!-- gradle scans the multi release jar includes with a potentially old version of ASM. Easiest to exclude.
This works for jackson, should be rechecked when including any off multi release dependencies-->
<exclude>META-INF/versions/**</exclude>
</configuration>
</execution>
</executions>
</plugin>
<!-- must run after shade -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>
Expand All @@ -29,7 +62,7 @@
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.16.2</version>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ protected void executeReport(final Locale locale)
try {
final Collection<MavenProject> allProjects = findDependencies();

if (allProjects.isEmpty()) {
throw new IllegalStateException("No projects found. Did you call the aggregate goal directly? It must be bound to a lifecycle phase");
}

final ReportAggregator.Builder reportAggregationBuilder = ReportAggregator
.builder();

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.5.3</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
Loading