Maven Plugins
This is a list of maven plugins I have found useful.
Maven Plugins
- maven-compiler-plugin
- Compiles using the standard location Maven specifies e.g. /src/main/java and /src/main/resources.
- Compiles using the JDK versions specified.
- maven-surefire-plugin
- The default plugin for running unit tests
- surefire:test
- maven-dependency-plugin
- To debug or understand a POM and how you get some dependency (transitively)
- dependency:analyze
- dependency:tree
- maven-jar-plugin
- Creates a Java Archive (JAR) file from the compiled project classes and resources.
- Specifies the ‘main class’ to be executed.
- Helps with composing a custom manifest file.
- maven-jetty-plugin
- Uses an embedded Jetty Servlet container to run your Java web application.
- jetty:run
- maven-war-plugin
- Creates a Web Archive (WAR) file from the compiled project classes, resources, and web.xml.
- maven-deploy-plugin
- Uploads the project artifacts (JAR, WAR, etc) to the internal remote repository.
- maven-resource-plugin
- Copies both the main and test resources to the output directory.
- spring-boot-maven-plugin
- Collects all the jars on the classpath and builds a single and runnable uber-jar.
- Provides a built-in dependency resolver that sets the version number to match Spring Boot dependencies.
- maven-enforcer-plugin
- Controls certain environmental constraints such as Maven version, JDK version and OS family.
- enforcer:enforce executes rules for each project in a multi-project build.
- enforcer:display-info display the current information as detected by the built-in rules.
- docker-maven-plugin
- Used for building a Docker image in Maven.
- cargo-maven2-plugin
- Designed for configuring, starting, stopping, and deploying applications to a range of supported containers.
- maven-assembly-plugin
- allows you to create your project distribution in zip or tar format
- assembly:single
- jdeb
- Provides an Ant task and a Maven plugin to create Debian packages from Java builds in a truly cross platform manner.
- jaxb2-maven-plugin
- Generate Java classes from XML Schemas (and optionally binding files) and to create XML Schemas from annotated Java classes.
- jaxb2:schemagen Creates XML Schema Definition (XSD) file(s) from annotated Java sources.
- jaxb2:testSchemagen Creates XML Schema Definition (XSD) file(s) from annotated Java test sources.
- jaxb2:xjc Generates Java sources from XML Schema(s).
- jaxb2:testXjc Generates Java test sources from XML Schema(s).
- maven-shade-plugin
- Packages the artifact in an uber-jar, including its dependencies and to shade - i.e. rename - the packages of some of the dependencies.
- shade:shade is bound to the package phase and is used to create a shaded jar.