zoukankan      html  css  js  c++  java
  • maven打包

    1. 普通打包

    只打包源代码,不包含所使用的jar包

    1.1 pom 配置

    <build>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
          <plugins>
            <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <encoding>UTF-8</encoding>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>

    1.2 打包命令

    mvn clean package -D maven.test.skip=true

    2.包含pom中所有jar的打包

    2.1 pom 配置

    <build>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
          <plugins>
            <plugin>
              <artifactId>maven-assembly-plugin</artifactId>
              <configuration>
                <!--这部分可有可无,加上的话则直接生成可运行jar包-->
                <!--<archive>-->
                <!--<manifest>-->
                <!--<mainClass>${exec.mainClass}</mainClass>-->
                <!--</manifest>-->
                <!--</archive>-->
                <descriptorRefs>
                  <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>

    2.2 打包命令

    mvn assembly:assembly
  • 相关阅读:
    flask多线程多协程操作
    flask介绍
    centos django+Nginx+uwsgi部署
    centos下运行python3.6+Django+mysql项目
    centos虚拟机下安装nginx
    redis安装
    路飞学城课程_课程详细_作业点评
    redis使用方式
    git命令学习
    组合&多态&封装
  • 原文地址:https://www.cnblogs.com/kongkongFabian/p/11262155.html
Copyright © 2011-2022 走看看