在 Maven 项目中使用 Hive
我有一个项目正在从 ant 迁移到 Maven。该项目使用轻度定制的 Hive 构建。我想我只需将此构建导入到我们的内部 Maven 存储库中,并将其列为项目 pom 文件中的依赖项。我遇到的问题是 Hive 构建只是在 build/dist/lib 中生成一堆 jar。其中一些是 Hive 本身的核心 jar,一些是 Hive 所依赖的 jar。处理这些问题的最佳方法是什么?我是否应该将所有核心 hive jar 放入我们的内部存储库中,并只处理新项目的 pom 文件中未记录的依赖项?或者只是将所有内容打包成一罐罐子并将其部署到存储库?这种方法有效吗?仍然是一个行家新手,感谢您的帮助。
I have a project that I am migrating from ant to maven. The project makes use of a lightly-customized Hive build. I figured I would just import this build into our internal maven repo and list it as a dependency in the project's pom file. The problem I'm running into is that the Hive build just generates a bunch of jars in build/dist/lib. Some of these are the core Hive jars themselves and some are jars that Hive depends on. What's the best way to deal with these? Should I put all the core hive jars into our internal repo and just deal with undocumented dependencies in the new project's pom file? Or just jar up everything as a jar of jars and deploy that to the repo? Would that approach even work? Kind of a maven newbie still, thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该为修改后的 Hive 构建创建一个 POM,并将其与 jar 一起部署到您的内部工件存储库。这个 POM 应该指定任何依赖项(即那些其他 jars)。如果其中一些也是自定义版本,您也应该为它们创建 POM,否则只需使用标准的公共 groupId/artifactId。这就是 Maven 方式。请注意,您不一定需要使用 POM 来构建 Hive,只需在部署期间即可。
为什么你应该这样做:
对于 Maven 来说,最好的事情总是告诉它正在发生的一切。不要试图告诉它你认为它想听的内容。
You should create a POM for your modified Hive build, and deploy it to your internal artifact repo along with the jar. This POM should specify any dependencies (i.e., those other jars). If some of those are also custom versions, you should create POMs for those as well, otherwise just use the standard public groupId/artifactId. This is the Maven way. Note that you don't necessarily need to use the POM for building Hive, just during deployment.
Why you should do this:
The best thing for Maven is always if you tell it everything that is going on. Don't try to tell it what you think it wants to hear.