Java Development Environment Deployment-maven under Eclipse

Source: Internet
Author: User
Tags svn svn client

I have been engaged in Java development for many years, since 2012 contact Maven, feel the pros and cons,

Convenient place everyone knows that the program depends on those packages, as long as the pom.xml inside write a dependency on the configuration is good

Sometimes the program is huge, the development of more people, if the dependence of no control and management, each write a set, then you will find that you rely on a lot of different versions of the package, looks very messy, for the code of cleanliness I can not bear.

This building environment is mainly for the future development of some Java-related demo as a cushion.

Deploying such a set of environments requires the following software:

Jdk1.6.0_24

ECLIPSE-JEE-KEPLER-SR2-WIN32-X86_64 (64 bits of my machine so download 64 bit)

apache-maven-3.0.5

The SVN plugin in eclipse (please look for the installation method online)

There's also a fantastic tool for follow-up introduction

The installation process is not described, in which MAVEN is added to the environment variable:

This defines the maven_home and then joins the bin directory to the path

Add a digression: Why don't I set the JDK environment variable here? Because I'm used to java_home this attribute to some of the application's startup files. Like Maven, I set this up.

In the Bin folder under the Maven directory, modify Mvn.bat to add the following two lines of settings:

Set Files\java\jdk1.6. 0_24 Set Maven_opts=-xms128m-xmx512m-dfile.encoding=utf-8

Set Java_home and memory character set properties

After you've set up these things, make Maven a simple configuration.

Set the%maven_home%/conf/settings.xml as follows

<?XML version= "1.0" encoding= "UTF-8"?><Settingsxmlns= "http://maven.apache.org/SETTINGS/1.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">  <localrepository>D:/develop/java/apache-maven-3.0.5/repository</localrepository>  <plugingroups>  </plugingroups>  <proxies>  </proxies>  <Servers>  </Servers>  <Mirrors>  </Mirrors>  <Profiles>    < Profile>      <repositories>          <Repository>              <ID>Repo.springsource.org-release</ID>              <name>SpringSource Repository</name>              <URL>Http://repo.springsource.org/release</URL>          </Repository>      </repositories>    </ Profile>  </Profiles></Settings>

The above content value according to the source file content, removed the comment section, retained, mainly set the local warehouse address localrepository, remote cruel address repository, other properties you are interested in self-Baidu

Jdk,maven installation is complete, open Eclipse settings related properties

Open Preferences Settings Properties

Here is the addition of the external MAVEN installation package, which is the Maven_home installed earlier

Here, you can select the previously modified Setting.xml file by browsing, and the warehouse location below will be adjusted accordingly.

This completes the installation of the software, but check the JDK version as follows:

If the display is not a previously installed JDK, replace it.

Go to the Chase!

Environment deployment Well then to run the code, I have been groping to find a very easy to use, fast speed, free code hosting tools, has not found, perhaps I was stupid, and later heard that there is Taobao code, after trial speed is also OK, unlike Google code often not even up

So all subsequent demo code will appear on Taobao code above, SVN address is as follows: Http://code.taobao.org/svn/yongledemo

First of all, the following is the SVN file to store the approximate rules (here SVN client installation, SVN Eclipse plug-in installation skipped)

Directory structure is clear, the trunk below the source directory, the later sibling will appear the document directory,

The demo folder is the project's home folder, where the files are in MAVEN's standard format, and the project is a war project

The following is an introduction to using the SVN plugin to check out code in Eclipse and create a project

Add the resource location, locate the resource directory source, and right-check out the project, such as.

When the checkout is complete, Eclipse switches the view to Java and you can see the project

The name is slightly different, please ignore the details, then, right click on the project, import

The next step is to create a project named after the demo.

Download complete below, MAVEN project deployment is complete, you can have a fist.

Java Development Environment Deployment-maven under Eclipse

Related Article

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.