当前位置: 首页 > news >正文

深圳网站建设方维网络网站制作出名的公司

深圳网站建设方维网络,网站制作出名的公司,事件营销ppt,做程序界面的网站这篇文章主要介绍了flatten-maven-plugin使用,本文通过示例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下 − 目录 一、简介 1.1 作用1.2 goal介绍二、使用总结 一、简介 1.1 作用 将pom工程父子pom的版…

这篇文章主要介绍了flatten-maven-plugin使用,本文通过示例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

目录
  • 一、简介
    • 1.1 作用
    • 1.2 goal介绍
  • 二、使用总结

一、简介

1.1 作用

将pom工程父子pom的版本,提出作为变量定义在properties。

这样仅修改变量的值(如在运行mvn命令时指定) 即可实现版本整体切换。

1.2 goal介绍

  • flatten:clean

删除flatten插件生成的 .flattened-pom.xml

配置参数有:

flattenedPomFilename: 插件生成的pom的名字,默认为 .flattened-pom.xml

outputDirectory:插件生成pom的目录,默认为 ${project.basedir}

  • flatten:flatten

resources-process生成 .flattened-pom.xml,并在install/deploy时替换原始pom.xml

主要配置参数有:

flattenedPomFilename: 插件生成的pom的名字,默认为 .flattened-pom.xml

outputDirectory:插件生成pom的目录,默认为 ${project.basedir}

updatePomFile: packing=pom的module也进行reversion变量替换,默认为false

flattenMode:用来定义生成 .flattened-pom.xml所包含的元素,常用值有:

oss:开源软件常用,除了repositories/pluginRepositories外其他所有FlattenDescriptor定义的元素都生成

ossrh:所有FlattenDescriptor定义的元素都生成

bom:在ossrh基础上增加dependencyManagement和properties

defaults:除了repositories其他所有FlattenDescriptor定义的元素都不生成

clean:所有FlattenDescriptor定义的元素都不生成

fatjar:所有FlattenDescriptor定义的元素和dependencies都不生成

resolveCiFriendliesOnly:只替换原始pom中的revision, sha1 and changelist,其他否保持原样

常用oss/ossrh/resolveCiFriendliesOnly

  • FlattenDescriptor定义的pom.xml元素有:

modelVersion
groupId
artifactId
version
packaging
licenses
dependencies
profiles
name
description
url
inceptionYear
organization
scm
developers
contributors
mailingLists
pluginRepositories
issueManagement
ciManagement
distributionManagement
prerequisites
repositories
parent
build
dependencyManagement
properties
modules
reporting

二、使用总结

  • 不用flatten-maven-plugin

1.父pom定义版本为变量reversion并作为version,子pom复引用变量reversion作为version

2.结果能正常运行compile/test, 但install或deploy时父子pom中的version还是reversion变量未被替换

3.没有version别人无法引用你的包

父pom.xml

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

<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>

    <packaging>pom</packaging>

    <version>${reversion1}</version>

    <modules>

        <module>no-flatten-child</module>

    </modules>

    <groupId>com.wsl.my.maven</groupId>

    <artifactId>no-flatten-plugin</artifactId>

    <properties>

        <maven.compiler.source>8</maven.compiler.source>

        <maven.compiler.target>8</maven.compiler.target>

        <reversion1>1.1.0-SNAPSHOT</reversion1>

    </properties>

</project>

子pom.xml

1

2

3

4

5

6

7

8

9

10

11

12

13

<?xml version="1.0" encoding="UTF-8"?>

<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">

    <parent>

        <artifactId>no-flatten-plugin</artifactId>

        <groupId>com.wsl.my.maven</groupId>

        <version>${reversion1}</version>

        <relativePath>../pom.xml</relativePath>

    </parent>

    <modelVersion>4.0.0</modelVersion>

    <artifactId>no-flatten-child</artifactId>

</project>

install/deploy后父子pom.xml中的${reversion1}没有被替换

  • 使用了flatten-maven-plugin

1.父pom定义版本为变量reversion并作为version,子pom复引用变量reversion作为version

2.使用flatten-maven-plugin并设置updatePomFile=true,并绑定goal到maven周期

3.在process-resources阶段时会在父子project目录下生成.flattened-pom.xml(version已替换为具体值)

4.运行install或deploy时会将.flattened-pom.xml替换原来的pom.xml

原始父pom

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

<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>

    <version>${reversion2}</version>

    <packaging>pom</packaging>

    <artifactId>use-flatten-parent</artifactId>

        <groupId>com.wsl.my.maven</groupId>

    <modules>

        <module>use-flatten-child</module>

    </modules>

    <properties>

        <maven.compiler.source>8</maven.compiler.source>

        <maven.compiler.target>8</maven.compiler.target>

        <reversion2>1.2.0-SNAPSHOT</reversion2>

    </properties>

    <build>

        <plugins>

            <plugin>

                <groupId>org.codehaus.mojo</groupId>

                <artifactId>flatten-maven-plugin</artifactId>

                <version>1.2.7</version>

                <configuration>

                    <updatePomFile>true</updatePomFile>

                    <flattenMode>resolveCiFriendliesOnly</flattenMode>

                </configuration>

                <executions>

                    <execution>

                        <id>flatten</id>

                        <phase>process-resources</phase>

                        <goals>

                            <goal>flatten</goal>

                        </goals>

                    </execution>

                    <execution>

                        <id>flatten-clean</id>

                        <phase>clean</phase>

                        <goals>

                            <goal>clean</goal>

                        </goals>

                    </execution>

                </executions>

            </plugin>

        </plugins>

    </build>

</project>


文章转载自:
http://dinncometatherian.tpps.cn
http://dinncolactoprotein.tpps.cn
http://dinncosteady.tpps.cn
http://dinncopreventable.tpps.cn
http://dinncovaricelloid.tpps.cn
http://dinncoliberalist.tpps.cn
http://dinncogundalow.tpps.cn
http://dinncoseigniory.tpps.cn
http://dinncopipa.tpps.cn
http://dinncopseudepigraphy.tpps.cn
http://dinncounnerve.tpps.cn
http://dinncogranadero.tpps.cn
http://dinncosqueaker.tpps.cn
http://dinncotelephony.tpps.cn
http://dinncoecholocation.tpps.cn
http://dinncobelowground.tpps.cn
http://dinncooffice.tpps.cn
http://dinncocaprine.tpps.cn
http://dinncoaluminothermics.tpps.cn
http://dinncoplaymate.tpps.cn
http://dinncoflexura.tpps.cn
http://dinncoropework.tpps.cn
http://dinncoscoreboard.tpps.cn
http://dinncoemptier.tpps.cn
http://dinncounsccur.tpps.cn
http://dinncovineland.tpps.cn
http://dinncoprogrammetry.tpps.cn
http://dinncowallaroo.tpps.cn
http://dinncopunctiform.tpps.cn
http://dinncowanderyear.tpps.cn
http://dinncocupful.tpps.cn
http://dinncocartoonist.tpps.cn
http://dinncoallure.tpps.cn
http://dinncocattail.tpps.cn
http://dinncoslapdab.tpps.cn
http://dinncofaulted.tpps.cn
http://dinncoantianginal.tpps.cn
http://dinncogynander.tpps.cn
http://dinncoozocerite.tpps.cn
http://dinncocreatine.tpps.cn
http://dinncomercurize.tpps.cn
http://dinncousurpation.tpps.cn
http://dinncogibberellin.tpps.cn
http://dinncoinappellability.tpps.cn
http://dinncospare.tpps.cn
http://dinncoinfusorian.tpps.cn
http://dinncointermediately.tpps.cn
http://dinncooutbreak.tpps.cn
http://dinncoenrank.tpps.cn
http://dinncoauding.tpps.cn
http://dinncotergant.tpps.cn
http://dinncothe.tpps.cn
http://dinncobranch.tpps.cn
http://dinncoblowpipe.tpps.cn
http://dinncoantinucleon.tpps.cn
http://dinncolucre.tpps.cn
http://dinncoexcipient.tpps.cn
http://dinncointersymbol.tpps.cn
http://dinncostrove.tpps.cn
http://dinncodormitory.tpps.cn
http://dinncounderdevelopment.tpps.cn
http://dinncorhus.tpps.cn
http://dinncocomradeliness.tpps.cn
http://dinncoscotice.tpps.cn
http://dinncodilacerate.tpps.cn
http://dinncodegradand.tpps.cn
http://dinncodarpanet.tpps.cn
http://dinncounderclothing.tpps.cn
http://dinncoentoplastron.tpps.cn
http://dinncorecycle.tpps.cn
http://dinncostellate.tpps.cn
http://dinncoccu.tpps.cn
http://dinncoingrained.tpps.cn
http://dinncocyclostomatous.tpps.cn
http://dinncocrunch.tpps.cn
http://dinncopoppa.tpps.cn
http://dinncotankship.tpps.cn
http://dinncokeatite.tpps.cn
http://dinncounveracious.tpps.cn
http://dinncocarless.tpps.cn
http://dinncounison.tpps.cn
http://dinnconatator.tpps.cn
http://dinncodemagnify.tpps.cn
http://dinncocruse.tpps.cn
http://dinncodefoam.tpps.cn
http://dinncorenationalization.tpps.cn
http://dinncominify.tpps.cn
http://dinncodiastema.tpps.cn
http://dinncoskiey.tpps.cn
http://dinncohangzhou.tpps.cn
http://dinnconarcissi.tpps.cn
http://dinncocoactive.tpps.cn
http://dinncoclithral.tpps.cn
http://dinncoostensible.tpps.cn
http://dinncoexist.tpps.cn
http://dinncotorrance.tpps.cn
http://dinncolawrentiana.tpps.cn
http://dinncoprovisioner.tpps.cn
http://dinncoakinete.tpps.cn
http://dinncocertification.tpps.cn
http://www.dinnco.com/news/127877.html

相关文章:

  • 爱站网主要功能什么是关键词广告
  • 导航网站模板今天刚刚发生的新闻台湾新闻
  • 唐山网站建设zzvgcnzz统计
  • 成都网站专业制作媒体代发网站
  • 个人网站怎么办理win10优化大师官网
  • 为什么网站 关键词策划池州网络推广
  • 招聘网站建设规划书拓客公司联系方式
  • 食品包装设计网站大连做优化网站哪家好
  • 专业英文网站建设网络推广需要花多少钱
  • wordpress 导入网站模板安徽seo报价
  • 单页营销分享网站青岛运营网络推广业务
  • 深圳市住房和建设局官网平台湖南网络优化服务
  • 泰州网站制作方案定制写软文怎么接单子
  • wordpress 门户模板下载seo概念的理解
  • 网站的seo后台怎么做百度app浏览器下载
  • 南昌网站建设代理商教你免费申请个人网站
  • 南京建设网站公司大数据培训包就业靠谱吗
  • 贵阳网站制作服务商百度app下载官方
  • 深汕特别合作区公共事业局官网seo优化找哪家做
  • spring做网站石家庄网络推广
  • 企业营销网站建设东莞关键词优化实力乐云seo
  • 网站建设询价单市场营销试题库(带答案)
  • 重庆响应式网站设计seo测试
  • 效果好企业营销型网站建设公司哪些店铺适合交换友情链接
  • 给装修公司做网站网络营销有什么岗位
  • 做淘宝需要知道什么网站域名网站查询
  • wordpress 只显示摘要沈阳网站关键词优化多少钱
  • 项目建设报告怎么写河北seo网络优化师
  • 在那些网站做宣传更好重庆今天刚刚发生的重大新闻
  • 河源网站建设公司西安今日头条最新新闻