jira-importer opened a new issue, #282: URL: https://github.com/apache/maven-build-cache-extension/issues/282
**[Maximilian Novikov](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=maximiln)** opened **[MBUILDCACHE-35](https://issues.apache.org/jira/browse/MBUILDCACHE-35?redirect=false)** and commented Original reporter: spirin.an...@gmail.com There is an issue with maven incremental build if module uses maven-shade plugin. If user executes mvnw clean install command and module is not changed then wrong pom file will be put into local maven repository and it will break module dependencies. Steps to reproduce: 1. create a module with dependencies and with maven-shade plugin (see below) 2. build module using incremental build: mvnw clean install (install command is required to put artifact into local maven repo) 3. change something in module to trigger incremental build (for instance some symbols here \<exclude>META-INF/test-run-01.txt\</exclude>) 4. build module again: mvnw clean install 5. check that local repo has correct dependency reduced pom (ie pom file loaded into the repo does not have dependencies org.apache.commons:commons-lang3) ```java [devbox ~/.m2/repository/com/db/test/mvnbuild/mvnbuild-test/1.0]$ ll -rw-r--r--. 1 devbox users 716 Dec 13 09:49 maven-metadata-local.xml -rw-r--r--. 1 devbox users 584570 Dec 13 09:49 mvnbuild-test-1.0.jar -rw-r--r--. 1 devbox users 1512 Dec 13 09:49 mvnbuild-test-1.0.pom -rw-r--r--. 1 devbox users 208 Dec 13 09:49 _remote.repositories [devbox ~/.m2/repository/com/db/test/mvnbuild/mvnbuild-test/1.0]$ less mvnbuild-test-1.0.pom ``` 1. do not change module and build it again: mvnw clean install **Expected:** local repositiry should have dependency reduced pom **Actual:** local repo has a pom file taken from source code ie with all dependencies As a result in class path there will be duplicated set of class files: 1. from shaded module 2. due to this defect from org.apache.commons:commons-lang3 **Original POM** ```java <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>com.db.test.mvnbuild</groupId> <artifactId>mvnbuild-test</artifactId> <version>1.0</version> <packaging>jar</packaging> <name>MvnTest</name> <dependencies> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.11</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.4.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <createDependencyReducedPom>true</createDependencyReducedPom> <artifactSet> <includes> <include>org.apache.commons:commons-lang3</include> </includes> </artifactSet> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/test-run-01.txt</exclude> </excludes> </filter> </filters> </configuration> </plugin> </plugins> </build> </project> ``` **Dependency reduced POM** ```java <?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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.db.test.mvnbuild</groupId> <artifactId>mvnbuild-test</artifactId> <name>MvnTest</name> <version>1.0</version> <build> <plugins> <plugin> <artifactId>maven-shade-plugin</artifactId> <version>3.4.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <createDependencyReducedPom>true</createDependencyReducedPom> <artifactSet> <includes> <include>org.apache.commons:commons-lang3</include> </includes> </artifactSet> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/test-run-01.txt</exclude> </excludes> </filter> </filters> </configuration> </plugin> </plugins> </build> </project> ``` --- No further details from [MBUILDCACHE-35](https://issues.apache.org/jira/browse/MBUILDCACHE-35?redirect=false) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org