Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Article Directory
The basic package
Usually it does not require any special settings must be executed only in the case maven package can then execute the command clean
Skip unit tests
If the time to write unit tests in the project, then execute maven command to package the unit will perform the test again
<plugins>
<!-- 打包时跳过单元测试-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
Reference external jar package
If you reference external jar package, the package when it will error, this time we can do this:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>system</scope>
<systemPath>${project.basedir}/lib/mssql-jdbc-6.4.0.jre8.jar</systemPath>
</dependency>
...
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
Run jar
jara -jar xxxx.jar