Java Maven着色多模块聚合和继承 上下文
我有一个包含多个模块的IntelliJ项目。我正在使用maven shade插件来处理jar依赖项,同时减少jar大小。项目结构如下:Java Maven着色多模块聚合和继承 上下文,java,maven,maven-shade-plugin,Java,Maven,Maven Shade Plugin,我有一个包含多个模块的IntelliJ项目。我正在使用maven shade插件来处理jar依赖项,同时减少jar大小。项目结构如下: 顶级父级(pom)(聚合api和世界传送) api(继承父级) 世界传送(继承父级,api) 聚甲醛(s) 母公司 <groupId>com.jsonmack</groupId> <artifactId>mcplugins</artifactId> <packaging>pom</pac
- 顶级父级(pom)(聚合api和世界传送)
- api(继承父级)
- 世界传送(继承父级,api)
聚甲醛(s) 母公司
<groupId>com.jsonmack</groupId>
<artifactId>mcplugins</artifactId>
<packaging>pom</packaging>
<version>1.10-SNAPSHOT</version>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<modules>
<module>api</module>
<module>world-teleport</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<artifactSet>
<excludes>
<exclude>junit:junit</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
com.jsonmack
麦克普卢金斯
聚甲醛
1.10-1
插销式回购
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
应用程序编程接口
世界传送站
org.apache.maven.plugins
maven编译器插件
1.8
1.8
3.8.1
org.apache.maven.plugins
maven阴影插件
3.2.2
包裹
阴凉处
符合事实的
junit:junit
io.github.classgraph
类图
4.8.68
org.spigotmc
插口api
1.15.2-R0.1-快照
朱尼特
朱尼特
4.13
测验
原料药
麦克普卢金斯
com.jsonmack
1.10-1
4.0.0
应用程序编程接口
罐子
io.github.classgraph
类图
org.spigotmc
插口api
世界传送站
<parent>
<groupId>com.jsonmack</groupId>
<artifactId>mcplugins</artifactId>
<version>1.10-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.jsonmack</groupId>
<artifactId>api</artifactId>
<version>1.10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
com.jsonmack
麦克普卢金斯
1.10-1
com.jsonmack
应用程序编程接口
1.10-1
io.github.classgraph
类图
org.spigotmc
插口api
朱尼特
朱尼特
问题 每次我执行一个干净的、新的安装或包时,都会向我指出存在重复的依赖项
错误/警告
[信息]
[信息]-----------------------------------
[信息]建设世界传送站1.8-SNAPSHOT[7/7]
[信息]------------------------------------[jar]---------------------------------
[信息]
[信息]---maven clean插件:2.5:clean(默认清洁)@world\u teleport---
[信息]删除/Users/Business/Documents/workspace/mcplugins/world_teleport/target
[信息]
[信息]---maven资源插件:2.6:resources(默认资源)@world\u teleport---
[信息]使用“UTF-8”编码复制筛选的资源。
[信息]正在复制2个资源
[信息]
[信息]---maven编译器插件:3.8.1:编译(默认编译)@world\u teleport---
[信息]检测到更改-重新编译模块!
[信息]编译19个源文件到/Users/Business/Documents/workspace/mcplugins/world_teleport/target/classes
[信息]
[信息]---maven资源插件:2.6:testResources(默认testResources)@world\u teleport---
[信息]使用“UTF-8”编码复制筛选的资源。
[信息]跳过不存在的resourceDirectory/Users/Business/Documents/workspace/mcplugins/world_teleport/src/test/resources
[信息]
[信息]---maven编译器插件:3.8.1:testCompile(默认testCompile)@world\u teleport---
[信息]检测到更改-重新编译模块!
[信息]
[信息]---maven surefire插件:2.12.4:test(默认测试)@world\u teleport---
[信息]
[信息]---maven jar插件:3.2.0:jar(默认jar)@world\u teleport---
[信息]构建jar:/Users/Business/Documents/workspace/mcplugins/world_teleport/target/world_teleport-1.8-SNAPSHOT.jar
[信息]
[信息]---maven shade插件:3.2.2:shade(默认)@world\u teleport---
[信息]在着色的jar中包括com.jsonmack:api:jar:1.10-SNAPSHOT。
[信息]包括io.github.classgraph:classgraph:jar:4.8.68在着色的jar中。
[信息]包括org.spigotmc:spigotapi:jar:1.15.2-R0.1-SNAPSHOT在阴影jar中。
[信息]在着色的jar中包括commons lang:commons lang:jar:2.6。
[信息]包括com.google.guava:guava:jar:21.0。
[信息]包括com.google.code.gson:gson:jar:2.8.0。
[信息]包括net.md-5:bungeecord chat:jar:1.15-SNAPSHOT在着色的jar中。
[信息]包括org.yaml:snakeyaml:jar:1.25在阴影的jar中。
[信息]最小化jar com.jsonmack:world_teleport:jar:1.8-SNAPSHOT
[警告]/Users/Business/Documents/workspace/mcplugins/world_teleport/target/classes(是一个目录)
[警告]api-1.10-SNAPSHOT.jar,snakeyaml-1.25.jar定义207个重叠类和资源:
[警告]-META-INF/maven/org.yaml/snakeyaml/pom.properties
[警告]-META-INF/maven/org.yaml/snakeyaml/pom.xml
[警告]-org.yaml.snakeyaml.DumperOptions
[警告]-org.yaml.snakeyaml.DumperOptions$FlowStyle
[警告]-org.yaml.snakeyaml.DumperOptions$LineBreak
[警告]-org.yaml.snakeyaml.DumperOptions$NonPrintableStyle
[警告]-org.yaml.snakeyaml.DumperOptions$ScalarStyle
[警告]-org.yaml.snakeyaml.DumperOptions$版本
[警告]-org.yaml.snakeyaml.LoaderOptions
[警告]-org.yaml.snakeyaml.TypeDescription
[警告]-197更多。。。
[警告]api-1.10-SNAPSHOT.jar,guava-21.0.jar定义了931个重叠类和资源:
[警告]-META-INF/maven/com.google.guava/guava/pom.properties
[警告]-META-INF/maven/com.goo
<groupId>com.jsonmack</groupId>
<artifactId>mcplugins</artifactId>
<packaging>pom</packaging>
<version>1.10-SNAPSHOT</version>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<modules>
<module>api</module>
<module>world-teleport</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<artifactSet>
<excludes>
<exclude>junit:junit</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<parent>
<groupId>com.jsonmack</groupId>
<artifactId>mcplugins</artifactId>
<version>1.10-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.jsonmack</groupId>
<artifactId>api</artifactId>
<version>1.10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>