Home > Java > javaTutorial > body text

Detailed graphic and text explanation of Maven configuration in Windows and project creation in IDE

黄舟
Release: 2017-09-29 10:29:55
Original
1693 people have browsed it

Maven configuration under Windows


2. Extract to D drive:

3 .Modify the configuration file settings.xml.

a) Change it to the Alibaba Cloud image. The domestic image download speed will be much faster.


<mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
     <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror></mirrors>
Copy after login

b) Configure the address of the local warehouse, that is, the storage address of the jar package when downloading the code from the warehouse to the local area.

 4. Next, add the Maven path to the environment variable and create a new system variable.

 5. Add to the Path variable.

6. Open the command line console and enter "mvn -version". You can see that Maven has been configured successfully.

Configure Maven in IDEA and create a Maven Web project

 1. Open IDEA, File->Settings.

 2. Configure as follows in Settings.

 3. Create a new Project.

4. Select the Maven type Project, where you can select the JDK version of the project.

 5. Determine the project name.

6. Click Next until completed. At this time, the following prompt will appear in the lower right corner of Idea. Click "Enable Auto-Import ".

7. Wait for a while and you will see that the project has been created. At this time, the project is not complete and lacks some directories. We need to create these directories manually.

7. Wait for a while and you will see that the project has been created. At this time, the project is not complete and lacks some directories. We need to create these directories manually.

 8. Click Project Structure, File->Project Structure.

 9. Configure the project as follows.

10. Click OK to complete the creation of the Maven project in Idea.

Configure Maven in Eclipse (Oxygen) and create a Maven Web project

1. Similar to IDEA, open eclipse, Windows->Preferences.

 2. Make the following configuration in Preferences.

3. After configuring the Maven installation directory, you also need to configure the Maven configuration file Location.

 4. Create a new Project.

5. Select the Maven Project.

 6. Next step, just default.

7. Similar to IDEA, select the Web type Maven template.

 8. Click Finish to create a Maven project.

9. Wait for a while and you will see that the project has been created. Also at this time, there are some directories missing from the IDEA project. We need to create these directories manually.

 10. We also need src/main/java, src/test/java, src/test/resources. In fact, the first two directories exist, but I don’t know why they cannot be displayed. In fact, we can just modify the JRE. Right-click the item and make selections as shown below.

 11. Select Libraries, select JRE, and apply OK.

 12. After completion, you will see two directories displayed.

13. Let’s manually add a src/test/resources directory, select the project, right-click, configure as shown below, click OK to complete the Maven project in eclipse of establishment.


The above is the detailed content of Detailed graphic and text explanation of Maven configuration in Windows and project creation in IDE. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template