maven插件生成可执行jar包

		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-assembly-plugin</artifactId>
			<version>2.2.1</version>
			<configuration>
				<archive>
					<manifest>
						<mainClass>XX.XX.Main</mainClass>
					</manifest>
				</archive>
				<descriptorRefs>
					<descriptorRef>jar-with-dependencies</descriptorRef>
				</descriptorRefs>
			</configuration>
			<executions>
				<execution>
					<id>make-assembly</id>
					<phase>package</phase>
					<goals>
						<goal>single</goal>
					</goals>
				</execution>
			</executions>
		</plugin>

 

execution的配置表示,在执行maven package命令时,会执行assembly:single,即在package时会生成可执行jar文件,也可以通过执行mvn assembly:single命令生成
上一篇:linux-sys_brk的资格要求是什么


下一篇:Apache Maven Assembly Plugin中文文档