zoukankan      html  css  js  c++  java
  • 关于jar打包分块

    pom引入

    <plugin><!--分块打包模式-->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.4.1</version>
                    <executions>
                        <execution>
                            <id>make-assembly</id>
                            <!-- 绑定到package生命周期 -->
                            <phase>package</phase>
                            <goals>
                                <!-- 只运行一次 -->
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <!-- 配置描述符文件 -->
                        <descriptor>src/main/assembly/assembly.xml</descriptor>
                        <!-- 也可以使用Maven预配置的描述符
                        <descriptorRefs>
                            <descriptorRef>jar-with-dependencies</descriptorRef>
                        </descriptorRefs> -->
                    </configuration>
                </plugin>

    配置文件assembly.xml

    <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>assembly</id>
        <formats>
            <format>dir</format>
            <!--<format>tar.gz</format>-->
        </formats>
        <includeBaseDirectory>false</includeBaseDirectory>
    
        <dependencySets>
            <dependencySet>
                <outputDirectory>/lib</outputDirectory>
            </dependencySet>
        </dependencySets>
    
        <fileSets>
            <fileSet>
                <directory>src/main/assembly/scripts</directory>
                <outputDirectory>bin</outputDirectory>
                <fileMode>0755</fileMode>
                <filtered>true</filtered>
            </fileSet>
            <fileSet>
                <directory>src/main/resources</directory>
                <outputDirectory>config</outputDirectory>
            </fileSet>
            <fileSet>
                <directory>src/main/webapp</directory>
                <outputDirectory>runtime</outputDirectory>
            </fileSet>
    
        </fileSets>
    </assembly>

    maven下点击package,则会在target/wx-api-assembly下生成lib和config目录

    好处是更新只需要更新对于的jar包即可

    启动方式:https://www.cnblogs.com/zenghansen/p/12795962.html

  • 相关阅读:
    win 10 安装 Chocolatey
    css文字禁止选中
    解决手机端上的iframe无法触摸滚动
    关于a标签
    移动端点击a标签和img标签以及添加的js点击事件时的闪屏问题 解决方案
    关于时间戳
    json转字符串
    css一行溢出隐藏,两行溢出隐藏
    centos 7.x编写开机启动服务
    编译LFS
  • 原文地址:https://www.cnblogs.com/zenghansen/p/12966389.html
Copyright © 2011-2022 走看看