• Maven assembly 打包


    
    

    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">
    
        <formats>
    
            <format>zip</format>    <!-- 设置打包后的格式为zip -->
    
        </formats>
    
        <fileSets> <!-- 要打包的文件 -->
    
            <fileSet> <!-- 根目录下的readme、license、notice文件 -->
    
                <directory>${project.basedir}</directory>
    
                <outputDirectory>/</outputDirectory>
    
                <includes>
    
                    <include>README*</include>
    
                    <include>LICENSE*</include>
    
                    <include>NOTICE*</include>
    
                </includes>
    
            </fileSet>
    
            <fileSet><!-- bin目录下的所有文件(批处理文件) -->
    
                <directory>${project.basedir}/bin</directory>
    
                <outputDirectory>/</outputDirectory>
    
            </fileSet>
            <fileSet><!-- target目录下的jar包 -->
    
                <directory>${project.build.directory}/</directory>
    
                <outputDirectory>/</outputDirectory>
    
                <includes>
    
                    <include>*.jar</include>
    
                </includes>
    
            </fileSet>
    
        </fileSets>
    
        <dependencySets> <!-- 打包的依赖jar, 放置在lib下 -->
    
            <dependencySet>
    
                <outputDirectory>/lib</outputDirectory>
    
                <useProjectArtifact>false</useProjectArtifact>
    
                <scope>runtime</scope>
    
            </dependencySet>
    
        </dependencySets>
    
    </assembly>

    Pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  <modelVersion>4.0.0</modelVersion>
        <artifactId>module-im</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>jar</packaging>
        <name>module-im</name>
        <parent>
            <groupId>com.shj</groupId>
            <artifactId>micro-service-parent</artifactId>
            <version>1.0.0</version>
        </parent>
        <properties>
            <project.build.name>im</project.build.name>
        </properties>
        <dependencies>
            <dependency>
                <groupId>com.shj</groupId>
                <artifactId>interface-im</artifactId>
                <version>${ykee.version}</version>
            </dependency>
        </dependencies>
        <build>
            <finalName>module-im</finalName>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                        <descriptors>
                            <descriptor>assembly.xml</descriptor><!-- 指定assembly配置文件路径 -->
                        </descriptors>
                    </configuration>
                    <executions>
                        <execution>
                            <id>make-assembly</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath><!-- 增加classpath -->
                                <classpathPrefix>lib/</classpathPrefix><!-- classpath路径前缀 -->
                                <mainClass>com.shj.ms.im.ImApplication</mainClass><!-- 程序主入口类 -->
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
  • 相关阅读:
    常用功能测试点的测试用例
    如何设计功能测试测试用例
    管理小原则
    政党提供的公共产品是其存在的依据
    为什么人是根本?
    学问总分类
    和孩子沟通的开头常用语
    教育的核心对象是心中的那枚种子
    用目标激发动力,用计划控制落实,用梳理总结进行提高
    要想影响孩子第一位的是保证沟通畅通
  • 原文地址:https://www.cnblogs.com/cocoat/p/5997187.html
Copyright © 2020-2023  润新知