Maven - Build

Card Puncher Data Processing

About

A Build is just a run of maven.

Plugin

LICENSE, NOTICE,…

See build-helper-maven-plugin

Example: Make sure every sub-project has LICENSE, NOTICE and git.properties in its jar's META-INF directory

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>build-helper-maven-plugin</artifactId>
	<executions>
	  <execution>
		<id>add-resource</id>
		<phase>generate-resources</phase>
		<goals>
		  <goal>add-resource</goal>
		  <goal>add-test-resource</goal>
		</goals>
		<configuration>
		  <resources>
			<resource>
			  <directory>${top.dir}</directory>
			  <targetPath>META-INF</targetPath>
			  <includes>
				<include>LICENSE</include>
				<include>NOTICE</include>
			  </includes>
			</resource>
			<resource>
			  <directory>${top.dir}/target</directory>
			  <targetPath>META-INF</targetPath>
			  <includes>
				<include>git.properties</include>
			  </includes>
			</resource>
		  </resources>
		</configuration>
	  </execution>
	</executions>
</plugin>

Build Info

  • In War (META-INF/build-info.properties)

Example:

build.group=com.example
build.artifact=demo
build.name=Demo Project
build.version=0.0.1-SNAPSHOT
build.time=2016-03-04T15\:16\:05+0100

Plugin:

A build-info file may also be created with resources filtering in Maven.

Retrieve information from VCS:





Discover More
Card Puncher Data Processing
Maven - Directory Structure (Project)

Maven relies on the Standard Directory Layout A standard project where: the src/main/java directory...
Card Puncher Data Processing
Maven - Goal

A goal is the execution part of a plugin. An individual plugin may have multiple goals. Each goal may have a separate configuration. If you are familiar with Ant, a goal is similar to a task. A goal...
Card Puncher Data Processing
Maven - Plugin (Mojo)

A plugin (in Maven 2.0) groups together goals by code. It's an independent unit of code for Maven. It look like a dependency. In Maven, there are: Build plugins. They will be executed during the...



Share this page:
Follow us:
Task Runner