zoukankan      html  css  js  c++  java
  • Maven项目导出jar包,包含依赖

    1. Maven项目导出jar包,包含依赖:
    mvn dependency:copy-dependencies package

    2. 可以在Project创建lib文件夹,输入以下命令:
    mvn dependency:copy-dependencies -DoutputDirectory=lib package

    3. 可以设置依赖级别,通常用编译需要的jar
    mvn dependency:copy-dependencies -DoutputDirectory=lib -DincludeScope=compile package

    4.或者直接在pom.xml中添加:

    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
            <appendAssemblyId>false</appendAssemblyId>
            <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
            <!-- <archive>
                <manifest>
                        此处指定main方法入口的class
                    <mainClass>com.xxx.uploadFile</mainClass>
                </manifest>
            </archive> -->
       </configuration>
        <executions>
            <execution>
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                    <goal>assembly</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
  • 相关阅读:
    C语言寒假大作战04
    C语言寒假大作战03
    C语言寒假大作战02
    C语言寒假大作战01
    C语言I作业12—学期总结
    C语言I作业11
    C语言I作业10
    C语言I作业09
    C语言I作业08
    C语言寒假大作战04
  • 原文地址:https://www.cnblogs.com/gavinYang/p/11197816.html
Copyright © 2011-2022 走看看