Thanks for the feedback.
Maybe I can clarify what I am trying to do. I was not trying to pass/inject anything to into a child/sub-module project, I was wanting to extract version information from a child. Also, I don't think I am failing the
Ulan Bator test - all the projects (common, auth-interface, auth-common, and auth-service in my case) can be built in any generic environment with Maven and JDK 11 installed.
What I am trying to do, is use Maven as a generic build tool, where in addition to building the
Java projects, is also used to create a container image, and then export the container image as a compressed file, which can then be delivered-to and imported-into a target platform. To do this, I created a Maven
builder (aggregation) project which besides building the application (and its dependencies), also performs additional processing using the
maven-antrun-plugin plugin to execute some bash scripts included in the project. This
builder project
does have platform dependencies such as
bash,
gzip,
podman, etc., but the
builder project is used in a engineering/dev-ops function, not a software development function.
I want to
tag the container image and name the compressed image with the version of the application (auth-service in my case), regardless of which version it is. That is why I wanted to try and
peek into the child project. For example:
podman build -f ./src/main/docker/Dockerfile.jvm --tag auth-service:1.0.2 --label profile:jvm .
podman save auth-service:1.0.2 | gzip -c > ./target/auth-service_1.0.2.gz
Using Maven, the build process only requires a single command line:
mvn package -P jvm or mvn package -P native , which is convenient, but maybe Maven is the wrong tool for this job? If there are any suggestions (maybe tools which can help with the whole
build-deliver-install-configure-activate-monitor cycle), I would really appreciate hearing what tools are commonly being used and related best practices.
Regarding departmental/corporate Maven and container image repositories, the use of snapshots, and continuous integration: those are all end goals which I am working towards.