Apache Maven

Figure 630. Maven: Recommended reading Slide presentation

Figure 631. What is Maven anyway? Slide presentation
  • Build tool

  • Project management tool

    • Create reports

    • Continuous integration support


Figure 632. Maven: Facts and benefits Slide presentation
  • Build tool

  • Dependency management

  • Repository system

  • Plugin framework


Figure 633. Convention Over Configuration Slide presentation
  • Sensible default values:

    • Source below ${basedir}/src/main/java

    • Tests below ${basedir}/src/test

    • Bytecode, jar/war archives below ${basedir}/target

    • ...


Figure 634. Maven project layout Slide presentation

Figure 635. The project object model file Slide presentation
<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
    http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
...

</project>

Figure 636. pom.xml characteristics Slide presentation
  • Declarative project description

    • Dependencies

    • Builds

    • Artifacts

  • No explicit instructions


Figure 637. pom.xml vs. Makefile Slide presentation
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-shade-plugin</artifactId>
  <configuration>
    <Main-Class>org.devel.App</Main-Class>
...
      <execution>
        <phase>package</phase>
        <goals>
          <goal>shade</goal>
        </goals>
...
module.o: module.c
	gcc -c -g module.c