简体   繁体   English

GitHub为Maven项目添加外部库

[英]GitHub add external library for maven project

I want to build my project to use maven, but I have an external library in dependencies. 我想构建我的项目以使用Maven,但是我有一个依赖的外部库。 I found an info about how to do it. 我找到了有关如何做的信息。 http://cemerick.com/2010/08/24/hosting-maven-repos-on-github/#fn2 It works perfect for libraries which are built in maven. http://cemerick.com/2010/08/24/hosting-maven-repos-on-github/#fn2对于在maven中内置的库,它是完美的选择。 I checked it. 我检查了 :) But when I started to do it I encountered with problems. :)但是,当我开始这样做时,我遇到了问题。 All libraries should have strict structures like meta-info.pom and so on. 所有库都应具有严格的结构,例如meta-info.pom等。 I don't know how to generate this files for external libraries. 我不知道如何为外部库生成此文件。 Could you possibly help me with it? 你能帮我吗? Yours faithfully. 您忠诚的。

This is actually very commonly done. 实际上,这通常是很常见的。 Many OSS libraries that are not in "Maven Central" are available as Maven repositories hosted on Google Code. 许多不在“ Maven Central”中的OSS库都可以作为托管在Google Code上的Maven存储库使用。

The way you do this is by configuring the "SCM Wagon" for your <distributionManagement> configuration. 为此,可以通过为<distributionManagement>配置配置“ SCM Wagon”。 If you manually build the directory structure, it's not enough. 如果您手动构建目录结构,那还不够。 You should use the approach outlined in the linked blog post and here: Maevn Wagon SCM 您应该使用链接的博客文章和此处概述的方法: Maevn Wagon SCM

One of the sections is entitled "Deploying your Maven site to GitHub's gh-pages." 其中一节的标题为“将Maven站点部署到GitHub的gh-pages”。 I suspect this is exactly what you're looking for. 我怀疑这正是您要寻找的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM