title: Maven Shading Multi-Module Aggregation and Inheritance
body: <h2>Context</h2>
  
  <p>I have an IntelliJ project with multiple modules. I am using the maven-shade-plugin to jar with dependencies whilst reducing jar size. The project structure is as follows;</p>
  
  <ul>
  <li>top-level parent (pom) (aggregates api and world-teleport)
  
  <ul>
  <li>api (inherits parent)</li>
  <li>world-teleport (inherits parent, api)</li>
  </ul></li>
  </ul>
  
  <hr>
  
  <h2>Pom(s)</h2>
  
  <p>Parent</p>
  
  <pre class="lang-xml prettyprint-override"><code>   &lt;groupId&gt;com.jsonmack&lt;/groupId&gt;
      &lt;artifactId&gt;mcplugins&lt;/artifactId&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;version&gt;1.10-SNAPSHOT&lt;/version&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;spigot-repo&lt;/id&gt;
              &lt;url&gt;https://hub.spigotmc.org/nexus/content/repositories/snapshots/&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;modules&gt;
          &lt;module&gt;api&lt;/module&gt;
          &lt;module&gt;world-teleport&lt;/module&gt;
      &lt;/modules&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
                  &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.2.2&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;shade&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;minimizeJar&gt;true&lt;/minimizeJar&gt;
                              &lt;artifactSet&gt;
                                  &lt;excludes&gt;
                                      &lt;exclude&gt;junit:junit&lt;/exclude&gt;
                                  &lt;/excludes&gt;
                              &lt;/artifactSet&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;io.github.classgraph&lt;/groupId&gt;
                  &lt;artifactId&gt;classgraph&lt;/artifactId&gt;
                  &lt;version&gt;4.8.68&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.spigotmc&lt;/groupId&gt;
                  &lt;artifactId&gt;spigot-api&lt;/artifactId&gt;
                  &lt;version&gt;1.15.2-R0.1-SNAPSHOT&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;junit&lt;/groupId&gt;
                  &lt;artifactId&gt;junit&lt;/artifactId&gt;
                  &lt;version&gt;4.13&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p>api</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;parent&gt;
          &lt;artifactId&gt;mcplugins&lt;/artifactId&gt;
          &lt;groupId&gt;com.jsonmack&lt;/groupId&gt;
          &lt;version&gt;1.10-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;artifactId&gt;api&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.github.classgraph&lt;/groupId&gt;
              &lt;artifactId&gt;classgraph&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.spigotmc&lt;/groupId&gt;
              &lt;artifactId&gt;spigot-api&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>world-teleport</p>
  
  <pre class="lang-xml prettyprint-override"><code>   &lt;parent&gt;
          &lt;groupId&gt;com.jsonmack&lt;/groupId&gt;
          &lt;artifactId&gt;mcplugins&lt;/artifactId&gt;
          &lt;version&gt;1.10-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.jsonmack&lt;/groupId&gt;
              &lt;artifactId&gt;api&lt;/artifactId&gt;
              &lt;version&gt;1.10-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.github.classgraph&lt;/groupId&gt;
              &lt;artifactId&gt;classgraph&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.spigotmc&lt;/groupId&gt;
              &lt;artifactId&gt;spigot-api&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <hr>
  
  <h2>The problem</h2>
  
  <p>Everytime I perform a clean and a new install or package it is indicated to me that there are duplicate dependencies.</p>
  
  <hr>
  
  <h2>The error/warning(s)</h2>
  
  <pre><code>[INFO] 
  [INFO] --------------------&lt; com.jsonmack:world_teleport &gt;---------------------
  [INFO] Building world_teleport 1.8-SNAPSHOT                               [7/7]
  [INFO] --------------------------------[ jar ]---------------------------------
  [INFO] 
  [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ world_teleport ---
  [INFO] Deleting /Users/Business/Documents/workspace/mcplugins/world_teleport/target
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ world_teleport ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 2 resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ world_teleport ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 19 source files to /Users/Business/Documents/workspace/mcplugins/world_teleport/target/classes
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ world_teleport ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory /Users/Business/Documents/workspace/mcplugins/world_teleport/src/test/resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ world_teleport ---
  [INFO] Changes detected - recompiling the module!
  [INFO] 
  [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ world_teleport ---
  [INFO] 
  [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ world_teleport ---
  [INFO] Building jar: /Users/Business/Documents/workspace/mcplugins/world_teleport/target/world_teleport-1.8-SNAPSHOT.jar
  [INFO] 
  [INFO] --- maven-shade-plugin:3.2.2:shade (default) @ world_teleport ---
  [INFO] Including com.jsonmack:api:jar:1.10-SNAPSHOT in the shaded jar.
  [INFO] Including io.github.classgraph:classgraph:jar:4.8.68 in the shaded jar.
  [INFO] Including org.spigotmc:spigot-api:jar:1.15.2-R0.1-SNAPSHOT in the shaded jar.
  [INFO] Including commons-lang:commons-lang:jar:2.6 in the shaded jar.
  [INFO] Including com.google.guava:guava:jar:21.0 in the shaded jar.
  [INFO] Including com.google.code.gson:gson:jar:2.8.0 in the shaded jar.
  [INFO] Including net.md-5:bungeecord-chat:jar:1.15-SNAPSHOT in the shaded jar.
  [INFO] Including org.yaml:snakeyaml:jar:1.25 in the shaded jar.
  [INFO] Minimizing jar com.jsonmack:world_teleport:jar:1.8-SNAPSHOT
  [WARNING] /Users/Business/Documents/workspace/mcplugins/world_teleport/target/classes (Is a directory)
  [WARNING] api-1.10-SNAPSHOT.jar, snakeyaml-1.25.jar define 207 overlapping classes and resources: 
  [WARNING]   - META-INF/maven/org.yaml/snakeyaml/pom.properties
  [WARNING]   - META-INF/maven/org.yaml/snakeyaml/pom.xml
  [WARNING]   - org.yaml.snakeyaml.DumperOptions
  [WARNING]   - org.yaml.snakeyaml.DumperOptions$FlowStyle
  [WARNING]   - org.yaml.snakeyaml.DumperOptions$LineBreak
  [WARNING]   - org.yaml.snakeyaml.DumperOptions$NonPrintableStyle
  [WARNING]   - org.yaml.snakeyaml.DumperOptions$ScalarStyle
  [WARNING]   - org.yaml.snakeyaml.DumperOptions$Version
  [WARNING]   - org.yaml.snakeyaml.LoaderOptions
  [WARNING]   - org.yaml.snakeyaml.TypeDescription
  [WARNING]   - 197 more...
  [WARNING] api-1.10-SNAPSHOT.jar, guava-21.0.jar define 931 overlapping classes and resources: 
  [WARNING]   - META-INF/maven/com.google.guava/guava/pom.properties
  [WARNING]   - META-INF/maven/com.google.guava/guava/pom.xml
  [WARNING]   - com.google.common.annotations.Beta
  [WARNING]   - com.google.common.annotations.GwtCompatible
  [WARNING]   - com.google.common.annotations.GwtIncompatible
  [WARNING]   - com.google.common.annotations.VisibleForTesting
  [WARNING]   - com.google.common.base.Absent
  [WARNING]   - com.google.common.base.AbstractIterator
  [WARNING]   - com.google.common.base.AbstractIterator$1
  [WARNING]   - com.google.common.base.AbstractIterator$State
  [WARNING]   - 921 more...
  [WARNING] api-1.10-SNAPSHOT.jar, gson-2.8.0.jar define 161 overlapping classes and resources: 
  [WARNING]   - META-INF/maven/com.google.code.gson/gson/pom.properties
  [WARNING]   - META-INF/maven/com.google.code.gson/gson/pom.xml
  [WARNING]   - com.google.gson.ExclusionStrategy
  [WARNING]   - com.google.gson.FieldAttributes
  [WARNING]   - com.google.gson.FieldNamingPolicy
  [WARNING]   - com.google.gson.FieldNamingPolicy$1
  [WARNING]   - com.google.gson.FieldNamingPolicy$2
  [WARNING]   - com.google.gson.FieldNamingPolicy$3
  [WARNING]   - com.google.gson.FieldNamingPolicy$4
  [WARNING]   - com.google.gson.FieldNamingPolicy$5
  [WARNING]   - 151 more...
  [WARNING] api-1.10-SNAPSHOT.jar, bungeecord-chat-1.15-SNAPSHOT.jar define 17 overlapping classes and resources: 
  [WARNING]   - META-INF/maven/net.md-5/bungeecord-chat/pom.properties
  [WARNING]   - META-INF/maven/net.md-5/bungeecord-chat/pom.xml
  [WARNING]   - mojang-translations/en_US.properties
  [WARNING]   - mojang-translations/en_us.json
  [WARNING]   - net.md_5.bungee.api.ChatColor
  [WARNING]   - net.md_5.bungee.api.ChatMessageType
  [WARNING]   - net.md_5.bungee.api.chat.BaseComponent
  [WARNING]   - net.md_5.bungee.api.chat.ClickEvent
  [WARNING]   - net.md_5.bungee.api.chat.ClickEvent$Action
  [WARNING]   - net.md_5.bungee.api.chat.ComponentBuilder
  [WARNING]   - 7 more...
  [WARNING] api-1.10-SNAPSHOT.jar, commons-lang-2.6.jar define 63 overlapping classes and resources: 
  [WARNING]   - META-INF/LICENSE.txt
  [WARNING]   - META-INF/NOTICE.txt
  [WARNING]   - META-INF/maven/commons-lang/commons-lang/pom.properties
  [WARNING]   - META-INF/maven/commons-lang/commons-lang/pom.xml
  [WARNING]   - org.apache.commons.lang.ArrayUtils
  [WARNING]   - org.apache.commons.lang.BooleanUtils
  [WARNING]   - org.apache.commons.lang.CharRange
  [WARNING]   - org.apache.commons.lang.CharRange$1
  [WARNING]   - org.apache.commons.lang.CharRange$CharacterIterator
  [WARNING]   - org.apache.commons.lang.CharSet
  [WARNING]   - 53 more...
  [WARNING] api-1.10-SNAPSHOT.jar, bungeecord-chat-1.15-SNAPSHOT.jar, classgraph-4.8.68.jar, commons-lang-2.6.jar, gson-2.8.0.jar, guava-21.0.jar, snakeyaml-1.25.jar, spigot-api-1.15.2-R0.1-SNAPSHOT.jar, world_teleport-1.8-SNAPSHOT.jar define 1 overlapping resources: 
  [WARNING]   - META-INF/MANIFEST.MF
  [WARNING] api-1.10-SNAPSHOT.jar, spigot-api-1.15.2-R0.1-SNAPSHOT.jar define 710 overlapping classes and resources: 
  [WARNING]   - META-INF/maven/org.spigotmc/spigot-api/pom.properties
  [WARNING]   - META-INF/maven/org.spigotmc/spigot-api/pom.xml
  [WARNING]   - org.bukkit.Art
  [WARNING]   - org.bukkit.Axis
  [WARNING]   - org.bukkit.BanEntry
  [WARNING]   - org.bukkit.BanList
  [WARNING]   - org.bukkit.BanList$Type
  [WARNING]   - org.bukkit.BlockChangeDelegate
  [WARNING]   - org.bukkit.Bukkit
  [WARNING]   - org.bukkit.ChatColor
  [WARNING]   - 700 more...
  [WARNING] api-1.10-SNAPSHOT.jar, classgraph-4.8.68.jar define 228 overlapping classes and resources: 
  [WARNING]   - LICENSE-ClassGraph.txt
  [WARNING]   - META-INF.versions.9.module-info
  [WARNING]   - META-INF/maven/io.github.classgraph/classgraph/pom.properties
  [WARNING]   - META-INF/maven/io.github.classgraph/classgraph/pom.xml
  [WARNING]   - io.github.classgraph.AnnotationClassRef
  [WARNING]   - io.github.classgraph.AnnotationEnumValue
  [WARNING]   - io.github.classgraph.AnnotationInfo
  [WARNING]   - io.github.classgraph.AnnotationInfo$AnnotationInvocationHandler
  [WARNING]   - io.github.classgraph.AnnotationInfoList
  [WARNING]   - io.github.classgraph.AnnotationInfoList$AnnotationInfoFilter
  [WARNING]   - 218 more...
  [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/
  [INFO] Minimized 6106 -&gt; 4706 (77%)
  </code></pre>
  
  <hr>
  
  <h2>Question</h2>
  
  <p>What is causing this warning? What if anything is wrong with my maven pom structure?</p>
  
  <hr>
  
  <h2>Duplicate Question</h2>
  
  <p>If this is a duplicate question please feel free to provide any resources, they would be greatly appreciated.</p>