You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (Jira)" <ji...@apache.org> on 2021/01/08 16:28:00 UTC
[jira] [Issue Comment Deleted] (MNG-7063) Infinite loop using Shade
plugin and JUnit 5 dependency
[ https://issues.apache.org/jira/browse/MNG-7063?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Scholte updated MNG-7063:
--------------------------------
Comment: was deleted
(was: Most likely cause is a change in the DefaultProjectBuilder.java:
{noformat}
project.setModel( model );
- project.setOriginalModel( result.getRawModel() );
- project.setFile( model.getPomFile() );
+ project.setOriginalModel( result.getFileModel() );
{noformat}
The maven-shade-plugin is modifying the dependencies by adding exclusions, but these exclusions are added to the wrong model.
So the fact that the model is not immutable exposes an issue here.
I need to test the impact if the originalModel uses the rawModel again.)
> Infinite loop using Shade plugin and JUnit 5 dependency
> -------------------------------------------------------
>
> Key: MNG-7063
> URL: https://issues.apache.org/jira/browse/MNG-7063
> Project: Maven
> Issue Type: Bug
> Affects Versions: 4.0.0-alpha-1
> Reporter: Thiago Henrique Hupner
> Assignee: Robert Scholte
> Priority: Major
>
> When trying my project with Maven 4.0.0, it got in an infinite loop.
> I've figured out that adding the JUnit 5 dependency and using the Shade plugin transformer causes the problem.
> With Maven 3.6.3 this problem doesn't happen.
>
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <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.example</groupId>
> <artifactId>maven-bug</artifactId>
> <version>1.0-SNAPSHOT</version>
> <properties>
> <maven.compiler.source>8</maven.compiler.source>
> <maven.compiler.target>8</maven.compiler.target>
> </properties>
> <packaging>jar</packaging>
> <dependencies>
> <dependency>
> <groupId>com.google.guava</groupId>
> <artifactId>guava</artifactId>
> <version>29.0-jre</version>
> </dependency>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-api</artifactId>
> <version>5.7.0</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-shade-plugin</artifactId>
> <version>3.2.4</version>
> <executions>
> <execution>
> <phase>package</phase>
> <goals>
> <goal>shade</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> </project>
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)