Apache Maven

Figure 576. Maven: Recommended reading Slide presentation Create comment in forum

Figure 577. What is Maven anyway? Slide presentation Create comment in forum
  • Build tool

  • Project management tool

    • Create reports

    • Continuous integration support


Figure 578. Maven: Facts and benefits Slide presentation Create comment in forum
  • Build tool

  • Dependency management

  • Repository system

  • Plugin framework


Figure 579. Convention Over Configuration Slide presentation Create comment in forum
  • Sensible default values:

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

    • Tests below ${basedir}/src/test

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

    • ...


Figure 580. Maven project layout Slide presentation Create comment in forum

Figure 581. The project object model file Slide presentation Create comment in forum
<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 582. pom.xml characteristics Slide presentation Create comment in forum
  • Declarative project description

    • Dependencies

    • Builds

    • Artifacts

  • No explicit instructions


Figure 583. pom.xml vs. Makefile Slide presentation Create comment in forum
<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