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

  • 相关阅读:
    全站导航
    常用模块
    模块的引用的路径的查找
    类的魔术方法
    包装和授权
    类内置的attr属性
    反射
    三大特性之多态
    三大特性之封装
    python应用:爬虫框架Scrapy系统学习第二篇——windows下安装scrapy
  • 原文地址:https://www.cnblogs.com/hejunhong/p/11203990.html
Copyright © 2011-2022 走看看