Maven 3 New Features

  • Published on
    30-Aug-2014

  • View
    1.861

  • Download
    2

DESCRIPTION

berblick ber neue Features von Maven 3.

Transcript

<ul><li> Stefan Scheidt<br />Solution Architect<br />OPITZ CONSULTING GmbH<br />Maven 3 New Features<br /></li> <li> Wer bin ich?<br />Software-Entwickler und Architekt<br />Trainer und Coach<br />Autor und Sprecher<br /></li> <li> Wer ist OPITZ CONSULTING?<br />Last Minute:<br />Offizieller OC 1 Seiter<br />Von Tom<br />Ihr Projektspezialist fr Java, SOA und Oracle<br /></li> <li> Wer sind Sie?<br /></li> <li> ber diesen Vortrag...<br /></li> <li> Was ist Maven?<br />Ein deklarativesBuild-System<br />Convention overConfiguration<br />Wiederverwendung durch Plugins<br />Dependency Management<br />Ein Tool fr technisches Projekt-Reporting<br />ein Software Project Management Tool<br /></li> <li> Was ist Maven?<br />Ein Open-Source-Projekt bei Apache<br />Ziel:<br />Vereinheitlichen von<br />Build, Verteilung, Projekt-Webseite<br />Zweck:<br />Dontrepeatyourself!<br />Siehe auch http://maven.apache.org/what-is-maven.html<br /></li> <li> Release-Historie<br /> 1.0 Beta2003<br /> 1.02004 / Juli<br /> 2.0 Alpha2005 / April<br /> 2.0 Beta2005 / September<br /> 2.02005 / Oktober<br /> 3.0 Alpha2009 / Februar<br /> 3.0 Beta 2010 / April<br />3.02010 / Oktober<br />Quelle: http://archive.apache.org/dist/maven/binaries/<br /></li> <li> Primre Ziele fr Maven 3.0<br />Refactoring der Code Base<br />Interne Modularisierung<br /></li> <li> Modularisierung<br />Quelle:<br />http://maven.apache.org/ref/3.0/<br /></li> <li> Primres Anliegen<br />BackwardCompatibility<br />Dafr viele Integrationstests<br />Siehehttps://grid.sonatype.org/ci/view/Maven/job/maven-3.0.x-ITs/<br /></li> <li> 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 /></li> <li> 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 /></li> <li> Compatibility Notes<br />Dependency Resolution fromLocalRepository<br />buildscanonlyaccesslocallycachedartifacts<br />iftheyhavethe proper repositoriesconfigured<br />(Maven 3 keepstrack of artifactorigin)<br /></li> <li> Einschub: Aether<br />A libraryforinteractingwith<br />artifactrepositories<br />Local / RemoteRepositories<br />Workspaces<br />Transport<br />Artifact Resolution<br /></li> <li> Einschub: Maven benutzt Aether<br /></li> <li> 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 /></li> <li> 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 /></li> <li> Compatibility Notes<br />PluginRepositories<br />Buildextensions, plugins and plugindependenciesareonlyresolvedfrom<br />(and no longerfrom)<br /></li> <li> Compatibility Notes<br />Plugin Version Resolution<br />automaticpluginversionresolution<br />isscheduledfor removal<br />Till then: latestreleaseversionisused,<br />notlatestsnapshotversion<br /></li> <li> Compatibility Notes<br />SnapshotDeployments<br />snapshotartifacts will alwaysbedeployed<br />using a timestampedversion<br />(false has no effect)<br /></li> <li> 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 /></li> <li> Compatibility Notes<br />Configuration of reportingplugins<br />pluginconfiguration in <br />no longeraffectsplugins in <br />(whenexecuting a pluginduringbuildlifecycleorfromcli,<br />onlyconfigurationfromisconsidered)<br /></li> <li> 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 /></li> <li> 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 /></li> <li> Performance<br /></li> <li> 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 /></li> <li> 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 /></li> <li> 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 /></li> <li> Maven 3 und CI-Systeme<br />Teamcity<br />No Support in Teamcity 5<br />Support announcedfor Teamcity 6<br /></li> <li> 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 /></li> <li> PolyglotMaven<br />http://polyglot.sonatype.org/<br /></li> <li> 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 /></li> <li> Ausblicke: Maven 3.1<br />POM format 4.1<br />Global excludes<br />Versionlessparentelements<br />Mixins<br />New settingssystem<br />New Plugin API<br /></li> <li> 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&amp;SP=EC&amp;rID=46805542&amp;rKey=3f773d348b2df17b<br /></li> <li> Fazit<br />Weseethis as a newbeginningforMaven<br />Jason van Zyl<br /></li> <li> Fragen und Antworten<br /></li> <li> Kontakt<br />Stefan Scheidt<br />Solution Architect<br />OPITZ CONSULTING GmbHKirchstr. 6, 51647 GummersbachTel. +49 (2261) 6001 - 0stefan.scheidt@opitz-consulting.com<br /></li> </ul>