我对Maven和Nexus来说非常新(ish),并且因为将Github Commits与Nexus文物联系起来而陷入困境 .

我需要能够将分支名称或提交ID映射到Nexus中构建的特定人工制品,因为我希望能够为代码存储库中的特定分支下拉特定的包 . 我们使用Jenkins作为CI工具 .

我目前的想法是;一旦Maven将人工制品部署到Nexus,我们就可以用部署的人工制品的哈希来标记Git Commit . 然后通过使用哈希和项目名称查询Nexus API,我们可以获得artefact的版本并通过curl请求获取它 .

我对这种方法有很多疑问,但现在最大的问题是:

Is it possible to 'return' the hash when using Maven to build and deploy artefacts to Nexus. 'Returning' just being the ability to get it somehow and use it in a curl request later on in the build process.

这种将Github映射到人工制品的方法是否有意义?

如果是这样,有没有人对哈希问题有任何想法?

谢谢