Stefan ScheidtSolution ArchitectOPITZ CONSULTING GmbHMaven 3 New Features
Wer bin ich?Software-Entwickler und ArchitektTrainer und CoachAutor und Sprecher
Leistungs-angebotJava
SOA/BPM
ORACLE
BI/DWH
OuttaskingKundenBranchen-übergreifend
Über 600 KundenTätigkeits-felderIT-Strategie
Beratung
Implementierung
Betrieb
TrainingFaktenGründung 1990
400 Mitarbeiter
8 StandorteIndustrie / Versorger / Telekommunikation 29%Handel / Logistik / Dienstleistungen29%42%Öffentliche Auftraggeber / Banken & Versicherungen / Vereine & Verbände
Wer sind Sie?
Über diesen Vortrag...
Was ist Maven?Ein deklarativesBuild-SystemConvention overConfigurationWiederverwendung durch PluginsDependency ManagementEin Tool für technisches Projekt-Reportingein „Software Project Management Tool“
Was ist Maven?Ein Open-Source-Projekt bei ApacheZiel:Vereinheitlichen vonBuild, Verteilung, Projekt-WebseiteZweck:Don‘trepeatyourself!Siehe auch http://maven.apache.org/what-is-maven.html
Release-Historie	 		1.0 Beta		2003		 	1.0			2004 / Juli		 	2.0 Alpha		2005 / April		 	2.0 Beta		2005 / September		 	2.0			2005 / Oktober		 	3.0 Alpha		2009 / Februar		 	3.0 Beta 		2010 / April			3.0			2010 / OktoberQuelle: http://archive.apache.org/dist/maven/binaries/
Primäre Ziele für Maven 3.0Refactoring der Code BaseInterne Modularisierung
ModularisierungQuelle:http://maven.apache.org/ref/3.0/
Primäres AnliegenBackwardCompatibilityDafür viele IntegrationstestsSiehehttps://grid.sonatype.org/ci/view/Maven/job/maven-3.0.x-ITs/
Compatibility Noteshttps://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.htmlNo moreprofiles.xmlSupport forprofilesoutside of the POMorthesettings.xml has beenremovedAdvise: moveaffectedprofilesintosettings.xml(Hint: mvn--settingssome/settings/file.xml)
Compatibility NotesStricter POM ValidationMore ErrorsMoreWarningsExplanationsbased on ExceptionsLinks to MavenWikihttps://cwiki.apache.org/confluence/display/MAVEN/Errors+and+Solutions
Compatibility NotesDependency Resolution fromLocalRepositorybuildscanonlyaccesslocallycachedartifactsiftheyhavethe proper repositoriesconfigured(Maven 3 keepstrack of artifactorigin)
Einschub: AetherA libraryforinteractingwithartifactrepositoriesLocal / remote RepositoriesWorkspacesTransportArtifact Resolution
Einschub: Maven benutzt Aether
Einschub: Aether – Ziele„Wewant to ensurethatprojectsbuildingwith SBT, Leinigen, Gradle, Buildr, Ant,or a homegrownsysteminteroperatereliablywithMavenrepositories.“Jason van Zyl, Aetherquestionsansweredfor JAX
Compatibility NotesClassPathIssuesMaven 3 usingAethercanresult in different classpathsWarning: mvndependency:treestill useslegacyresolutioncode!(Hint: usemvn--debug)
Compatibility NotesPluginRepositoriesBuildextensions, plugins and plugindependenciesareonlyresolvedfrom<pluginRepositories>(and no longerfrom<repositories>)
Compatibility NotesPlugin Version Resolutionautomaticpluginversionresolutionisscheduledfor removalTill then: latestreleaseversionisused,notlatestsnapshotversion
Compatibility NotesSnapshotDeploymentssnapshotartifacts will alwaysbedeployedusing a timestampedversion(<uniqueVersion>false</uniqueVersion> has no effect)
Compatibility NotesSite GenerationAll reportingrelatedcodehas beenremovedfromMavencoreThereforeonemustuseMaven Site Plugin 3.xSiehe https://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html
Compatibility NotesConfiguration of reportingpluginspluginconfiguration in <reporting>no longeraffectsplugins in <build>(whenexecuting a pluginduringbuildlifecycleorfromcli,onlyconfigurationfrom<build>isconsidered)
PluginCompatibilityPluginCompatibility Matrixhttps://cwiki.apache.org/MAVEN/maven-3x-plugin-compatibility-matrix.htmlReporting PluginsCompatibility Matrixhttps://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html
Maven Shellhttp://shell.sonatype.org/https://docs.sonatype.org/display/MVNSH/HomeCLI forMavenstandalone Java processkeepsPOMs in memoryforfasterbuildsreplacesmaven-cli-plugin
Performance
Performance: Parallel buildshttps://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3Experimental Feature since 3.0 Beta 1mvn -T 4 clean install    # Buildswith 4 threads
   mvn -T 1C clean install   # 1 thread per cpucore
   mvn -T 1.5C clean install # 1.5 thread per core„20-50% speedimprovementisquitecommon“Depends on distribution of tests

Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt