My Maven project has 2 snapshot dependencies. I need the latest snapshot for dependency A available in the remote repo and at the same time, the version of snapshot dependency B available in my local ~/.m2 repo.
Snapshot depedency B is in the remote repo as well, but my CI job needs to use the locally built instance of this snapshot dependency. Therefore, there is no timestamp on the snapshot so its file path is ~/.m2/repository/groupId/artifactId/1.0.0-SNAPSHOT/artifactId-1.0.0-SNAPSHOT.tar.gz
Due to the split requirement, solutions like --no-snapshot-updates
and configuring settings.xml aren't doing the trick.
Any suggestions?
UPDATE: This works by default if the locally generated snapshot is less than 24 hours old. I'm not sure what I had misconfigured during my original experimentation. It turns out that the local version of snapshot B is used since its' filesystem last updated time is less than 24 hours old. Snapshot A does not exist in the local repo so it is fetched from the remote repo as expected.