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

  • 相关阅读:
    测试框架 MSTest V2与单元测试
    string字符串格式
    重构概述
    代码的坏味道
    this.Dispatcher.Invoke与SynchronizationContext
    C# new关键字
    Servlet的API和生命周期
    Servlet快速入门
    Spring介绍
    Oracle数据安全解决方案(1)——透明数据加密TDE
  • 原文地址:https://www.cnblogs.com/hejunhong/p/11203990.html
Copyright © 2011-2022 走看看