zoukankan      html  css  js  c++  java
  • maven多模块profiles的石使用

    另外参考:https://blog.csdn.net/linhao19891124/article/details/73872303

    maven中指定build一个project中几个特定的子modules

    问题由来:

          一个项目可能会有多个子module,在特定情况下可能只需要build其中几个module。

    例如我的项目的目录结构如下

    myproject

    |------------module_one

    |------------module_two

    |------------module_three

    |------------module_four

    |------------module_five

    |------------module_six

    |------------module_seven

    |------------pom.xml

    解决方法一:

    例:我想要build module_three,module_five,module_seven三个子module

    在根pom同一级目录运行如下命令:

    mvn clean install -pl module_three,module_five,module_seven

    也可以在此命令上加上以下参数

    -am 不仅build module_three,module_five,module_seven这三个,而且build这些子module require的其他项目,require是指其parent项目。

    -amd 不仅build module_three,module_five,module_seven这三个,而且build依赖这三个module的项目,如module_other。

    解决方法二:

    增加一个profile,如:

    复制代码
    <profiles>      
      <profile>
                <id>patch_001</id>
                <properties>
                    
                </properties>
                <modules>
                    <module>module_three</module>
                    <module>module_five</module>
                    <module>module_seven</module>
                </modules>
            </profile>
    </profiles>
    复制代码

    然后运行maven命令:

    mvn clean install -Ppatch_001  #这样也可以只build这三个子module

    PS:我采用第二种方法的时候,发现在profile这样定义了所要build的module后,外面就不能再定义需要build的module了,否则就会按照外面定义的来build一系列,不知道是什么原因,或者是我的写法有错误,如果有哪位大神知道,还望不吝赐教。

  • 相关阅读:
    shape与reshape
    opencv4.5.0 +contrib编译流程
    人脸定位(haar特征)
    最近邻分类法
    人脸识别概述
    跟踪视频中的物体
    估算稠密光流
    resize函数
    swap函数
    hibernate的session执行增删改查方法的执行步骤
  • 原文地址:https://www.cnblogs.com/zhaoyanhaoBlog/p/11323112.html
Copyright © 2011-2022 走看看