Saturday, November 12, 2016

How to use GitHub as Maven Central Repository



Hello Techieenthu.

Here in this post I'm going to give you a small demonstration about...How to use GitHub as Maven central repository.

It is quite easy to get the required "Dependencies" from maven central repository. But every maven user could face  a situation to get their own Dependencies from central repository. So, by that time there should be a ready made repository. If the ready made repository is not available, then it is not possible to get the customized dependency. In that situation, we can use GITHUB as central repository.

Please follow the below  mentioned folw:

Pre Requisities:
  • Repository in GitHub
  • Maven Project
  • JAR..for which you want to create dependency.
 Step 1:

  1.  Create a repository in GitHub. And place the jar file in that repository in the below given order(see image).


    2. What the details I have mentioned in the Dependencies and Repositories tags are very important. Based on the information we mentioned in the Dependencies and Repositories only Maven will contact with the jar.
    Note: Every detail, even version number also should be mentioned, and the version number should be in the order like: 1.1.1
    Note: In Repositories tag, <id>git-prasad119</id>..here Prasad119 is the GitHub user name.
    Please click on the below link to navigate to the repository where the project is available:

    Please click on the below link to navigate to the repository where the dependency jar is placed:


    • After adding the Dependency and Repositories to your pom.xml, Maven will automatically downloads the dependency jar. Please see the below image to understand the path.

    Hope.....It is very useful for those who wants to use GitHub as central repository.


    Please like the post, If it is useful

    Thanks,
    Prasad. 



    No comments:

    Post a Comment