我使用Intellij Idea
mvn clean package 收集完全缺少 pom 文件中指定的库(依赖项)的 jar。jar 昵称重达半兆字节。
在这种情况下,jar 工件(Build Artifact..)已完全组装并启动。这里罐子的重量是 47 MB。
这不是我第一次收集项目。
我已经为自己毁掉了整个莫斯科。铲掉项目结构。我知道某处出了问题。但我不知道在哪里。
请帮我往哪个方向挖掘,
下面是pom.xml的内容
<?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.7.15</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.destiny</groupId>
<artifactId>startup</artifactId>
<version>0.0.1</version>
<name>Startup/name>
<description>your start will be fine</description>
<properties>
<java.version>11</java.version>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<start-class>com.destiny.startup.StartupApplication</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<!-- исключаем стандартное логгирование спринга, из-за конфликта с log4j2 -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
</dependency>
<!-- сохраняет сессии ремемберми в БД,-->
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
</plugin>
</plugins>
</build>
</project>
构建日志:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< com.destiny:startup >-------------------------
[INFO] Building Startup 0.0.1
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] Parameter 'parameters' is unknown for plugin 'maven-compiler-plugin:3.3:compile (default-compile)'
[WARNING] Parameter 'parameters' is unknown for plugin 'maven-compiler-plugin:3.3:testCompile (default-testCompile)'
[INFO]
[INFO] --- resources:3.2.0:resources (default-resources) @ startup ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO] Copying 61 resources
[INFO]
[INFO] --- compiler:3.3:compile (default-compile) @ startup ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 60 source files to D:\IdeaProjects\SpringStartup\target\classes
[INFO] /D:/IdeaProjects/SpringStartup/src/main/java/com/destiny/startup/config/SecurityConfig.java: D:\IdeaProjects\SpringStartup\src\main\java\com\destiny\startup\config\SecurityConfig.java uses or overrides a deprecated API.
[INFO] /D:/IdeaProjects/SpringStartup/src/main/java/com/destiny/startup/config/SecurityConfig.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- resources:3.2.0:testResources (default-testResources) @ startup---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory D:\IdeaProjects\SpringStartup\src\test\resources
[INFO]
[INFO] --- compiler:3.3:testCompile (default-testCompile) @ startup ---
[INFO] No sources to compile
[INFO]
[INFO] --- surefire:2.22.2:test (default-test) @ startup ---
[INFO] No tests to run.
[INFO]
[INFO] --- jar:3.2.2:jar (default-jar) @ startup ---
[INFO] Building jar: D:\IdeaProjects\SpringStartup\target\startup-0.0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.856 s
[INFO] Finished at: 2023-10-20T19:34:03+03:00
[INFO] ------------------------------------------------------------------------
[WARNING]
[WARNING] Plugin validation issues were detected in 4 plugin(s)
[WARNING]
[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.2.0
[WARNING] * org.apache.maven.plugins:maven-jar-plugin:3.2.2
[WARNING] * org.apache.maven.plugins:maven-compiler-plugin:3.3
[WARNING] * org.apache.maven.plugins:maven-surefire-plugin:2.22.2
[WARNING]
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]
Process finished with exit code 0