java - How should I retrieve the latest version of a Maven project for contract testing? -
we're using maven , nexus distribute components (maven projects) inside our infrastructure. sake of argument, let's have 2 teams: team foo , team bar; , component bar depends on component foo.
team bar wants write contract tests checking if component foo
behaves expected. tests run every night against latest stable development version of project foo
(git master after ci). team bar write maven project bar/pom.xml
depends on latest version of foo
? how can go doing that?
we're playing idea of solving through version naming. name under development version master-snapshot
(or something) , instead of version label going 0.1-snapshot -> 0.1 -> 0.2-snapshot -> 0.2
, go master-snapshot
, master-snapshot -> 0.1 -> master-snapshot -> 0.2
. contract testing project bar
declare dependency foo
com.acme:foo:master-snapshot
.
but seems clunky (breaks common maven practice , stuff)... there more standard practice kind of thing? should use maven versions plugin? should inject latest version string maven project outside? or maybe ditch maven altogether?
a contract test module has strong relationship module implementing contract.
thus, recommend evolve both modules alongside each other within parent project.
make foo
, bar
modules of multi-module maven project. make bar
depend on foo
suggested yourself. assign both same version ${parent.version}
. implies use ${parent.version}-snapshot
in between releases.
keep evolving , releasing project single module, preferably using maven-release-plugin
on release. raise versions of modules concurrently part of release:prepare
goal.
Comments
Post a Comment