Sonatype Nexus and Maven BasicsFebruary 9, 2010
2Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. What is Maven
3Problems Addressed and Uses for MavenLarge software projects usually contain tens or even hundreds of projects/modules
Will become messy and incomprehensible if the projects don’t adhere to some common principles
Will be time-consuming to build all projects manuallyUse a project management tool (like Maven)Maven helps you with various aspects:Build processProject structureDependency managementAccess to information and documentation
4Build processThe Project Object Model (POM) – an XML file – is the heart of a Maven 2 projectContains project information and configuration details used to build the project
Project dependencies
Commands (goals) that can be executed
Plugins
Metadata
The POM extends the Super POM5POM - Simple example
6POM – Project inheritance
7POM – Project aggregation
8The build lifecycle is the process of building and distributing an artifactA phase is a step in the build lifecycleMost important default phases:ValidateCompileTestPackageInstallDeploySome common phases not default:CleanSiteFor each step, all previous steps are executedBuild Lifecycle and Phases
9Advantages:A developer familar with Maven will quickly get familiar with a new projectNo time wasted on re-inventing directory structures and conventionssrc/main/java 		Javasource files goes heresrc/main/resources 	Other resources your application needssrc/main/filters 		Resource filters (properties files)src/main/config 		Configuration filessrc/main/webapp	Web application directory for a WAR projectsrc/test/java 		Test sources like unit tests (not deployed)src/test/resources 	Test resources (not deployed)src/test/filters 		Test resource filter files (not deployed)src/site 			Files used to generate the Maven project websiteStandard directory layout
10Dependency: a third-party or project-local software library (JAR or WAR file)Dependency management is a challenge in multi-module projectsDependency management
11Dependency management
12Dependency management

Maven Nexus

  • 1.
    Sonatype Nexus andMaven BasicsFebruary 9, 2010
  • 2.
    2Apache Maven isa software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. What is Maven
  • 3.
    3Problems Addressed andUses for MavenLarge software projects usually contain tens or even hundreds of projects/modules
  • 4.
    Will become messyand incomprehensible if the projects don’t adhere to some common principles
  • 5.
    Will be time-consumingto build all projects manuallyUse a project management tool (like Maven)Maven helps you with various aspects:Build processProject structureDependency managementAccess to information and documentation
  • 6.
    4Build processThe ProjectObject Model (POM) – an XML file – is the heart of a Maven 2 projectContains project information and configuration details used to build the project
  • 7.
  • 8.
    Commands (goals) thatcan be executed
  • 9.
  • 10.
  • 11.
    The POM extendsthe Super POM5POM - Simple example
  • 12.
    6POM – Projectinheritance
  • 13.
    7POM – Projectaggregation
  • 14.
    8The build lifecycleis the process of building and distributing an artifactA phase is a step in the build lifecycleMost important default phases:ValidateCompileTestPackageInstallDeploySome common phases not default:CleanSiteFor each step, all previous steps are executedBuild Lifecycle and Phases
  • 15.
    9Advantages:A developer familarwith Maven will quickly get familiar with a new projectNo time wasted on re-inventing directory structures and conventionssrc/main/java Javasource files goes heresrc/main/resources Other resources your application needssrc/main/filters Resource filters (properties files)src/main/config Configuration filessrc/main/webapp Web application directory for a WAR projectsrc/test/java Test sources like unit tests (not deployed)src/test/resources Test resources (not deployed)src/test/filters Test resource filter files (not deployed)src/site Files used to generate the Maven project websiteStandard directory layout
  • 16.
    10Dependency: a third-partyor project-local software library (JAR or WAR file)Dependency management is a challenge in multi-module projectsDependency management
  • 17.
  • 18.