Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt

1,576 views

Published on

Maven ist ein weit verbreitetes Tool, welches den Build und das technische Management von Java-basierten Projekten unterstützt. Fünf Jahre nach dem Release der Version 2 steht nun Maven 3 vor der Tür. Der Vortrag „Maven 3 New Features“ von Stefan Scheidt (OPITZ CONSULTING) stellt ausgewählte neue Features vor.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,576
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt

  1. 1. Stefan ScheidtSolution Architect<br />OPITZ CONSULTING GmbH<br />Maven 3 New Features<br />
  2. 2. Wer bin ich?<br />Software-Entwickler und Architekt<br />Trainer und Coach<br />Autor und Sprecher<br />
  3. 3. Leistungs-angebot<br /><ul><li>Java
  4. 4. SOA/BPM
  5. 5. ORACLE
  6. 6. BI/DWH
  7. 7. Outtasking</li></ul>Kunden<br /><ul><li>Branchen-übergreifend
  8. 8. Über 600 Kunden</li></ul>Tätigkeits-felder<br /><ul><li>IT-Strategie
  9. 9. Beratung
  10. 10. Implementierung
  11. 11. Betrieb
  12. 12. Training</li></ul>Fakten<br /><ul><li>Gründung 1990
  13. 13. 400 Mitarbeiter
  14. 14. 8 Standorte</li></ul>Industrie / Versorger / Telekommunikation 29%<br />Handel / Logistik / Dienstleistungen29%<br />42%Öffentliche Auftraggeber / Banken & Versicherungen / Vereine & Verbände<br />
  15. 15. Wer sind Sie?<br />
  16. 16. Über diesen Vortrag...<br />
  17. 17. Was ist Maven?<br />Ein deklarativesBuild-System<br />Convention overConfiguration<br />Wiederverwendung durch Plugins<br />Dependency Management<br />Ein Tool für technisches Projekt-Reporting<br />ein „Software Project Management Tool“<br />
  18. 18. Was ist Maven?<br />Ein Open-Source-Projekt bei Apache<br />Ziel:<br />Vereinheitlichen von<br />Build, Verteilung, Projekt-Webseite<br />Zweck:<br />Don‘trepeatyourself!<br />Siehe auch http://maven.apache.org/what-is-maven.html<br />
  19. 19. Release-Historie<br /> 1.0 Beta 2003<br /> 1.0 2004 / Juli<br /> 2.0 Alpha 2005 / April<br /> 2.0 Beta 2005 / September<br /> 2.0 2005 / Oktober<br /> 3.0 Alpha 2009 / Februar<br /> 3.0 Beta 2010 / April<br /> 3.0 2010 / Oktober<br />Quelle: http://archive.apache.org/dist/maven/binaries/<br />
  20. 20. Primäre Ziele für Maven 3.0<br />Refactoring der Code Base<br />Interne Modularisierung<br />
  21. 21. Modularisierung<br />Quelle:<br />http://maven.apache.org/ref/3.0/<br />
  22. 22. Primäres Anliegen<br />BackwardCompatibility<br />Dafür viele Integrationstests<br />Siehehttps://grid.sonatype.org/ci/view/Maven/job/maven-3.0.x-ITs/<br />
  23. 23. Compatibility Notes<br />https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html<br />No moreprofiles.xml<br />Support forprofilesoutside of the POM<br />orthesettings.xml has beenremoved<br />Advise: moveaffectedprofilesintosettings.xml<br />(Hint: mvn--settingssome/settings/file.xml)<br />
  24. 24. Compatibility Notes<br />Stricter POM Validation<br />More Errors<br />MoreWarnings<br />Explanationsbased on Exceptions<br />Links to MavenWiki<br />https://cwiki.apache.org/confluence/display/MAVEN/Errors+and+Solutions<br />
  25. 25. Compatibility Notes<br />Dependency Resolution fromLocalRepository<br />buildscanonlyaccesslocallycachedartifacts<br />iftheyhavethe proper repositoriesconfigured<br />(Maven 3 keepstrack of artifactorigin)<br />
  26. 26. Einschub: Aether<br />A libraryforinteractingwith<br />artifactrepositories<br />Local / remote Repositories<br />Workspaces<br />Transport<br />Artifact Resolution<br />
  27. 27. Einschub: Maven benutzt Aether<br />
  28. 28. Einschub: Aether – Ziele<br />„Wewant to ensurethatprojectsbuilding<br />with SBT, Leinigen, Gradle, Buildr, Ant,<br />or a homegrownsysteminteroperate<br />reliablywithMavenrepositories.“<br />Jason van Zyl, Aetherquestionsansweredfor JAX<br />
  29. 29. Compatibility Notes<br />ClassPathIssues<br />Maven 3 usingAether<br />canresult in different classpaths<br />Warning: mvndependency:tree<br />still useslegacyresolutioncode!<br />(Hint: usemvn--debug)<br />
  30. 30. Compatibility Notes<br />PluginRepositories<br />Buildextensions, plugins and plugindependenciesareonlyresolvedfrom<pluginRepositories><br />(and no longerfrom<repositories>)<br />
  31. 31. Compatibility Notes<br />Plugin Version Resolution<br />automaticpluginversionresolution<br />isscheduledfor removal<br />Till then: latestreleaseversionisused,<br />notlatestsnapshotversion<br />
  32. 32. Compatibility Notes<br />SnapshotDeployments<br />snapshotartifacts will alwaysbedeployed<br />using a timestampedversion<br />(<uniqueVersion>false</uniqueVersion> has no effect)<br />
  33. 33. Compatibility Notes<br />Site Generation<br />All reportingrelatedcode<br />has beenremovedfromMavencore<br />ThereforeonemustuseMaven Site Plugin 3.x<br />Siehe https://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html<br />
  34. 34. Compatibility Notes<br />Configuration of reportingplugins<br />pluginconfiguration in <reporting><br />no longeraffectsplugins in <build><br />(whenexecuting a pluginduringbuildlifecycleorfromcli,<br />onlyconfigurationfrom<build>isconsidered)<br />
  35. 35. PluginCompatibility<br />PluginCompatibility Matrix<br />https://cwiki.apache.org/MAVEN/maven-3x-plugin-compatibility-matrix.html<br />Reporting PluginsCompatibility Matrix<br />https://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html<br />
  36. 36. Maven Shell<br />http://shell.sonatype.org/<br />https://docs.sonatype.org/display/MVNSH/Home<br />CLI forMaven<br />standalone Java process<br />keepsPOMs in memoryforfasterbuilds<br />replacesmaven-cli-plugin<br />
  37. 37. Performance<br />
  38. 38. Performance: Parallel builds<br />https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3<br />Experimental Feature since 3.0 Beta 1<br />mvn -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<br />„20-50% speedimprovementisquitecommon“<br />Depends on distribution of tests<br />
  39. 39. Maven 3 und IDEs<br />Major Java IDEs allreadyinclude<br />(someversion of) Maven 3<br />Eclipse via m2eclipse, IntelliJ, NetBeans<br />Still no supportby Oracle JDeveloper<br />
  40. 40. Maven 3 und CI-Systeme<br />Hudson<br />No supportforMaven 3 yet, voteforhttp://issues.hudson-ci.org/browse/HUDSON-4988<br />WorkAround: Free Style Projects<br />Shell Command:<br />export M2_HOME=/path/to/apache-maven-3.0-beta-3<br />export M2=$M2_HOME/bin<br />export PATH=$M2:$PATH<br /> cd someproject<br />mvn clean install<br />
  41. 41. Maven 3 und CI-Systeme<br />Teamcity<br />No Support in Teamcity 5<br />Support announcedfor Teamcity 6<br />
  42. 42. Maven 3 und Sonar<br />Sonar 2.2 supportsMaven 3<br />Butyouneed to use sonar-maven3-plugin:2.2<br />(mvn org.codehaus.sonar:sonar-maven3-plugin:2.2:sonar)<br />Siehe http://www.sonatype.com/people/2010/08/maven-3-and-sonar/<br />
  43. 43. PolyglotMaven<br />http://polyglot.sonatype.org/<br />
  44. 44. Ausblicke<br />m2eclipse will move to eclipse.org<br />Release of m2eclipse 1.0 „soon“<br />Release of mvnsh „fairlysoon“<br />newphase of work on PolyglotMaven<br />OSGiruntime in futurerelease<br />
  45. 45. Ausblicke: Maven 3.1<br />POM format 4.1<br />Global excludes<br />Versionlessparentelements<br />Mixins<br />New settingssystem<br />New Plugin API<br />
  46. 46. Ausblicke - Quellen<br />http://java.profict.nl/presentaties/maven.pdf<br />http://www.sonatype.com/people/↵⌫2010/10/maven-3-0-has-landed/<br />http://www.infoq.com/news/2010/10/↵⌫maven-30-released<br />Siehe auch<br />https://sonatype.webex.com/sonatype/lsr.php?↵⌫<br />AT=pb&SP=EC&rID=46805542&rKey=3f773d348b2df17b<br />
  47. 47. Fazit<br />„Weseethis as a newbeginningforMaven“<br />Jason van Zyl<br />
  48. 48. Fragen und Antworten<br />
  49. 49. Kontakt<br />Stefan Scheidt<br />Solution Architect<br />OPITZ CONSULTING GmbHKirchstr. 6, 51647 GummersbachTel. +49 (2261) 6001 - 0stefan.scheidt@opitz-consulting.com<br />

×