I've got a scenario where I have a project E whose sources are used by another project G, and the version of E's sources to be used by G needs to be controlled, it should not always use the latest version. Pinning of E is an acceptable model, as would labels/tags be, as long as there's a way to reference a unique one, most likely the latest one.
Initially I set up an Artifact Dependency from G to E, using the latest pinned build, but I don't actually need the build output, I just need the sources, as project G will be building a subset of the original code for a different platform. G contains its own source code, which relies heavily on E's. (Essentially, if E builds and the tests passes, it's a candidate for use by G, but not before I say so)
So, my question is, what kind of dependency setup would allow me to pull E's sources from a corresponding pinned build, into each build of G? VCS roots don't seem to offer any kind of pinning.
To complicate the matter, E does generate artifacts, for other purposes, and including all the sources there would "contaminate" the output.