Eclipse uploads git remote repository and adds Maven Dependencies

Source: Internet
Author: User

Objective:

Meet the problem, the company a computer, home a computer, when there are projects in progress, do not want to take the computer back to the back, like a person playing a stand-alone, this time git can help you solve the problem. When Git is ready, the new problem comes with a git download that doesn't have a package associated with it, and it's time to convert the previous project into a MAVEN project. This only needs to download the Pom.xml inside, you can download the relevant package yourself.

Git configuration, with upload:

By default you have your own account password on GitHub and are configured directly on Eclipse.

1. Add the Egit tool.

There is a problem, some people want to find out what is the difference between egit and Jgit, I just started to think, since there are two options, I want to find out which one is more appropriate,
Egit is a self-contained eclipse that can be added directly to eclipse.
Jgit is a standalone, version-control system for a new type of EDL (new BSD) Java library.

  Help--eclipse marketplace--Search Egit Direct installation on the line

  

2. Right-click on the project, select Team--shareproject, choose git (This step is to configure Git)

New project If there is a previous project, it will automatically go to the previous path, this time we need to create a project ourselves below (directly in the first line to enter the path point finish).

  

3. Add success, Direct Project right button, select team inside, this time will appear a series of directories, select the top commit is submitted.

  

  

4. Create a project in the project, do not create also can, and then click Commit cannot submit, display the following interface, this time directly point commit will appear error, right-click File, choose Add to Index, the file to the following, you can commit.

  

This will do the job.

  

  Next

  

Just jump out of the box and lose your GitHub account password, this time will be error, directly on Eclipse create the same name file on the line

  

The upload was successful!

  

Follow the prompts and follow the steps to the next step of the line ~

Then right-click on the project and--team--push on to GitHub.

  

Construction of MAVEN Project

About Maven I don't quite understand what the whole thing is, just use it first.

1. Right-click Project--configure--Select Covert to Mavenproject, directly point to finish, the directory structure will be more pom.xml files, this is the most critical configuration file, jar package is configured inside.

2. Now what jar package is not, if there is a corresponding jar package, you can find http://www.mvnrepository.com/at this URL.

For example I want to add the Gson package.

  

  

changes in Pom.xml

Ago:

<Projectxmlns= "http://maven.apache.org/POM/4.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  <modelversion>4.0.0</modelversion>  <groupId>Testgit</groupId>  <Artifactid>Testgit</Artifactid>  <version>0.0.1-snapshot</version>  <Build>    <sourcedirectory>Src</sourcedirectory>    <Plugins>      <plugin>        <Artifactid>Maven-compiler-plugin</Artifactid>        <version>3.7.0</version>        <Configuration>          <Source>1.8</Source>          <Target>1.8</Target>        </Configuration>      </plugin>    </Plugins>  </Build></Project>

After:

   

After waiting, you can see that the package is automatically injected, which is also the most basic maven operation.

Git pull, download:

Another computer can appear to download code, directly to work, the steps are as follows

1. Direct import--Select Git--projecs from Git--clone Url (this is obtained directly from the Internet, do not pull to the local) 2. The familiar interface, or the above to be cloned from the code, fill it out directly download it.

  

For the time being first so much, basically realize the function, but this will be an error, the following will collect these problems, listed and resolved.

  

Eclipse uploads git remote repository and adds Maven Dependencies

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.