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

Plugin does not check resource include/exclude when doing conflict-detection with source roots in package-lib #138

Closed
foal opened this issue May 10, 2020 · 2 comments

Comments

@foal
Copy link

foal commented May 10, 2020

I have a project that copies license from project root to the META-INF folder by maven-resource-plugin. The configuration is the same as described in this question https://stackoverflow.com/questions/28619630/copy-a-resource-file-with-maven-located-at-the-root-of-the-project.

But it caused the following warning

build	10-May-2020 19:00:16	[INFO] --- gwt-maven-plugin:1.0.0:package-lib (default-package-lib) @ org.jresearch.gwt.time ---
build	10-May-2020 19:00:16	[WARNING] Conflicting path between source folder (/var/atlassian/application-data/bamboo/xml-data/build-dir/GWT-GWTTIM-JOB1/src/main/java/, to be added as resource) and resource (/var/atlassian/application-data/bamboo/xml-data/build-dir/GWT-GWTTIM-JOB1/); skipping.
build	10-May-2020 19:00:16	[WARNING] Conflicting path between source folder (/var/atlassian/application-data/bamboo/xml-data/build-dir/GWT-GWTTIM-JOB1/target/generated-sources/annotations/, to be added as resource) and resource (/var/atlassian/application-data/bamboo/xml-data/build-dir/GWT-GWTTIM-JOB1/); skipping.
build	10-May-2020 19:00:16	[INFO] Building jar: /var/atlassian/application-data/bamboo/xml-data/build-dir/GWT-GWTTIM-JOB1/target/org.jresearch.gwt.time-1.4.8-SNAPSHOT.jar

and so no sources in produced JAR.

@tbroyer
Copy link
Owner

tbroyer commented May 11, 2020

This is by design to keep things simple (in the plugin). The goal is to make simple things easy and more complex things possible, so the plugin bails out on any kind of possible conflict and let's you fix it:

  • either move your file to a subfolder that won't contain your sources (or even better, right into src/main/resources/META-INF/ so you don't even need any kind of configuration)
  • or manually declare your source folders as resources (the plugin will then print [INFO] …/src/main/java already added as a resource folder; skipping.)
  • or use copy-resources to copy the license file rather than declaring the project.basedir as a resource folder.
  • or in this specific case, use the license-maven-plugin's update-project-license to automatically keep the ${project.basedir}/LICENSE.txt file up-to-date and put it into the JAR's META-INF/.

That being said, if you think this can easily be implemented, I'll be happy to review a PR.

@tbroyer tbroyer changed the title Plugin does not respect resource include/exclude Plugin does not check resource include/exclude when doing conflict-detection with source roots in package-lib May 11, 2020
@foal
Copy link
Author

foal commented May 11, 2020

Thank you! copy-resources and license:update-project-license looks reasonable.

@foal foal closed this as completed May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants