zoukankan      html  css  js  c++  java
  • maven把项目依赖的所有jar包打包成一个jar包

    <build>
    	<finalName>component-${project.version}</finalName>
    	<!-- 生产环境全量打包请使用以下配置 -->
    	<plugins>
    		<plugin>
    			<groupId>org.apache.maven.plugins</groupId>
    			<artifactId>maven-shade-plugin</artifactId>
    			<version>3.0.0</version>
    			<executions>
    				<execution>
    					<phase>package</phase>
    					<goals>
    						<goal>shade</goal>
    					</goals>
    					<configuration>
    						<artifactSet>
    							<excludes>
    								<exclude>com.google.code.findbugs:jsr305</exclude>
    								<exclude>org.slf4j:*</exclude>
    								<exclude>log4j:*</exclude>
    							</excludes>
    						</artifactSet>
    						<filters>
    							<filter>
    								<artifact>*:*</artifact>
    								<excludes>
    									<exclude>META-INF/*.SF</exclude>
    									<exclude>META-INF/*.DSA</exclude>
    									<exclude>META-INF/*.RSA</exclude>
    								</excludes>
    							</filter>
    						</filters>
    						<transformers>
    							<transformer
    								implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
    							</transformer>
    							<transformer
    								implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
    								<resource>reference.conf</resource>
    							</transformer>
    						</transformers>
    					</configuration>
    				</execution>
    			</executions>
    		</plugin>
    	</plugins>
    </build>
    

      关于maven打全量包,需要把打包方式配置成jar包

      <modelVersion>4.0.0</modelVersion>
      <artifactId>component</artifactId>
      <packaging>jar</packaging>

      最后使用maven install就可以打包了。

  • 相关阅读:
    1099. Build A Binary Search Tree (30)
    两个新事物
    time.h
    Nohup命令
    进程锁
    C++中虚析构函数的作用
    c++ 修改stl set中的元素
    STL迭代器辅助函数——advance
    CTreeCtrl 控件使用总结
    关于stl advance函数移动步数超过容器大小(越界)的研究
  • 原文地址:https://www.cnblogs.com/CatcherLJ/p/11811890.html
Copyright © 2011-2022 走看看