zoukankan      html  css  js  c++  java
  • maven打包 依赖jar与不依赖jar


    ?
    xml version="1.0" encoding="UTF-8"?> <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> <id>jar-with-dependencies</id> <formats> <format>jar</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets> <dependencySet> <unpack>false</unpack> <scope>runtime</scope> </dependencySet> </dependencySets> <fileSets> <fileSet> <directory>/lib</directory> </fileSet> </fileSets> </assembly>


     

         <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
     //上面为src.xml
    <descriptors> <!--<descriptor>src/main/assembly/src.xml</descriptor>--> </descriptors> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id> <!-- this is used for inheritance merges --> <phase>package</phase> <!-- bind to the packaging phase --> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin>

     我们可以设置jar包的作用域 进行胖包瘦包的选择,集群环境使用<scope>provide</scope>来选择是否需要将集群 jar打进去 ,或者只打第三方jar

  • 相关阅读:
    为什么选择 Yeoman 及 Yeoman 的安装
    NPOI高效匯出Excel
    CentOS7 MongoDB安裝
    打印函数调用堆栈
    libevent源码分析:eventop
    libevent源码分析:time-test例子
    libevent源码分析:event_assign、event_new
    libevent源码分析:bufferevent
    lievent源码分析:evbuffer
    epoll实现压测工具
  • 原文地址:https://www.cnblogs.com/hejunhong/p/11203990.html
Copyright © 2011-2022 走看看