No MAVEN no project---use Eclipse to quickly build MAVEN projects

Source: Internet
Author: User

Ever since I learned about Maven and using MAVEN, no matter what type of project you create, Java,web I use MAVEN to manage the project, because it provides the dependencies, which is what you want to use to go to the Maven warehouse search. and paste the coordinates in the Pom.xml, save, Eclipse will automatically download the relevant package for you, save the export to find the jar package time, and version conflict problem! Use eclipse to quickly build MAVEN projects below
If your eclipse comes with Maven then congratulations, no configuration, if not, use Eclipse to install plug-ins, address: http://m2eclipse.sonatype.org/sites/m2e

After OK, select the search out the plugin, click Finish, wait a while, restart after the success!
Download maven compression pack http://maven.apache.org/download.cgi# on MAVEN website
Unzip it and associate the eclipse with the downloaded maven.

Because this one-end code is in the MAVEN configuration file.

<!-- localRepository   | The path to the local repository maven will use to store artifacts.   |   | Default: ${user.home}/.m2/repository  <localRepository>/path/to/local/repo</localRepository>  -->

This means that if the user does not configure the path, Maven downloads the dependency package it needs by default under Default: ${user.home}/.m2/repository path, we create a new folder on the other disk
Such as

<localRepository>F:/MavenStudy/repository</localRepository>

This will download the dependent package to the address you specified, and we'll let eclipse recognize the Setting.xml profile

It's ready to use!
Here is the Eclipse configuration maven! Start creating the project below
Maven Project "title=" >
Finish

Next

Specify the coordinates of the project finish

The directory structure of the MAVNE is this way, Eclipse automatically fix everything for us, this time you want to rely on the package, to rely on the library search, paste the coordinates in the POM,
Save it, Eclipse automatically downloads for us

In this way, Gson's dependency package is downloaded, and we can use it to the fullest!
Sometimes we want to build something. Web projects, not simple Java, just need to change the content of the publication.
Here, first select Java, change to 1.5,apply and then click the Web, select 3.0

When you click on the Web, the following appears

Tick "Automatically generate Web. xml"

After all, you will find the WebContent folder below the project, move the following two folders to the top and delete the WebContent

Last step, right-click Project, properties, publish content

Delete the webcontent so that the project becomes a Web project ...
That's a little bit more ...

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

No MAVEN no project---use Eclipse to quickly build MAVEN projects

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.