1. IDEA Configure Maven

  • Set Maven in IDEA to be used together with IDEA.
  • Maven is built into IDEA. It is generally not used because it is not convenient to modify maven Settings.
  • Using maven with your own installation, you need to override the default Settings in IDEA. Let IDEA specify maven installation location and other information

Configuration entry:

① : Configure the Settings of the current project:



file--settings ---Build, Excution,Deployment--Build Tools--Maven

  • Maven Home directory: Maven installation directory
  • User Settings File: is maven installation directoryconf/setting.xmlThe configuration file
  • Local Repository: Directory location of the local repository
  • Build Tools--Maven--Runner

    VM Options : -DarchetypeCatalog=internal: Maven project creation, the network will download the template file, relatively large, use-DarchetypeCatalog=internalWithout downloading, creating Maven projects is fast.

    JRE: Your projectjdk

② : After configuring the New Project Settings: file–other Settings –Settings for New Project

2. Create projects using templates

1)maven-archetype-quickstart: ordinaryjavaproject

  • Not in the template created quicklyresourcesTo manually create a directory, right-clickmainCreate it, but you need to set it, for example:

2)maven-archetype-webapp: web project

  • There is no Java or Resources folder in mainjavaDirectory correspondingSources Root.resourcesThe correspondingResources Root

  • Create the test folder,javaDirectory correspondingTest Sources RootAnd the resourcesTest Resources Root
  • The creation is as follows: