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

Exclusion patterns are ignored during a multi module reactor build #17

Closed
jakub-bochenski opened this issue Aug 3, 2015 · 1 comment
Labels

Comments

@jakub-bochenski
Copy link

In one project I have:

                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-test-jar</id>
                        <configuration>
                            <excludes>
                                <exclude>**/applicationContext.xml</exclude>
                            </excludes>
                        </configuration>
                    </execution>

Then when:

  • I use the tests jar in another project,
  • both projects are build in the same run (multi module build)
  • the other project also has an applicationContext.xml file in it's test resources directory

I get the following reported:

  [WARNING] Found duplicate and different resources in [/home/jenkins/workspace/Acme_Job/acme/module/common_pod/build/testClasses, com.acme:common_platform:0.0.1-SNAPSHOT:jar:tests]:
  [WARNING] applicationContext.xml

Note: I did double-check that the tests-jar does NOT have the applicationContext.xml
When I build the projects separately, and not in the same reactor, the warning does NOT appear.

@hgschmie
Copy link
Contributor

The duplicate-finder is not aware that you exclude this file from the jar build (and short of interpreting the exclusion rules of the jar build, it will not be possible to do so). So in the reactor build, it will look at the contents of src/test/resources and find the file and flag it as a duplicate.

This is a limitation because of the way the plugin works. The preferLocal option might solve this for you (it was introduced in 1.1.1), using <preferLocal>false</preferLocal> will force the plugin to use the built artifacts, not the contents of the local filesystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants