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
  • 相关阅读:
    docker 部署 jenkins
    docker compose 常用命令
    docker compose 安装
    docker swarm 常用命令
    centos7 修改主机名
    docker 修改gwbridge ip address
    docker 创建私有镜像之 registry
    nginx 动静分离之 tomcat
    nginx lnmp之nginx+php
    nginx 配置状态监控
  • 原文地址:https://www.cnblogs.com/kongkongFabian/p/11262155.html
Copyright © 2011-2022 走看看