如何在maven上安装GitHub项目?

时间:2014-08-20 18:17:18

标签: git maven github maven-central

简单明了。

我在Github.com上有一个开源项目,人们要我添加maven支持。 由于我对maven不是很熟悉,所以我真的不知道该怎么做。

如何为我的项目添加maven支持?如何将项目上传到maven central?

另一个问题:为什么人们想要我的项目在maven,因为他们可以非常方便地在github上克隆它?

1 个答案:

答案 0 :(得分:2)

Mavenizing现有Eclipse项目的一般指南

Create an empty Maven project of the same type as your original project (i.e. jar, war…) using the appropriate archetype.
cd into the project directory that you just created and which now has a pom.xml file for your project.
Run mvn eclipse:eclipse -DdownloadSources=true in this directory.
Import the Maven project into Eclipse
Move the original project’s source code and resources into the new Maven project structure.
Get all your classpath dependencies into your pom.xml

您可以按照以下指南对项目进行整理:

http://www.mkyong.com/maven/how-to-convert-java-web-project-to-maven-project/

人们在Maven中想要它,因为:

http://www.kyleblaney.com/benefits-of-maven-over-ant/