Apache Maven

Figure 623. Maven: Recommended reading Slide presentation

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

  • Project management tool

    • Create reports

    • Continuous integration support


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

  • Dependency management

  • Repository system

  • Plugin framework


Figure 626. 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 627. Maven project layout Slide presentation

Figure 628. 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 629. pom.xml characteristics Slide presentation
  • Declarative project description

    • Dependencies

    • Builds

    • Artifacts

  • No explicit instructions


Figure 630. 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