Maven sets up and creates Java and Web engineering __java in Eclipse

Source: Internet
Author: User
Tags visibility

One, Maven set in eclipse

1, maven Download:

https://maven.apache.org/download.cgi unzip the download of the good maven.

2, eclipse into the installations, add just unzip the good maven

Window->preferences->maven->installations->add

Add the maven that you just unzipped, and then apply.

3, enter user settings, set user setting.

Choose to extract the settings.xml under Maven. Apache-maven-3.5.0\conf\settings.xml.

4, set the compiled JDK version

[1] Open settings.xml file
[2] Find the Profiles label
[3] Add the following configuration
<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
</profile>

Ii. creating Java and Web projects

5,

To facilitate the new MAVEN project, set menu Visibility first.

Window->customize perspective->menu visibility->file->new, select Maven Project, and then click OK.

① Java project to create Maven

File->new->maven project-> Tick Create a single Project (skip archetype selection)->next-> fill out group id-> Fill in the Artifact Id->packaging to select Jar->finish.

② Web project to create Maven

File->new->maven project-> Tick Create a single Project (skip archetype selection)->next-> fill out the group Id For example com.james.ssm-> fill in artifact Id such as: ssm->packaging select War->finish.

Note: The Java project to create MAVEN is not the same as the Web project that created MAVEN packaging. In the choice of packaging, Java is chosen by Jar,web is war

Generate Meta-inf and Web-inf directories and content inside:

Select the new project, right-click->properties->project facets-> deselect Dynamic Web module->apply-> and select Dynamic Web module-> Click the value in further configuration available->content directory to src/main/webapp,-> tick generate Web.xml deployment Descriptor->ok.

③ Execute maven Command:

Select Pom.xml, right click, run as.




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.