Avoiding maven repository version collision when using feature branches

前端 未结 4 1601
粉色の甜心
粉色の甜心 2021-02-04 07:54

Question: How do you handle feature branches for maven multi project builds?

Jenkins builds and deploys these branches to keep build overhead on develop

4条回答
  •  隐瞒了意图╮
    2021-02-04 08:40

    This does not work Results in warnings throughout the build and GC error when run from top parent.

    Ideally, we want to use version as to differentiate feature branch from mainline because it is the normal maven way and classifier manipulation can result in all kinds of issues.

    Since maven can use environment variables for properties and we already initialize build environment with a script (we also have git hook scripts that can set environment variables from branch names) we can use env to control the version.

    my.project
    database
    1.2.0${env.BRANCHMODIFIER}-SNAPSHOT
    

    If on develop our scripts set BRANCHMODIFIER to ""
    If on feature/JIRA-30495 our scripts set BRANCHMODIFIER to ".30495"

    How does this work in eclipse or Intellij? No clue as of yet.

提交回复
热议问题