micronaut-starter icon indicating copy to clipboard operation
micronaut-starter copied to clipboard

maven-shade-plugin warnings with default settings

Open OLEGSHA opened this issue 1 year ago • 0 comments

Description

A project generated with Maven as build system and all other settings default generates warning messages when running mvn package. Warnings should be resolved or suppressed. This may confuse beginners when they package their first project, as they are likely to assume it is their fault.

Task List

  • [x] Steps to reproduce provided
  • [x] Stacktrace (if present) provided
  • [x] Example that reproduces the problem uploaded to Github
  • [x] Full description of the issue provided (see below)

Steps to Reproduce

  1. Go to Micronaut Launch website.
  2. Select Maven as Build Tool, leave other settings default.
  3. Generate project, download as ZIP, unzip into a directory.
  4. In project directory, run ./mvnw package.
  5. Notice multiple [WARNING] messages in output.

Expected Behaviour

A shaded JAR is created, no warnings appear.

Actual Behaviour

A shaded JAR is created, however, there are warning messages in output. Full output included into example repository (stdout.txt). Main notice:

[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/

Environment Information

  • Operating System: Linux [hostname] 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
  • Micronaut Version: 3.8.7
  • JDK Version: OpenJDK 64-Bit Server VM (build 11.0.18+10-post-Debian-1deb11u1, mixed mode, sharing)

Example Application

https://github.com/OLEGSHA/micronaut-starter-issue-example (Please let me know when it's okay to delete this repository.)

OLEGSHA avatar Mar 17 '23 11:03 OLEGSHA