/ maven

Use github as maven repo

I want to find some free maven repo to store my jar files, but no good cadidate. After some googling there are some docs for make github as maven repo.
ref docs:


below is my steps:

  1. create a github project as maven repo, the name like "maven-repo".
    eg. I have a repo https://github.com/yren/maven-repo

  2. Use the github site-maven-plugin to push your artifacts to github

2.1 First let maven deploy artifacts to your local target directory. Add below to your pom.xml:

      <name>Temporary Staging Repository</name>

Now try running mvn clean deploy. You'll see it deployed to your local target/mvn-repo

2.2 The next step is upload that directory to GitHub

a. Config your ~/.m2/settings.xml , add a github server as below:

<!-- Note: settings.xml only in your local machine. Don't let anyone know your github pwd -->

Note: settings.xml only in your local machine, don't let anyone know your github pwd!!!

b. Config github site-maven-plugin upload artificats to github. add blow to your project's pom.xml

          <!-- git commit message -->
          <message>Maven artifacts for ${project.name} ${project.version}</message>

Now run mvn clean deploy again. You should see maven-deploy-plugin upload contents to github maven-repo

  1. Use you github repo dependency, in your project's pom.xml add below: