最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

使用Maven多模塊——打包指定模塊

 更新時間:2024年09月07日 08:55:25   作者:CZ__  
這篇文章主要介紹了使用Maven多模塊——打包指定模塊問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教

Maven多模塊——打包指定模塊

mvn -h 查看命令及其用途

E:\nicole\workspace\test_parent>mvn -h

usage: mvn [options] [<goal(s)>] [<phase(s)>]

Options:
 -am,--also-make                        If project list is specified, also
                                        build projects required by the
                                        list
 -amd,--also-make-dependents            If project list is specified, also
                                        build projects that depend on
                                        projects on the list
 -B,--batch-mode                        Run in non-interactive (batch)
                                        mode (disables output color)
 -b,--builder <arg>                     The id of the build strategy to
                                        use
 -C,--strict-checksums                  Fail the build if checksums don't
                                        match
 -c,--lax-checksums                     Warn if checksums don't match
 -cpu,--check-plugin-updates            Ineffective, only kept for
                                        backward compatibility
 -D,--define <arg>                      Define a system property
 -e,--errors                            Produce execution error messages
 -emp,--encrypt-master-password <arg>   Encrypt master security password
 -ep,--encrypt-password <arg>           Encrypt server password
 -f,--file <arg>                        Force the use of an alternate POM
                                        file (or directory with pom.xml)
 -fae,--fail-at-end                     Only fail the build afterwards;
                                        allow all non-impacted builds to
                                        continue
 -ff,--fail-fast                        Stop at first failure in
                                        reactorized builds
 -fn,--fail-never                       NEVER fail the build, regardless
                                        of project result
 -gs,--global-settings <arg>            Alternate path for the global
                                        settings file
 -gt,--global-toolchains <arg>          Alternate path for the global
                                        toolchains file
 -h,--help                              Display help information
 -l,--log-file <arg>                    Log file where all build output
                                        will go (disables output color)
 -llr,--legacy-local-repository         Use Maven 2 Legacy Local
                                        Repository behaviour, ie no use of
                                        _remote.repositories. Can also be
                                        activated by using
                                        -Dmaven.legacyLocalRepo=true
 -N,--non-recursive                     Do not recurse into sub-projects
 -npr,--no-plugin-registry              Ineffective, only kept for
                                        backward compatibility
 -npu,--no-plugin-updates               Ineffective, only kept for
                                        backward compatibility
 -nsu,--no-snapshot-updates             Suppress SNAPSHOT updates
 -ntp,--no-transfer-progress            Do not display transfer progress
                                        when downloading or uploading
 -o,--offline                           Work offline
 -P,--activate-profiles <arg>           Comma-delimited list of profiles
                                        to activate
 -pl,--projects <arg>                   Comma-delimited list of specified
                                        reactor projects to build instead
                                        of all projects. A project can be
                                        specified by [groupId]:artifactId
                                        or by its relative path
 -q,--quiet                             Quiet output - only show errors
 -rf,--resume-from <arg>                Resume reactor from specified
                                        project
 -s,--settings <arg>                    Alternate path for the user
                                        settings file
 -t,--toolchains <arg>                  Alternate path for the user
                                        toolchains file
 -T,--threads <arg>                     Thread count, for instance 2.0C
                                        where C is core multiplied
 -U,--update-snapshots                  Forces a check for missing
                                        releases and updated snapshots on
                                        remote repositories
 -up,--update-plugins                   Ineffective, only kept for
                                        backward compatibility
 -v,--version                           Display version information
 -V,--show-version                      Display version information
                                        WITHOUT stopping build
 -X,--debug                             Produce execution debug output

假設(shè)Maven多模塊項目

如下:

  • test-parent 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>

	<groupId>com.nicole</groupId>
	<artifactId>test-parent</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>
	<name>test-parent</name>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	<modules>
		<module>test-common</module>
		<module>test-module1</module>
		<module>test-module2</module>
		<module>test-module3</module>
	</modules>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.nicole</groupId>
				<artifactId>test-common</artifactId>
				<version>0.0.1-SNAPSHOT</version>
			</dependency>
		</dependencies>
	</dependencyManagement>
</project>
  • test-common pom.xml:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.nicole</groupId>
    <artifactId>test-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>test-common</artifactId>
  <name>test-common</name>
  <url>http://maven.apache.org</url>
  <packaging>jar</packaging>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>
  • test-module1 pom.xml:
<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.nicole</groupId>
		<artifactId>test-parent</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>
	<artifactId>test-module1</artifactId>
	<packaging>war</packaging>
	<name>test-module1 Maven Webapp</name>
	
	<dependencies>
		<dependency>
			<groupId>com.nicole</groupId>
			<artifactId>test-common</artifactId>
		</dependency>
	</dependencies>
	<build>
		<finalName>test-module1</finalName>
	</build>
</project>

test-common被test-module1,test-module2,test-module3給繼承。

示例一、打包所有模塊

E:\nicole\workspace\test_parent>mvn clean install
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for test-parent 0.0.1-SNAPSHOT:
[INFO]
[INFO] test-parent ........................................ SUCCESS [  0.623 s]
[INFO] test-common ........................................ SUCCESS [  3.274 s]
[INFO] test-module1 Maven Webapp .......................... SUCCESS [  0.966 s]
[INFO] test-module2 Maven Webapp .......................... SUCCESS [  0.434 s]
[INFO] test-module3 Maven Webapp .......................... SUCCESS [  0.678 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.424 s
[INFO] Finished at: 2019-12-30T18:01:30+08:00
[INFO] ------------------------------------------------------------------------

示例二、-pl 打包指定模塊

E:\nicole\workspace\test_parent>mvn clean install -pl test-common,test-module1
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for test-common 0.0.1-SNAPSHOT:
[INFO]
[INFO] test-common ........................................ SUCCESS [  3.494 s]
[INFO] test-module1 Maven Webapp .......................... SUCCESS [  1.056 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.909 s
[INFO] Finished at: 2019-12-30T18:02:39+08:00
[INFO] ------------------------------------------------------------------------

示例三、-am 同時打包所指定模塊的依賴模塊

E:\nicole\workspace\test_parent>mvn clean install -pl test-module1 -am
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for test-parent 0.0.1-SNAPSHOT:
[INFO]
[INFO] test-parent ........................................ SUCCESS [  0.559 s]
[INFO] test-common ........................................ SUCCESS [  3.198 s]
[INFO] test-module1 Maven Webapp .......................... SUCCESS [  1.020 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.127 s
[INFO] Finished at: 2019-12-30T18:04:49+08:00
[INFO] ------------------------------------------------------------------------

示例四、-amd 同時打包依賴于所指定模塊的模塊

E:\nicole\workspace\test_parent>mvn clean install -pl test-common -amd
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for test-common 0.0.1-SNAPSHOT:
[INFO]
[INFO] test-common ........................................ SUCCESS [  3.497 s]
[INFO] test-module1 Maven Webapp .......................... SUCCESS [  1.178 s]
[INFO] test-module2 Maven Webapp .......................... SUCCESS [  0.536 s]
[INFO] test-module3 Maven Webapp .......................... SUCCESS [  0.746 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.330 s
[INFO] Finished at: 2019-12-30T18:06:11+08:00
[INFO] ------------------------------------------------------------------------

示例五、-rf 從所指定模塊順序開始打包

E:\nicole\workspace\test_parent>mvn clean install -rf test-module2
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for test-module2 Maven Webapp 0.0.1-SNAPSHOT:
[INFO]
[INFO] test-module2 Maven Webapp .......................... SUCCESS [  2.146 s]
[INFO] test-module3 Maven Webapp .......................... SUCCESS [  0.489 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.128 s
[INFO] Finished at: 2019-12-30T18:06:43+08:00
[INFO] ------------------------------------------------------------------------

示例六、-pl -amd -rf 對裁剪后的模塊堆再次裁剪

E:\nicole\workspace\test_parent>mvn clean install -pl test-common -amd -rf test-module1
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for test-module1 Maven Webapp 0.0.1-SNAPSHOT:
[INFO]
[INFO] test-module1 Maven Webapp .......................... SUCCESS [  2.195 s]
[INFO] test-module2 Maven Webapp .......................... SUCCESS [  0.523 s]
[INFO] test-module3 Maven Webapp .......................... SUCCESS [  0.633 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.889 s
[INFO] Finished at: 2019-12-30T18:07:46+08:00
[INFO] ------------------------------------------------------------------------

  • -pl -amd 得到test-common,test-module1,test-module2,test-module3
  • rf 從test-module1開始打包

總結(jié)

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Springboot打包部署項目的過程詳解

    Springboot打包部署項目的過程詳解

    這篇文章主要介紹了Springboot打包部署項目的過程,通過jar包方式打包和war方式打包,本文結(jié)合示例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友參考下吧
    2023-12-12
  • Java算法之遞歸算法計算階乘

    Java算法之遞歸算法計算階乘

    這篇文章主要為大家詳細(xì)介紹了Java遞歸算法計算階乘,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2015-08-08
  • Java 線程的優(yōu)先級(setPriority)案例詳解

    Java 線程的優(yōu)先級(setPriority)案例詳解

    這篇文章主要介紹了Java 線程的優(yōu)先級(setPriority)案例詳解,本篇文章通過簡要的案例,講解了該項技術(shù)的了解與使用,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下
    2021-08-08
  • Springboot整合log4j2日志全解總結(jié)

    Springboot整合log4j2日志全解總結(jié)

    這篇文章主要介紹了Springboot整合log4j2日志全解總結(jié),小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-12-12
  • Spring如何處理注解的深入理解

    Spring如何處理注解的深入理解

    這篇文章主要給大家介紹了關(guān)于Spring如何處理注解的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用java中的注解具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2018-11-11
  • springboot整合 xxl-job的項目實踐

    springboot整合 xxl-job的項目實踐

    XL-JOB是一個分布式任務(wù)調(diào)度平臺,用于解決分布式系統(tǒng)中的任務(wù)調(diào)度和管理問題,它包括調(diào)度中心、執(zhí)行器和Web管理控制臺,本文就來介紹一下springboot整合 xxl-job的項目實踐,感興趣的可以了解一下
    2024-09-09
  • java中TCP/UDP詳細(xì)總結(jié)

    java中TCP/UDP詳細(xì)總結(jié)

    本篇文章對Java中的TCP/UDP知識點進行了歸納總結(jié)分析。需要的朋友參考下
    2017-04-04
  • SpringCloud Feign遠(yuǎn)程調(diào)用實現(xiàn)詳解

    SpringCloud Feign遠(yuǎn)程調(diào)用實現(xiàn)詳解

    Feign是Netflix公司開發(fā)的一個聲明式的REST調(diào)用客戶端; Ribbon負(fù)載均衡、 Hystrⅸ服務(wù)熔斷是我們Spring Cloud中進行微服務(wù)開發(fā)非常基礎(chǔ)的組件,在使用的過程中我們也發(fā)現(xiàn)它們一般都是同時出現(xiàn)的,而且配置也都非常相似
    2022-11-11
  • Java中使用ForkJoinPool的實現(xiàn)示例

    Java中使用ForkJoinPool的實現(xiàn)示例

    ForkJoinPool是一個功能強大的Java類,用于處理計算密集型任務(wù),本文主要介紹了Java中使用ForkJoinPool的實現(xiàn)示例,具有一定的參考價值,感興趣的可以了解一下
    2023-09-09
  • 在Java的Spring框架的程序中使用JDBC API操作數(shù)據(jù)庫

    在Java的Spring框架的程序中使用JDBC API操作數(shù)據(jù)庫

    這篇文章主要介紹了在Java的Spring框架的程序中使用JDBC API操作數(shù)據(jù)庫的方法,并通過示例展示了其存儲過程以及基本SQL語句的應(yīng)用,需要的朋友可以參考下
    2015-12-12

最新評論

辉南县| 永顺县| 盖州市| 英超| 手游| 南宫市| 新营市| 罗城| 天祝| 大姚县| 安顺市| 广南县| 公安县| 抚顺市| 托里县| 巫山县| 崇文区| 宜黄县| 汉中市| 温宿县| 乌拉特中旗| 文登市| 瓦房店市| 乌拉特后旗| 门头沟区| 寻乌县| 平邑县| 黎川县| 奉化市| 奇台县| 休宁县| 祁阳县| 乃东县| 阿坝县| 唐海县| 邢台县| 泗阳县| 安徽省| 凤阳县| 句容市| 黄大仙区|