Maven打Jar 合包 采坑
程序员文章站
2022-05-04 16:53:37
...
打包时遇到执行 mvn clean install 时出现项目运行Test 且不出现jar包的问题
###解决方式
添加插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
完整配置
<?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 http://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.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.*****</groupId>
<artifactId>*****</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>****</name>
<description>project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
...................
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
上一篇: element表单重置
推荐阅读
-
详解IDEA中MAVEN项目打JAR包的简单方法
-
看看idea+maven打jar包的两种方式
-
maven项目打jar包后获取resources下文件的代码报错:FileNotFoundException:no such file or directory
-
Maven打jar包,并将依赖包打进去
-
java——maven多模块项目打jar包如何把依赖包也打进去
-
使用maven打war,本地的jar包没有被包含
-
maven 打jar包时将本地依赖的jar包打入
-
idea maven项目 打jar 打进去依赖包
-
gpg加密发布jar包到maven*仓库详细过程以及踩的坑
-
使用maven打war,本地的jar包没有被包含