title: Spring security core and spring security crypto maven artifacts (duplicate classes)
body: <p>I'm building a self-contained jar with the maven shade plugin (an uberjar) and I get warnings for all the spring-security-crypto classes:</p>
  
  <pre><code>[WARNING] We have a duplicate org/springframework/security/crypto/bcrypt/BCrypt.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  [WARNING] We have a duplicate org/springframework/security/crypto/bcrypt/BCryptPasswordEncoder.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  [WARNING] We have a duplicate org/springframework/security/crypto/codec/Base64.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  [WARNING] We have a duplicate org/springframework/security/crypto/codec/Hex.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  [WARNING] We have a duplicate org/springframework/security/crypto/codec/InvalidBase64CharacterException.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  [WARNING] We have a duplicate org/springframework/security/crypto/codec/package-info.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  [WARNING] We have a duplicate org/springframework/security/crypto/codec/Utf8.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  [WARNING] We have a duplicate org/springframework/security/crypto/encrypt/AesBytesEncryptor$1.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  [WARNING] We have a duplicate org/springframework/security/crypto/encrypt/AesBytesEncryptor.class in ***\.m2\repository\org\springframework\security\spring-security-crypto\3.1.0.RELEASE\spring-security-crypto-3.1.0.RELEASE.jar
  ...
  </code></pre>
  
  <p>I looked into the spring-security-core jar and saw that it contains all the classes spring-security-crypto contains. Furthermore upon comparing the sources you see they are the same.</p>
  
  <p>I know I can ignore it since the classes are the same but:</p>
  
  <ol>
  <li>This can change if the classes in spring-security-core don't get updated.  </li>
  <li>More importantly I don't understand why this is happening? It is important to note that spring-security-core itself has a compile dependency on spring-security-crypto which totally baffles me.  </li>
  </ol>
  
  <p>Would love any explanation and solution that are out there.</p>