maven 各种打包方式 有更新!

  Janix520

1. spring-boot-maven-plugin 不打包依赖

<plugin>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-maven-plugin</artifactId>
	<configuration>
		<includes>
			<!-- 设置没有jar包 -->
			<include>
				<groupId>nothing</groupId>
				<artifactId>nothing</artifactId>
			</include>
		</includes>
	</configuration>
</plugin>

2. maven-jar-plugin jar包与第三方依赖分离打包

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-jar-plugin</artifactId>
	<configuration>
		<archive>
			<manifest>
				<addClasspath>true</addClasspath>
				<classpathPrefix>lib/</classpathPrefix>
				<mainClass>com.zj.SimpleApiApplication</mainClass>
			</manifest>
		</archive>
	</configuration>
</plugin>
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-dependency-plugin</artifactId>
	<executions>
		<execution>
			<id>copy-dependencies</id>
			<phase>package</phase>
			<goals>
				<goal>copy-dependencies</goal>
			</goals>
			<configuration>
				<outputDirectory>${project.build.directory}/lib</outputDirectory>
			</configuration>
		</execution>
	</executions>
</plugin>

------你的笑你的泪,是我筑梦路上,最美的太阳。