Skip to content

Instantly share code, notes, and snippets.

@helenhash
Last active November 6, 2024 05:17
Show Gist options
  • Save helenhash/b2ccd835793fe43c520a293766cef1d5 to your computer and use it in GitHub Desktop.
Save helenhash/b2ccd835793fe43c520a293766cef1d5 to your computer and use it in GitHub Desktop.

Note some way to use Maven in project

Maven wrapper

Instead of installing many versions of it in the operating system, we can just use the project-specific wrapper script.

mvn -N wrapper:wrapper -Dmaven=3.5.2 -> Create maven wrapper in your project.

build project

`mvnw.cmd clean install'

Require Java version for Maven

https://maven.apache.org/download.cgi

Maven Install

Make sure JDK is installed, and JAVA_HOME environment variable is configured

http://maven.apache.org/download.cgi

Environment Variables MAVEN_HOME = c:\opt\apache-maven-3.6.0

Add %MAVEN_HOME%\bin To PATH

Check Version mvn –version

Maven in Intelij

File > Settings > Build, Execution, Deployment > Build Tools > Maven

Look: Maven home path.

We have 3 option

  • Bundled Maven: it comes pre-installed in Intelij IDE
  • Select Maven from your machine (point to the Maven path)
  • Maven wrapper: this include in source code, so it does not depend on developer machine or IDE -> Prefer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment