Skip to content

Instantly share code, notes, and snippets.

@jianhuabi
Forked from michaellihs/maven-cheatsheet.md
Created September 12, 2021 07:01
Show Gist options
  • Select an option

  • Save jianhuabi/8eed8c296b6419d5bd8a990c1eb909b5 to your computer and use it in GitHub Desktop.

Select an option

Save jianhuabi/8eed8c296b6419d5bd8a990c1eb909b5 to your computer and use it in GitHub Desktop.
Maven Cheatsheet

POM - Project Object Model

See [http://maven. apache.org/pom.html](http://maven. apache.org/pom.html)

Minimal POM

<project>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.packt</groupId>
     <artifactId>sample-one</artifactId>
     <version>1.0.0</version>
</project>

Super POM

Bundled with Maven in MAVEN_HOME/lib/maven-model-builder- 3.2.3.jar - org/apache/maven/model/pom-4.0.0.xml - defines

  • Maven central repository
  • Maven central plugin repository
  • Required information to build a project in <build>
  • A <reporting> section
  • The default build profile

Overriding Values in POM

Define "blocks" with the same ID as in the Super POM. Show "effective" POM with

mvn help:effective-pom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment