markdown 如何在github上创建自己的maven存储库

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何在github上创建自己的maven存储库相关的知识,希望对你有一定的参考价值。

# How to create a maven repository for your github project step by step

## Clone your project in a separate folder

(note: replace `ORGANIZATION` and `PROJECT`)

`git clone git clone git@github.com:ORGANIZATION/PROJECT.git my-repository`

## Cd into it

`cd my-repository`

## Create a new branch (here named repository)

`git branch repository`

## Switch to that branch

`git checkout repository`

## Remove all files

`rm -rf file1 file2 file3 .. etc`

## Install your jar in that directory

(note: replace `YOUR_GROUP`, `YOUR_ARTIFACT`, `YOUR_VERSION` and `YOUR_JAR_FILE`)

```bash
mvn install:install-file -DgroupId=YOUR_GROUP -DartifactId=YOUR_ARTIFACT -Dversion=YOUR_VERSION -Dfile=YOUR_JAR_FILE -Dpackaging=jar -DgeneratePom=true -DlocalRepositoryPath=.  -DcreateChecksum=true
```

`YOUR_JAR_FILE` should point to an existent jar file, this is why it's best to create your repository branch in a different folder, so you can reference the existing jar in `/your/project/path/target/artifact-x.y.z.jar`

## Add all generated files, commit and push

`git add -A . && git commit -m "released version X.Y.Z"`

`git push origin repository`

## Reference your jar from a different project

The repository url you just created is https://raw.github.com/YOUR_ORGANIZATION/YOUR_ARTIFACT/repository/

以上是关于markdown 如何在github上创建自己的maven存储库的主要内容,如果未能解决你的问题,请参考以下文章

GitHub 上隐藏的 markdown 文本

markdown 在github上创建gh-pages分支

markdown 如何在Github Markdown文件上添加公式

如何用markdown编辑器排版github个人项目创建

markdown 如何使用Jekyll在GitHub页面上嵌入Gist的示例。

markdown 如何使用Jekyll在GitHub页面上嵌入Gist的示例。