Use GitHub as a MAVEN repository to publish your own jar packages rely on implementing a set of common parts of multiple projects, avoiding the duplication and pasting of code between multiple projects in your team

Source: Internet
Author: User

Using GitHub as a MAVEN repository to publish your own jar packages relies on implementing a set of common parts of multiple projects, avoiding the copying and pasting of code between multiple projects in your team.

1, first in the local MAVEN location configuration file Setting.xml (without the file on the new file), add the configuration Maven warehouse address. I'm using my GitHub warehouse as a maven repository.

2. Add the MAVEN deployment plugin Maven-deploy-plugin to the project and configure the path, my path is mvn-pro under Target, deployed with Maven clean and deploy.

You can then compile the deployment to find the resulting deployed file in target. I used the idea IDE's MAVEN operation. You can also use MVN clean deploy I'm not familiar with the path of the MVN operation directly in the IDE.

After compiling, build the deployment file as follows:

3. Add the specified GitHub global server to the project

4, add plug-in Site-maven-pligin, because I set the mirror is Ari image, found that there is no plug-in mirror Site-maven-pligin, the introduction of a long and unsuccessful,

After changing the image, and go to projectstruct to add the dependent search plugin, find the plug-in, as well as the correct version 0.12, the plugin version error in the figure.

Add plug-in dependencies to your project

5, clone of the warehouse on GitHub Https://github.com/Jordan150513/maven-repo.git to the local target under the Mvn-repo. So Mvn-repo is a local git repository,

Then the MAVEN clean deploy is executed, and the resulting deployment file is in the local repository, and git push is far away.

Use of private libraries

6. Specify the MAVEN warehouse address of the custom dependency package

Add a custom dependency

Can.

Use GitHub as a MAVEN repository to publish your own jar packages rely on implementing a set of common parts of multiple projects, avoiding the duplication and pasting of code between multiple projects in your team

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.