I have a multi-modules Spring boot project as following:
(我有一个多模块的Spring启动项目,如下所示:)
- EAB.ActiveTeam.Domain -> FAT JAR
(EAB.ActiveTeam.Domain-> FAT JAR)
- EAB.ActiveTeam.Storage -> FAT JAR
(EAB.ActiveTeam.Storage-> FAT JAR)
- EAB.ActiveTeam.Exporter -> Execuatabel JAR
(EAB.ActiveTeam.Exporter->执行JAR)
The last JAR references the two fat jars as in the below POM.xml but I got an exception in main: it does not see the classes in fat JARs.
(最后一个JAR引用了下面的POM.xml中的两个胖jar,但是我在main中有一个例外:它看不到胖JAR中的类。)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>EAB.ActiveTeam.Exporter</groupId>
<artifactId>EAB.ActiveTeam.Exporter</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>EAB.ActiveTeam.Exporter</name>
<description>EAB.ActiveTeam.Exporter</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>EAB.ActiveTeam.Domain</groupId>
<artifactId>EAB.ActiveTeam.Domain</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/../libs/EAB.ActiveTeam.Domain-1.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>EAB.ActiveTeam.Storage</groupId>
<artifactId>EAB.ActiveTeam.Storage</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/../libs/EAB.ActiveTeam.Storage-1.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>EAB.ActiveTeam.Exporter.App</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
ask by Anas Tina translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…