Eclipse Configuration maven Compile code

Source: Internet
Author: User

1. First install the Maven plugin, go to Eclipse's help->marketplace, enter "Maven" in the Find box, select "Maven Integration for Eclipse (Juno and newer)" Install button for item



2. Enter the Window->preferences window, select Java->installed jres, by default only eclipse one, where to add the JDK through the Add button to add the corresponding path, otherwise the compilation will be an error:

No compiler is provided into this environment. Perhaps you are running on a JRE rather than a JDK?



Next, enter installed JREs's subkey Execute environment: Select JavaSE-1.6 on the left and JDK on the right.



3. Right-click on the project file and select Maven->update project.



If this project is not a Maven project, click the Project icon and now Configure->convert to Maven project


4. Right, select Run As->maven install, and then start downloading the files needed in the compilation process



5. Then, select Maven Build, the first run will appear the Run Configurations dialog box, mainly in the Goals box to enter the target file to be compiled, goals options include:

Validate
Initialize
Generate-sources
Process-sources
Generate-resources
Process-resources
Compile compile
Process-classes
Generate-test-sources
Process-test-sources
Generate-test-resources
Process-test-resources
Test-compile
Process-test-classes
Test
Prepare-package
Package
Pre-integration-test
Integration-test
Post-integration-test
Verify
Install
Deploy

If goals does not enter the content, the compile will prompt

[ERROR] No goals have been specified for this build. You are must specify a valid lifecycle phase or a goal in the format ....

Further details can be referred to http://gavin-chen.iteye.com/blog/336607



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.