Maven:非官方工件命名方案?

发布于 2024-09-02 12:19:50 字数 263 浏览 3 评论 0原文

我正在为我们的项目的各种依赖项创建一些 Maven 工件,虽然我对组/工件 ID 进行了最佳猜测,但我想添加一些内容来将它们标记为“非官方”并由我们创建用于编译,因此,如果我们将来找到同一事物的官方来源,就不会造成混淆,我们可以简单地更改为指向标识符。是否有最佳/常见/推荐的做法?

我只是想设置 groupId="org.providername.unofficial" 之类的东西,但由于 Maven 都是关于“按照我们的方式做”,我只是想看看是否有不同的先例。 。

I'm creating some Maven artifacts for various dependencies for our projects, and while I'm taking my best guess at group / artifact IDs, I'd like to add something to flag them as "unofficial" and created by us for compilation, so that should we find official sources for the same thing in the future there's no confusion and we can simply change to point to the identifiers. Is there a best/common/reccomended practice for doing so?

I was just thinking something like setting groupId="org.providername.unofficial", but since Maven's all about "doing it our way" I just want to see if there's a precedent for something different already...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云仙小弟 2024-09-09 12:19:50

Maven 协调唯一标识任何工件,包括 groupId、artifactId 和 version。因此,更改其中任何一个都可以让您将您的工件与其他工件区分开来。但是,如果您希望能够使用您的版本而不是标准工件作为其他组件的依赖项之一,则必须保留相同的 groupId 和 artifactId,否则您必须处理该依赖项中的排除项。因此,最好只更改版本,例如添加一些限定符,例如 1.0mycompayname。

Maven coordinates to uniquely identify any artifact include groupId, artifactId and version. So, changing any of those would allow you to differentiate your artifact from other one. However if you want to be able to use your version instead of a standard artifact as one of the dependencies of some other component you would have to keep the same groupId and artifactId, or else you'd have to deal with excludes in that dependency. So, for that is would be the best to change just version, e.g. add some qualifier like 1.0mycompayname.

眼趣 2024-09-09 12:19:50

是否有最佳/常见/推荐的做法?

据我所知,没有官方推荐的做法(因为工件毕竟是非公开的),但我发现使用标志是一个好主意,我们也使用(带有“内部”限定符),并且我们还放置了这样的标志我们的存储库管理器的特殊“第三方”组中的工件。

Is there a best/common/recommended practice for doing so?

To my knowledge, there is no official recommended practice for this (since the artifacts are non public after all) but I find that using a flag is a good idea that we also use (with an "internal" qualifier) and we also put such artifacts in a special "third-party" group of our repository manager.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文