【问题标题】:How to put a GitHub project on maven?如何将 GitHub 项目放在 maven 上?
【发布时间】:2014-08-20 18:17:17
【问题描述】:
简单明了。
我在 Github.com 上有一个开源项目,人们要求我添加 maven 支持。
由于我对maven不是很熟悉,所以我真的不知道该怎么做。
如何为我的项目添加 Maven 支持?如何将我的项目上传到 maven Central?
另一个问题:为什么人们希望我的项目放在 maven 上,因为他们可以很方便地在 github 上克隆它?
【问题讨论】:
标签:
git
maven
github
maven-central
【解决方案1】:
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
您可以按照以下指南对您的项目进行 mavenizing:
http://www.mkyong.com/maven/how-to-convert-java-web-project-to-maven-project/
人们希望在 Maven 中使用它,因为:
http://www.kyleblaney.com/benefits-of-maven-over-ant/