maven-jar-plugin 特殊用法

編譯構建red5 發現server jar包含了boot裏面的類,覆蓋默認jar-plugin的打包方式  注意顏色加粗的地方 bootstrap

<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<id>default-jar</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>						
							<archive>
								<manifest>
									<addDefaultImplementationEntries>false</addDefaultImplementationEntries>
									<addDefaultSpecificationEntries>false</addDefaultSpecificationEntries> 
								</manifest>
								<manifestEntries>
									<SCM-Revision>${buildNumber}</SCM-Revision>
								</manifestEntries>
								<manifestEntries>
									<Red5-Version>${project.version}</Red5-Version>
								</manifestEntries>
							</archive>
							<excludes>
								<exclude>**/org/red5/server/Bootstrap.class</exclude>
								<exclude>**/org/red5/server/Shutdown.class</exclude>
								<exclude>**/org/red5/server/jmx/mxbeans/ShutdownMXBean.class</exclude>
								<exclude>**/org/red5/classloading/**</exclude>
							</excludes>
						</configuration>
					</execution>
					<execution>
						<id>bootstrap</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<classifier>bootstrap</classifier>
							<archive>
								<manifest>
									<addDefaultImplementationEntries>false</addDefaultImplementationEntries>
									<mainClass>org.red5.server.Bootstrap</mainClass>
								</manifest>
								<manifestEntries>
									<SCM-Revision>${buildNumber}</SCM-Revision>
								</manifestEntries>
								<manifestEntries>
									<Red5-Version>${project.version}</Red5-Version>
								</manifestEntries>
							</archive>
							<includes>
								<include>**/org/red5/server/Bootstrap.class</include>
								<include>**/org/red5/server/Shutdown.class</include>
								<include>**/org/red5/server/jmx/mxbeans/ShutdownMXBean.class</include>
								<include>**/org/red5/classloading/**</include>
							</includes>
						</configuration>
					</execution>
				</executions>
			</plugin>
相關文章
相關標籤/搜索