1

I try start ProGuard on Spring Boot App And get error:

  [proguard] Reading library jar [C:\Program Files\Java\jdk1.8.0_151\jre\lib\rt.jar]
     [proguard] Note: duplicate definition of library class [javax.annotation.Generated]
     [proguard] Note: duplicate definition of library class [javax.annotation.PostConstruct]
     [proguard] Note: duplicate definition of library class [javax.annotation.PreDestroy]
     [proguard] Note: duplicate definition of library class [javax.annotation.Resource$AuthenticationType]
     [proguard] Note: duplicate definition of library class [javax.annotation.Resource]
     [proguard] Note: duplicate definition of library class [javax.annotation.Resources]
     [proguard] Note: there were 8 duplicate class definitions.
     [proguard]       (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
     [proguard] Warning: there were 2 classes in incorrectly named files.
     [proguard]          You should make sure all file names correspond to their class names.
     [proguard]          The directory hierarchies must correspond to the package hierarchies.
     [proguard]          (http://proguard.sourceforge.net/manual/troubleshooting.html#unexpectedclass)
     [proguard]          If you don't mind the mentioned classes not being written out,
     [proguard]          you could try your luck using the '-ignorewarnings' option.
     [proguard] Error: Please correct the above warnings first.

Why I get this error and how can I fix it?

ip696
  • 6,574
  • 12
  • 65
  • 128

2 Answers2

1

You could do the following to get rid of the situation:

  1. If you add a proguard option -printconfiguration configuration.txt you will see all the proguard adds.
  2. Based on what you receive from the step above, you could correct the same

OR

You could use the following option to stop seeing these warning messages: Documentation here

-dontwarn javax.annotation.*
-dontnote javax.annotation.*

Please take a look at this question for more details on the situation that you're facing right now.

N00b Pr0grammer
  • 4,503
  • 5
  • 32
  • 46
0

try ignore class -dontnote javax.annotation.*

and read more: https://www.guardsquare.com/en/products/proguard/manual/troubleshooting#duplicateclass

Piotr Rogowski
  • 3,642
  • 19
  • 24