Some of the configuration after eclipse checked out the MAVEN project from SVN

Source: Internet
Author: User
Tags svn java web apache tomcat

After eclipse checks out the MAVEN project from SVN, it will find that it's just a normal Java project,

Here we need to turn it into maven-webapp and adjust the relevant properties, set the runtime environment, correlate the relevant jar directory and so on.

Personal environment:

eclipse4.4 Luna JDK7 Tomcat7 Maven3.1

Method:

1. Convert to Maven Project

Right-click Project >confirgue >convert to Maven project,

So we turned it into MAVEN project, and there was one more m on the project icon

2. Convert this MAVEN project to Maven-webapp

Right-click Project > Properties > Project Facets,

Click Convert to faceted on the right ... Enter the project facets interface.

The purpose of this interface, simple to understand is to configure the various services our web project needs to use, and each service eclipse provides a set of templates, each template has its version.

Tick the Dynamic Web Module under Project facet, I'm going to use TOMCAT7, and the installation is also JDK7, so the corresponding right version chooses 3.0.

-------------This paragraph is not to be looked at begin--------------

The Dynamic Web module version is literally meant to be a dynamically web modules release.

Because Java Web systems have many types, such as static and dynamic, Dynamic Java Web Project to set the Dynamic Web module, which is the Dynamics Web page model, it is necessary to match the corresponding web container with the project to run.

The Dynamic Web module 2.4 corresponds to Tomcat 5.5;

The Dynamic Web module 2.5 corresponds to Tomcat 6.0;

The Dynamic Web Module 3.0 corresponds to Tomcat 7.0;

A later version of the Dynamic Web module has a higher efficiency or other improvement over parsing a later version of JS.

Add several:

Tomcat version 5.5 only supports EE 1.2, 1.3, 1.4 Web Modules
Tomcat version 6.0 only supports EE 1.2, 1.3, 1.4, and Java EE 5 Web Modules

-------------This paragraph can not look at the end--------------

Java corresponds to version 1.7

By the way, tick JavaScript, the corresponding version is 1.0

Finally do not forget to click on the further configuration available below, which is additional configuration, go in

In general, the normal Java Web project,eclipse that we build with eclipse will automatically generate a webcontent directory, and the Dynamic Web page and XML will be placed in this directory, but Maven's page resources and Web. XML are placed in src/ Under the Main/webapp.

So our content directory is changed to Src/main/webapp

Web. XML already exists in the project, so uncheck the Generate Web. XML Deployment Descriptor

Then click OK, then click Apply App Configuration, and this MAVEN project will turn into Maven WebApp.

3. Update the project with maven and let maven download the jar that the project relies on

Before this, you need to install MAVEN on the machine first, please Baidu yourself.

Update Project:

Right-click Project > Maven > Update Project, go to update Maven project, check forceupdate ... To force the update, click OK to update it.

4. Configure Java Build Path

Right-click Project > Properties > Java Build Path > Libraries, add JRE Library,

I installed the JRE7, the project is JRE6 so check the JRE System Library > Right Edit > Select workspace default JRE > Finish > OK

Add the Server Runtime (before you configure Web server such as Tomcat), which is to add Servlet-api.jar dependencies:

Add Library > Server Runtime > Next > Apache Tomcat v7.0 > Finish > OK

5. Configuring Java Compiler

Right-click Project > Properties > Java Compiler, select Jre1.7,ok Save for current environment

6. Add Maven dependency in Deployment assembly

Right-click Project > Properties > Deployment Assembly > Add > Java Build Path Entries > Next > Maven Dependencies > Finish > OK,

At this point, all configurations have been completed and the project can be used normally.

Some of the configuration after eclipse checked out the MAVEN project from SVN

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.