s new in Maven 3 - Jazoon
Transcript of s new in Maven 3 - Jazoon
![Page 1: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/1.jpg)
Maven 3.0What’s new in
by Matthew McCullough, Ambient Ideas, LLC
Wednesday, June 2, 2010
![Page 2: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/2.jpg)
In the beginner’s mind there aremany possibilities.
In the expert’s mind there are few.
Wednesday, June 2, 2010
![Page 3: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/3.jpg)
This Talk
Wednesday, June 2, 2010
![Page 4: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/4.jpg)
Maven and You
!Who will enjoy this talk?!Current Maven user!Familiar with POM syntax!Interested in preparing for Maven 3.0!Comfortable with betas
Wednesday, June 2, 2010
![Page 5: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/5.jpg)
TheRoadmap
Wednesday, June 2, 2010
![Page 6: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/6.jpg)
Wednesday, June 2, 2010
![Page 7: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/7.jpg)
3.0
Wednesday, June 2, 2010
![Page 8: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/8.jpg)
Compatibility!Tested against 100s of Maven 2 projects!Legacy simulation layers!Using for 6 months almost exclusively
!450+ integration tests
Wednesday, June 2, 2010
![Page 9: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/9.jpg)
Wednesday, June 2, 2010
![Page 10: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/10.jpg)
Wednesday, June 2, 2010
![Page 11: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/11.jpg)
Wednesday, June 2, 2010
![Page 12: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/12.jpg)
603!
Wednesday, June 2, 2010
![Page 13: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/13.jpg)
Speed!Performance tuned!Benchmarks
! Disk I/O! Network I/O! CPU! Memory
Wednesday, June 2, 2010
![Page 14: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/14.jpg)
Maven Speed Test
Wednesday, June 2, 2010
![Page 15: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/15.jpg)
Wednesday, June 2, 2010
![Page 16: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/16.jpg)
Quick! Faster execution! 10% faster in the demo
! Multi-threaded downloads! Parallel plugin execution! Java 5 optimized builds
Wednesday, June 2, 2010
![Page 17: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/17.jpg)
Wednesday, June 2, 2010
![Page 18: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/18.jpg)
Efficient! Memory conservative! 73% less in the demo
! Tuned data structures
Wednesday, June 2, 2010
![Page 19: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/19.jpg)
!Largely re-written for quality, flexibility!30% smaller code base!Continuous integration running test suite
Code
Wednesday, June 2, 2010
![Page 20: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/20.jpg)
Extensibility!Layers of abstraction!Plugin classloader partitioning!Plexus to Guice IOC rewrite!Fully embeddable
!Basis for derived tools
Wednesday, June 2, 2010
![Page 21: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/21.jpg)
How can you keep up with Maven 3?
Wednesday, June 2, 2010
![Page 22: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/22.jpg)
http://maven.apache.org/release-notes-3.0.x.html
Wednesday, June 2, 2010
![Page 23: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/23.jpg)
http://delicious.com/matthew.mccullough/maven
Wednesday, June 2, 2010
![Page 24: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/24.jpg)
POMs & Maven 3.0
Wednesday, June 2, 2010
![Page 25: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/25.jpg)
POM XML Syntax
! No POM syntax changes for Maven 3.0
<project> <modelVersion>4.0.0</modelVersion> <groupId>com.ambientideas</groupId> <artifactId>sample-barestbones</artifactId> <version>1.0-SNAPSHOT</version></project>
Wednesday, June 2, 2010
![Page 26: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/26.jpg)
POM XML Validations
! Heavily validated against common mistakes
! Forward-test with Maven 3.0!Switch back to 2.x for production
! 3.0 POMs run better on 2.x
Wednesday, June 2, 2010
![Page 27: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/27.jpg)
POM XML Validations
!Warns when plugin versions are not specified
Wednesday, June 2, 2010
![Page 28: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/28.jpg)
POM XML Validations
! Blocks duplicate dependencies!Examined in same POM only!Conflict resolution used otherwise
<dependency> <artifactId>junit</modelVersion> <groupId>junit</groupId> <version>3.8.1</version></dependency>...<dependency> <artifactId>junit</modelVersion> <groupId>junit</groupId> <version>3.8.2</version></dependency>
Wednesday, June 2, 2010
![Page 29: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/29.jpg)
“Duplicate dependency” error
Wednesday, June 2, 2010
![Page 30: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/30.jpg)
Help URLs
! Wiki page URLs now shown for all error messages
Wednesday, June 2, 2010
![Page 31: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/31.jpg)
Help URLs
! Wiki page URLs now shown for all error messages
Wednesday, June 2, 2010
![Page 32: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/32.jpg)
Wednesday, June 2, 2010
![Page 33: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/33.jpg)
Parent POM References
! Parent POMs now prefer to resolve from repositories!Better consistency on multi-module builds
! Version-less parent references will be allowed (not quite ready)
!Will require <relativePath> tag
Wednesday, June 2, 2010
![Page 34: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/34.jpg)
<project> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.ambientideas</groupId> <artifactId>sample-multimodulejava-parent</artifactId> <version>1.0-SNAPSHOT</version> </parent></project>
Wednesday, June 2, 2010
![Page 35: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/35.jpg)
<project> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.ambientideas</groupId> <artifactId>sample-multimodulejava-parent</artifactId> <version>1.0-SNAPSHOT</version> </parent></project>
Wednesday, June 2, 2010
![Page 36: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/36.jpg)
<project> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.ambientideas</groupId> <artifactId>sample-multimodulejava-parent</artifactId> <relativePath>../</relativePath> </parent></project>
Wednesday, June 2, 2010
![Page 37: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/37.jpg)
Profiles Consolidated
•Profiles.xml external file support removed
•Folded into pom.xml
•Already a best-practice
•Necessary for Polyglot Maven
Wednesday, June 2, 2010
![Page 38: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/38.jpg)
Artifact Behavior Changes
Wednesday, June 2, 2010
![Page 39: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/39.jpg)
Maven 1.0 Deprecated
• Maven 1.0 repository support removed<layout>legacy</layout>
Wednesday, June 2, 2010
![Page 40: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/40.jpg)
SNAPSHOT Datestamps
•Deprecated <uniqueVersion> false </uniqueVersion>
•SNAPSHOTs now always deployed with date-stamps
Wednesday, June 2, 2010
![Page 41: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/41.jpg)
Artifact Resolution Caching•Caches lookups whether found or missing
•Stored in:~/.m2/repo/.../<artifact>.lastUpdated
•Sample contents:#Last modified on: Thu Dec 31 10:42:13 MST 2009#Thu Dec 31 10:42:13 MST 2009http\://localhost\:8081/nexus/content/groups/public=12333938
•Overridden by:mvn <phase> -U
Wednesday, June 2, 2010
![Page 42: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/42.jpg)
Plugin Behavior Changes
Wednesday, June 2, 2010
![Page 43: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/43.jpg)
Core Changes: Plugins!Plugin version auto-selection favors RELEASEs over SNAPSHOTs
!Affects command-line invocation of plugins
Wednesday, June 2, 2010
![Page 44: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/44.jpg)
#Maven 2.x#Will run the newest SNAPSHOT, if one is cached locallymvn archetype:generate#...actually running
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-SNAPSHOT:generate
#Maven 3.x#Will always run the newest RELEASE in Maven 3.xmvn archetype:generate#...actually running
mvn org.apache.maven.plugins:maven-archetype-plugin:2.0:generate
Command Line
Wednesday, June 2, 2010
![Page 45: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/45.jpg)
Core Changes: Plugins!Plugins versions cannot be specified as RELEASE or LATEST
!Affects pom.xml configuration and command line fully-qualified invocation
Wednesday, June 2, 2010
![Page 46: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/46.jpg)
...<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-toolchains-plugin</artifactId> <version>LATEST</version></plugin>...
pom.xml
Wednesday, June 2, 2010
![Page 47: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/47.jpg)
...<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-toolchains-plugin</artifactId> <version>LATEST</version></plugin>...
pom.xml
Wednesday, June 2, 2010
![Page 48: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/48.jpg)
Core Changes: Plugins!Plugins only resolved from <pluginRepository> locations
Wednesday, June 2, 2010
![Page 49: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/49.jpg)
http://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html
Wednesday, June 2, 2010
![Page 50: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/50.jpg)
toolchainWednesday, June 2, 2010
![Page 51: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/51.jpg)
What is toolchain?
!Single configuration for multiple plugins!Primarily supports JDK selection today!Extensible for other tools in the future
Wednesday, June 2, 2010
![Page 52: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/52.jpg)
Toolchain Config
!User tool definitions in file~/.m2/toolchains.xml
!Maven 3.0 command-line path specification!-t <toolchainspath>!--toolchains <toolchainspath>
Wednesday, June 2, 2010
![Page 53: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/53.jpg)
<?xml version="1.0" encoding="UTF8"?><toolchains> <toolchain> <type>jdk</type> <provides> <version>1.5</version> <vendor>apple</vendor> <id>default</id> </provides> <configuration> <jdkHome>/System/Library/Frameworks/JavaVM.framework/Versions/1.5</jdkHome> </configuration> </toolchain> <toolchain> <type>jdk</type> <provides> <version>1.6</version> <vendor>apple</vendor> <id>onesixjdk</id> </provides> <configuration> <jdkHome>/System/Library/Frameworks/JavaVM.framework/Versions/1.6</jdkHome> </configuration> </toolchain></toolchains>
toolchains.xml
Wednesday, June 2, 2010
![Page 54: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/54.jpg)
Using Toolchain
!Implemented as a Maven plugin!Add to <plugins> in pom.xml
!Plugin <configuration> specifies a toolchain to use!Toolchain specified by vendor and version
Wednesday, June 2, 2010
![Page 55: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/55.jpg)
...<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-toolchains-plugin</artifactId> <version>1.0</version> <executions> <execution> <phase>validate</phase> <goals> <goal>toolchain</goal> </goals> </execution> </executions> <configuration> <toolchains> <jdk> <version>1.5</version> <vendor>apple</vendor> </jdk> </toolchains> </configuration></plugin>...
pom.xml
Wednesday, June 2, 2010
![Page 56: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/56.jpg)
How does it work?
!Toolchain-enabled plugins read toolchain config first
!Plugins fall back to traditional per-plugin config if toolchain config not found
Wednesday, June 2, 2010
![Page 57: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/57.jpg)
Benefits
!Minimizes plugin configuration!Separates JDK selection from Maven core
Wednesday, June 2, 2010
![Page 58: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/58.jpg)
mvnshellWednesday, June 2, 2010
![Page 59: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/59.jpg)
http://shell.sonatype.org/
Wednesday, June 2, 2010
![Page 60: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/60.jpg)
Wednesday, June 2, 2010
![Page 61: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/61.jpg)
Wednesday, June 2, 2010
![Page 62: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/62.jpg)
What is mvnshell?
!High performance console!Maven 3.x add-on
Wednesday, June 2, 2010
![Page 63: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/63.jpg)
Wednesday, June 2, 2010
![Page 64: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/64.jpg)
Speed of Builds
Wednesday, June 2, 2010
![Page 65: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/65.jpg)
Performance of Shell
!220% faster in the demo!No JVM warm-up time!Strategies for caching
Wednesday, June 2, 2010
![Page 66: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/66.jpg)
Wednesday, June 2, 2010
![Page 67: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/67.jpg)
polyglotWednesday, June 2, 2010
![Page 68: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/68.jpg)
http://polyglot.sonatype.org/
Wednesday, June 2, 2010
![Page 69: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/69.jpg)
http://polyglot.sonatype.org/
Wednesday, June 2, 2010
![Page 70: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/70.jpg)
Wednesday, June 2, 2010
![Page 71: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/71.jpg)
What is polyglot Maven?
!Maven 3 superset!A full distribution of Maven!Enabled by Maven 3 embedding!Multi-language mvn command
Wednesday, June 2, 2010
![Page 72: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/72.jpg)
What is polyglot Maven?
!POM file converter!translate tool
!Any-to-Any language translation
Wednesday, June 2, 2010
![Page 73: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/73.jpg)
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.ambientideas</groupId> <artifactId>sample-dependency</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>Sample Project - One Dependency</name> <url>http://github.com/matthewmccullough/maven-training/</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies></project>
pom.xml
Wednesday, June 2, 2010
![Page 74: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/74.jpg)
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.ambientideas</groupId> <artifactId>sample-dependency</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>Sample Project - One Dependency</name> <url>http://github.com/matthewmccullough/maven-training/</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies></project>
pom.xml
Wednesday, June 2, 2010
![Page 75: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/75.jpg)
modelVersion: 4.0.0 artifactId: sample-dependencygroupId: com.ambientideasname: Sample Project - One Dependencypackaging: jarurl: http://github.com/matthewmccullough/maven-training/version: 1.0-SNAPSHOT
dependencies:- {artifactId: junit, groupId: junit, optional: false, scope: test, type: jar, version: 3.8.1}
pom.yaml
Wednesday, June 2, 2010
![Page 76: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/76.jpg)
(defproject main "com.ambientideas:sample-dependency:1.0-SNAPSHOT"
:model-version "4.0.0" :add-default-plugins false :name "Sample Project - One Dependency" :packaging "jar" :url "http://github.com/matthewmccullough/maven-training/" :test-dependencies [["junit:junit:3.8.1"]])
pom.clj
Wednesday, June 2, 2010
![Page 77: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/77.jpg)
project { m => m.artifactId = "sample-dependency" m.dependency { d => d.artifactId = "junit" d.groupId = "junit" d.optional = false d.scope = "test" d._type = "jar" d.version = "3.8.1" } m.groupId = "com.ambientideas" m.modelVersion = "4.0.0" m.name = "Sample Project - One Dependency" m.packaging = "jar" m.url = "http://github.com/matthewmccullough/maven-training/" m.version = "1.0-SNAPSHOT" }
pom.scala
Wednesday, June 2, 2010
![Page 78: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/78.jpg)
project { modelVersion '4.0.0' groupId 'com.ambientideas' artifactId 'sample-dependency' version '1.0-SNAPSHOT' name 'Sample Project - One Dependency' url 'http://github.com/matthewmccullough/maven-training/' dependencies { dependency { groupId 'junit' artifactId 'junit' version '3.8.1' scope 'test' } }}
pom.groovy
Wednesday, June 2, 2010
![Page 79: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/79.jpg)
Polyglot DSLs
!A true DSL framework!Maven lifecycle hooks
!Can modify execution plan!Supplement the lifecycle
Wednesday, June 2, 2010
![Page 80: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/80.jpg)
Polyglot Macros
!Maven-specific macros!Allows for more concise POMs!Groovy polyglot showcasing this
!No freeform scripting (yet)
Wednesday, June 2, 2010
![Page 81: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/81.jpg)
project { modelVersion '4.0.0' $artifact('com.ambientideas', 'sample-dependency’, '1.0-SNAPSHOT') name 'Sample Project - One Dependency' url 'http://github.com/matthewmccullough/maven-training/'
dependencies { dependency('junit', 'junit’, '3.8.1', ‘test') }}
pom.groovy with macros
Wednesday, June 2, 2010
![Page 82: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/82.jpg)
Where did we start from again?
Wednesday, June 2, 2010
![Page 83: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/83.jpg)
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.ambientideas</groupId> <artifactId>sample-dependency</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>Sample Project - One Dependency</name> <url>http://github.com/matthewmccullough/maven-training/</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies></project>
pom.xml
Wednesday, June 2, 2010
![Page 84: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/84.jpg)
M2EclipseWednesday, June 2, 2010
![Page 85: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/85.jpg)
Wednesday, June 2, 2010
![Page 86: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/86.jpg)
Upgrading M2Eclipse
!Latest version, 0.10!Code quality improvements!Performance increases!Packaging changes!Two distinct update sites!Core:! ! ! http://m2eclipse.sonatype.org/sites/m2e
!Extensions:! http://m2eclipse.sonatype.org/sites/m2e-extras
Wednesday, June 2, 2010
![Page 87: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/87.jpg)
Eclipse Versions Supported
!3.4!3.5!3.5.1 !(Recommended)
!3.6!! ! (Beta)
Wednesday, June 2, 2010
![Page 88: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/88.jpg)
Dependencies
! Visualizes conflicts! Graph and text form
! Dependency resolution tree! Answers “where is X being brought in from?”
Wednesday, June 2, 2010
![Page 89: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/89.jpg)
Dependencies
! Easy exclusions! Uses Eclipse refactoring engine
Wednesday, June 2, 2010
![Page 90: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/90.jpg)
Wednesday, June 2, 2010
![Page 91: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/91.jpg)
Class Search
! Search the entire central repository for! Artifact
! Package
! Classname
! Lucene database! Incremental updates
Wednesday, June 2, 2010
![Page 92: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/92.jpg)
Class Search
Wednesday, June 2, 2010
![Page 93: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/93.jpg)
Wednesday, June 2, 2010
![Page 94: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/94.jpg)
Maven 3.1Wednesday, June 2, 2010
![Page 95: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/95.jpg)
Maven 3.1 POM Changes
! Backwards compatibility by modelVersion! Final identifier TBD for 3.1 POM syntax! Allows 3.1 to read 3.0, 2.0 POMs
<project> <modelVersion>4.0.0</modelVersion> <groupId>com.ambientideas</groupId> <artifactId>sample-barestbones</artifactId> <version>1.0-SNAPSHOT</version></project>
Wednesday, June 2, 2010
![Page 96: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/96.jpg)
Maven 3.1 POM Changes
!pom.xml syntax changes!Site plugin takes over <reporting>
!“Mixins” for direct dependencies!Sometimes desired over POM inheritance
!Plugin security manager!settings.xml as default implementation
Wednesday, June 2, 2010
![Page 97: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/97.jpg)
SummaryWednesday, June 2, 2010
![Page 98: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/98.jpg)
Summary•Validations
•Performance
•Compatibility
•Toolchain
•Shell
•Polyglot
•M2Eclipse
Wednesday, June 2, 2010
![Page 99: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/99.jpg)
Maven 3.0What’s new in
EmailTwitterBlog
Matthew [email protected]@matthewmccullhttp://ambientideas.com/blog
Wednesday, June 2, 2010
![Page 100: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/100.jpg)
ReferencesWednesday, June 2, 2010
![Page 101: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/101.jpg)
!Maven 3 Core! Homepage
! http://maven.apache.org/
! Source Code! http://svn.apache.org/viewvc/maven/maven-3/trunk
! Wiki! http://cwiki.apache.org/MAVEN/maven-3x.html
! Bug Tracking! http://jira.codehaus.org/browse/MNG
! Compatibility! http://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html
! Blog Posts! http://www.sonatype.com/people/2009/11/maven-3x-paving-the-desire-lines-
part-two/
! Bookmarks! http://delicious.com/matthewmccullough/maven
Wednesday, June 2, 2010
![Page 102: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/102.jpg)
!Maven 3 Site Plugin!Source Code! https://svn.apache.org/repos/asf/maven/plugins/branches/
maven-site-plugin-3.x/
!Wiki! http://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html
Wednesday, June 2, 2010
![Page 103: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/103.jpg)
!Maven Shell!Source Code! http://github.com/sonatype/mvnsh/
!Wiki! https://docs.sonatype.org/display/MVNSH
!Homepage! http://shell.sonatype.org/
Wednesday, June 2, 2010
![Page 104: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/104.jpg)
!Polyglot Maven!Homepage! http://polyglot.sonatype.org/
!Source Code! http://github.com/sonatype/polyglot-maven
!Wiki! https://docs.sonatype.org/display/PMAVEN/
!Groovy Macros! https://docs.sonatype.org/display/PMAVEN/Groovy
Wednesday, June 2, 2010
![Page 105: s new in Maven 3 - Jazoon](https://reader035.fdocuments.us/reader035/viewer/2022062513/62b236816d104e4eec68ad3c/html5/thumbnails/105.jpg)
!M2Eclipse!Homepage! http://m2eclipse.sonatype.org/
!Update Sites! http://m2eclipse.sonatype.org/sites/m2e! http://m2eclipse.sonatype.org/sites/m2e-extras
Wednesday, June 2, 2010