I'm using jgitver library to automatically generate semver using state of the Git repository.
I have a multi module project where modules are interdependent, meaning if I make change to one module then other modules should start referring to the new version of the changed module.
All the modules are in the same Git repository, so any change in the Git changes the version of all modules. Following is an example of my project structure
.git (Common repository)
module1
common-module
pom.xml (Parent POM)
Following is an example of how I have included a dependency module
<-- POM of module1, includes common-module-->
<dependency>
<groupId> com.test</groupId>
<artifactId>common-module</artifactId>
<version>1.0.0</version> <!-- version generated by jgitver -->
</dependency>
Since at any time version generated by jgitver
would be same for module1
and common-module
, as they're in the same Git repository, I don't want to hard code the version across all modules. As if the version changes then I would have to manually change the version in all modules for common-module
dependency.
Is there a variable like ${project.version}
that can be used to refer to current version generated by jgitver
?
I'm hoping to configure the module1
as below
<dependency>
<groupId> com.test</groupId>
<artifactId>common-module</artifactId>
<version>${JGITVER_GENERATED_VERSION_VARIABLE}</version> <!-- version generated by jgitver -->
</dependency>