Amoy Mall based on Maven and SVN's understanding

Source: Internet
Author: User
Tags version control system

Start by understanding what Maven and SVN are:

MAVEN is a project management tool that contains a project object model, a set of standard collections, a Project Lifecycle (Project Lifecycle), a dependency management system (Dependency Management System), and the logic used to run the plug-in defined during the life cycle phase. When you use MAVEN, you use a well-defined project object model to describe your project, and maven can apply crosscutting logic that comes from a set of shared (or custom) plug-ins. Maven has a life cycle that is called when you run the MVN install. This command tells Maven to perform a series of sequential steps until it reaches the life cycle you specify. One of the implications of traversing the life cycle journey is that Maven runs many of the default plug-in targets that work like compiling and creating a JAR file. In addition, MAVEN can easily help you manage project reports, build sites, manage jar files, and more. Personal Understanding: (1) Maven can implement management of a project, and its pom.xml file marks this project as a MAVEN project. (2) It can implement the management of the jar package, the management of the jar package is automatically downloaded by Maven, the most commonly used is the central repository of MAVEN, previously introduced HTTP// Search.maven.org, where you can search for the desired jar package and the version of the jar package, and add it directly to Maven's Pom file. (3) When a project is more complex, we can adopt a distributed architecture, this time we need to build multiple projects, and the various projects are dependent, so that we need MAVEN to manage these projects, and ultimately achieve the overall project operation. You can implement a project's overall build package and release. (4) Maven Project type: War package (ie, Web project, project based on this package, represents a Web project) jar package (Java Engineering) POM Project (This is an aggregation project, dependencies for each project) MAVEN usage in eclipse: Currently the latest version of Eclipse has its own Maven plugin, so we don't need to install the plugin, we only need to modify MAVEN's warehouse, MAVEN's warehouse is generally named M2, There are usually files in the native computer users.

Windows/preference/maven in Eclipse can view maven, where you can view MAVEN's warehouse address

When we accumulate the jar packages needed for the project when we are doing multiple projects, we can directly overwrite Maven's local repository, which stores the jar packages it relies on.

In the project directory, you will often see a subdirectory named/lib, where various third-party dependent jar files are stored, such as Log4j.jar,junit.jar, and so on. For each project you build, you need to create such a/lib directory, and then copy a pair of jar files, which is obviously duplicated. Repetition is always the starting point for nightmares, and multiple projects that do not share the same jar files will not only result in wasted disk resources, but also make consistency management of versions difficult. Also, if you use version management tools such as SVN (you are not using the version management tool?). Try SVN now, it can help you solve a lot of headaches, you need to submit a large number of jar files to the code base, but the version management tool in the processing of binary files is not good.

The Maven repository is where all the jar files (war,zip,pom, etc.) are placed, and all MAVEN projects can get the dependency jar they need from the same MAVEN repository, which saves disk resources. In addition, because all jars in the Maven repository have their own coordinates, the coordinates tell maven its group ID, artifact ID, version, packaging method, and so on, so MAVEN projects can be easily dependent on version management. Neither do you. To submit the jar file to the SCM repository, you can create an organization-level MAVEN repository for all members to use.

In short, maven repositories can help us manage artifacts (primarily jars).

At this point we can directly overwrite Maven's warehouse and become the jar package that our project depends on.

Coming soon: C:\Users\Administrator\.m2. M2 folder is overwritten. Let's take a look at what's underneath this folder:

Later, if we have a new jar package, we can create a. m2 folder ourselves and then overwrite the MAVEN local repository to use in the project.

Next we look at the use of SVN:

What is SVN?

SVN is the abbreviation for Subversion, is an open source version control system, compared to RCS, CVS, it uses the branch management system, its design goal is to replace CVS. Many version control services on the Internet have migrated from CVs to subversion.

Easy to say. SVN is used for many people to jointly develop the same project, the purpose of sharing resources, to achieve the convenience of multi-person development projects, programmers can modify the code through SVN, other programmers can see the modified content, to achieve the synchronization of code, the daily submission of their own code, with real-time.

SVN installation and use in eclipse:

Installation: During the installation of SVN, we encountered a few episodes and we came to the specific look at SVN:

First we need to download the SVN server,

Open this server and we can see

Our future project upload is uploaded to this server, where you can create a branch user, that is, multiple users access to this server.

Then install SVN in eclipse:

Here we learn from: There are two main ways, one is to overwrite files, one is to install online. The issue with version compatibility here is that we want to download the latest SVN, which is compatible with our latest eclipse.


If not installed please download the installation here: http://eclipse.org/downloads/

2. Download the SVN plugin subclipse, there are two ways to install it. The green way to install the link way I tried on indogo many times was unsuccessful.

3, SVN plugin and update address, you need to choose the version you need. Now the latest is 1.8.x
Links for 1.8.x Release:
Eclipse Update Site url:http://subclipse.tigris.org/update_1.8.x
SVN plugin package Download: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

Links for 1.6.x Release:
Eclipse Update Site url:http://subclipse.tigris.org/update_1.6.x
SVN plugin package Download: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

Links for 1.4.x Release:
Eclipse Update Site url:http://subclipse.tigris.org/update_1.4.x
SVN plugin package Download: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

4. Download the plug-in package and copy the plug-in package to the Eclipse installation directory. See figure

After downloading the plugin package directory structure:



Copy the files in the plug-in package features and plugins directories to the features and plugins of the Eclipse installation directory, respectively. And then restart Eclipse.



5. Install through eclipse, see figure








Then go all the way to Next, OK!!

Add an item to the repository

To add a new project to the Subversion repository, right-click the project (available in any Eclipse project view or Navigator view) and select Team > Share project from the menu. Eclipse Displays the Share Project dialog box.



Select SVN from the list of repositories currently supported by Eclipse and click Next. The next dialog (see Figure 13) lets you select an existing repository location, or create a new location.

This will enable the project to be uploaded.

For projects submitted to SVN, we need to note that we only have to submit src files and pom.xml files, others can be ignored.

Submit the project to SVN, if we download it down and discover not MAVEN project, we need to convert under:

The MAVEN project has a m icon above it.

Right-click Project-configure-convert to Maven project

Can.


Amoy Mall based on Maven and SVN's understanding

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.