Maven 3.x: The Evolution ofEnterprise Java Build Infrastructures     The Maven-related tooling youʼll be using in your    ...
Agenda & Session GoalsWhat weʼre going to talk about and accomplish this session                     2. Developer checks i...
Agenda & Session GoalsWhat weʼre going to talk about and accomplish this session To understand how Maven 3.x and its relat...
Updates on Maven, M2Eclipse & Tycho ...Whatʼs going on at Sonatype & in Maven land?• Maven 3.0-final has been released. Yay...
Maven Central Unique IPs / Month [Aug2009 to Aug2010]900,000                                                              ...
Maven 3.1Whatʼs going on for Maven 3.1• POM interoperability• Maven 3.1 Plugin API (SM --> AM)   • JSR-330   • Java5 annot...
Sonatypeʼs Maven PlanRapidly innovate while being reconciled to the Apache Way                                            ...
A Maven-focused HudsonSonatype is doing a lot of work with Hudson• JSR-330-based plugins• REST support using Apache Wink• ...
The Idea Development InfrastructureNow letʼs talk about some of the underlying technologies                     2. Develop...
The ideal Maven-focused delivery infrastructureWhat does that look like?• Shared component & plugin model• Shared transpor...
Shared component modelFor Sonatype this means JSR-330         M2Eclipse        Git     Hudson                        Nexus...
Moving from Plexus to Guice & JSR-330Making it all work with Guice• Requirements   • Absolutely no code changes for any Ma...
Implications of using JSR-330We bring some sanity to tooling• Writing plugins in various ways for tools like Maven, Nexus,...
Sisu Maven Plugin ExampleUsing the same component model@Goal( "webxml" )@Phase( GENERATE_RESOURCES )@RequiresProject@Threa...
Sisu Hudson Plugin ExampleUsing the same component model@Named@Singletonpublic class RestPlugin    extends Plugin{    @Inj...
Sisu Nexus Plugin ExampleUsing the same component model@Named@Singleton@Path( CapabilitiesResource.RESOURCE_URI )@Produces...
Shared transport systemFor Sonatype this means the Async HTTP Client          M2Eclipse          Git      Hudson          ...
Shared repository APIFor Sonatype this means our new Aether library          M2Eclipse         Git         Hudson         ...
AetherOverhauled Repository Artifact Resolution API• The artifact resolution code has always been relatively decoupled, bu...
Aether Resolution ExampleEasy to embed and simply use as a librarypublic void resolve( String remoteRepository, File local...
Aether Install & Deploy ExampleEasy to embed and simply use as a librarypublic void installAndDeploy( String remoteReposit...
Enriched component metadataWhat is that and how do we get it?• First we need to clean up the way artifacts get into Maven ...
Maven Central QualitySonatype is working hard to clean up Maven Central• Bullet• Bullet       https://docs.sonatype.org/di...
Enriched component metadataWhat is that and how do we get it?• Project relationships   • In order to do everything we want...
Enhanced IDE connectivity to the infrastructureThe IDE is the cockpit for a developer and be easy to get into• Onboarding ...
Developer Onboarding & UpdatingMSE Codebase                         Publish LineupEclipse Preferences                     ...
Nexus: Access to Archetypes
Nexus: Access to Artifacts
Nexus: Access to Plugins
Idiom: Access Wikis
Hudson: Access to Build Jobs
Hudson: Access to Build Job Details
Hudson: Direct Navigation to Test Failures
Questions & Answers
Next Generation Development Infrastructure: Maven, m2eclipse, Nexus & Hudson par Jason Van Zyl
Upcoming SlideShare
Loading in …5
×

Next Generation Development Infrastructure: Maven, m2eclipse, Nexus & Hudson par Jason Van Zyl

3,785 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,785
On SlideShare
0
From Embeds
0
Number of Embeds
233
Actions
Shares
0
Downloads
70
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Next Generation Development Infrastructure: Maven, m2eclipse, Nexus & Hudson par Jason Van Zyl

  1. 1. Maven 3.x: The Evolution ofEnterprise Java Build Infrastructures The Maven-related tooling youʼll be using in your infrastructure for years to come Jason van Zyl http://twitter.com/jvanzyl
  2. 2. Agenda & Session GoalsWhat weʼre going to talk about and accomplish this session 2. Developer checks in source code 3. Hudson checks out the source code M2Eclipse 2 Git 3 Hudson 4. Hudson instructs Maven to perform 4 1 the automated build 1. Developer requests binary dependencies from Nexus Nexus 5 Maven 5. Maven deploys build 6a. Proviso requests artifacts to Nexus updates to runtime components 6 6b. Nexus sends component from Nexus updates to Proviso Maven Central++ Maven Central Agent Proviso 7 Agent Agent 7. Proviso provisions components and configurations into the target runtime
  3. 3. Agenda & Session GoalsWhat weʼre going to talk about and accomplish this session To understand how Maven 3.x and its related tools & frameworks are going to help us get to that ideal delivery infrastructure
  4. 4. Updates on Maven, M2Eclipse & Tycho ...Whatʼs going on at Sonatype & in Maven land?• Maven 3.0-final has been released. Yay!• Sonatype is planning features for what we would like to see in Maven 3.1• M2Eclipse 1.0 will be released after two 4-6 week iterations or so. • Itʼs getting better rapidly because most of Sonatypeʼs Eclipse team is working on it. • We are moving M2Eclipse to the Eclipse Foundation • Weʼve started checking in the code at the Eclipse Foundation• Tycho passed its project creation review at the Eclipse Foundation, has been provisioned, and will soon begin the parallel IP process• MavenShell 1.0 will be released December 1st• PolyglotMaven 1.0 will be released January 1st• PDE replacement using Tycho hopefully demo-ready in a couple weeks• We hope to submit our JSR-330 and REST work to the Hudson project soon & possibly working with Oracle to implement Maven 3.x support
  5. 5. Maven Central Unique IPs / Month [Aug2009 to Aug2010]900,000 832,749 787,939 789,814 735,809 742,882 712,863 723,822 698,823 667,708675,000 646,600 588,141 557,734 514,589450,000 Maven is the de facto component distribution infrastructure for Java projects Maven Central is the de facto225,000 store house of all Open Source Java components: ~300M hits/month 0 Aug Sep Oct Nov Dec Jan Feb Mar Apr May Jun Jul! Aug non-Maven < 0.5% 2008 Total Unique IPs: 1,836,709 RM < 7% 2009 Total Unique IPs: 3,978,964 2010 Total Unique IPs: 6,024,701(end of Aug)
  6. 6. Maven 3.1Whatʼs going on for Maven 3.1• POM interoperability• Maven 3.1 Plugin API (SM --> AM) • JSR-330 • Java5 annotations • Tight integration with M2Eclipse • Build avoidance• Mixins (SM --> AM)• Versionless parents in child POMs (SM --> AM)• Concurrent-access local repository implementation (SM)• Async HTTP Client connector for Aether (SM)• Async HTTP Client Wagon (SM)• Dynamic Extension API (SM)• Eventing API (SM)
  7. 7. Sonatypeʼs Maven PlanRapidly innovate while being reconciled to the Apache Way MavenIDE @ Github M2Eclipse MavenShell @ Github @ Eclipse Sonatype Maven Apache Maven Tycho @ Eclipse @ Github Apache Maven Polyglot Maven F1 F2 F3 @ Github @ Github
  8. 8. A Maven-focused HudsonSonatype is doing a lot of work with Hudson• JSR-330-based plugins• REST support using Apache Wink• Global configuration management• Apache Shiro integration for security management and SSO• Slave tool provisioning with Proviso (based on Eclipse p2)• Integration with M2Eclipse (Sonatype Professional)• Maven 3.x integration (in progress)• Long-lived workflow using Drools Flow (research)
  9. 9. The Idea Development InfrastructureNow letʼs talk about some of the underlying technologies 2. Developer checks in source code 3. Hudson checks out the source code M2Eclipse 2 Git 3 Hudson 4. Hudson instructs Maven to perform 4 1 the automated build 1. Developer requests binary dependencies from Nexus Nexus 5 Maven 5. Maven deploys build 6a. Proviso requests artifacts to Nexus updates to runtime components 6 6b. Nexus sends component from Nexus updates to Proviso Maven Central++ Maven Central Agent Proviso 7 Agent Agent 7. Proviso provisions components and configurations into the target runtime
  10. 10. The ideal Maven-focused delivery infrastructureWhat does that look like?• Shared component & plugin model• Shared transport system• Shared repository API• Enriched component metadata• Enhanced IDE connectivity to the infrastructure• Provisioning (I think this might have to wait until the next webinar)
  11. 11. Shared component modelFor Sonatype this means JSR-330 M2Eclipse Git Hudson Nexus Maven Agent Proviso JSR-330 Agent Agent
  12. 12. Moving from Plexus to Guice & JSR-330Making it all work with Guice• Requirements • Absolutely no code changes for any Maven, Nexus, M2Eclipse component • Must support Plexusʼ classpath/resource scanning • Must support Plexusʼ dynamic component assembly based on discovered metadata • Must support Plexusʼ configuration & converter mechanism • When we need changes made to the runtime container, we need those changes to be timely • Support for arbitrary lifecycles • We need the container to be wed with OSGi -- for us the answer is Peaberry • Component graph proxy support: for components and configuration • Dynamic language support
  13. 13. Implications of using JSR-330We bring some sanity to tooling• Writing plugins in various ways for tools like Maven, Nexus, Hudson, Sonar & Eclipse has a great deal of mental overhead. This burden will be removed.• The implications for development, testing and delivery are huge. They cannot be understated • Common development models: how to create JSR-330-based plugins, better component reuse, a common understand of infrastructure tooling • Common testing frameworks for JSR-330 e.g Sonatypeʼs REST/UI toolkit • Common provisioning models
  14. 14. Sisu Maven Plugin ExampleUsing the same component model@Goal( "webxml" )@Phase( GENERATE_RESOURCES )@RequiresProject@Threadsafepublic class GenerateWebXml extends SisuMavenMojo { @Inject Logger logger; @Inject private Component component; @Inject @Named( "${project}" ) private MavenProject project; @Inject @Named( "${outputDirectory}" ) @DefaultsTo( "${project.build.directory}" ) private File outputDirectory; @Inject private List<WebXmlAugmenter> webXmlAugmenters; public void execute() throws Exception { component.generate( project, webXmlAugmenters, outputDirectory ); }}
  15. 15. Sisu Hudson Plugin ExampleUsing the same component model@Named@Singletonpublic class RestPlugin extends Plugin{ @Inject private Logger logger; private transient List<ApiProvider> providers; private boolean enabled = true; @Inject public RestPlugin(final List<ApiProvider> providers) { assert providers != null; this.providers = providers; logger.debug("Providers:"); for (ApiProvider provider : providers) { logger.debug( " {}", provider );        }    }}
  16. 16. Sisu Nexus Plugin ExampleUsing the same component model@Named@Singleton@Path( CapabilitiesResource.RESOURCE_URI )@Produces( { "application/xml", "application/json" } )@Consumes( { "application/xml", "application/json" } )public class CapabilitiesResource implements Resource { public static final String RESOURCE_URI = "/capabilities"; private final CapabilityConfiguration capabilitiesConfiguration; private final CapabilityDescriptorRegistry capabilityDescriptorRegistry; @Inject public CapabilitiesResource( CapabilityConfiguration capabilitiesConfiguration, CapabilityDescriptorRegistry capabilityDescriptorRegistry ) { this.capabilitiesConfiguration = capabilitiesConfiguration; this.capabilityDescriptorRegistry = capabilityDescriptorRegistry; ... }}
  17. 17. Shared transport systemFor Sonatype this means the Async HTTP Client M2Eclipse Git Hudson Nexus Maven Agent Proviso Agent Agent Async HTTP Client
  18. 18. Shared repository APIFor Sonatype this means our new Aether library M2Eclipse Git Hudson 1 Nexus 5 Maven 6 Agent Proviso 7 Aether Agent Agent
  19. 19. AetherOverhauled Repository Artifact Resolution API• The artifact resolution code has always been relatively decoupled, but Aether is a completely stand-alone library and has no dependencies on Maven• SSL support• DAV support• Proxies• NTLM(v2)• Transport • Weʼre using the Async HTTP client being developed by Jean-francois Arcand at Sonatype• Hoping to collaborate on research with Daniel Le Berre to determine if p2 can be used to do Maven resolution. Ultimately we would like to merge our code into p2 and just use p2
  20. 20. Aether Resolution ExampleEasy to embed and simply use as a librarypublic void resolve( String remoteRepository, File localRepository ) throws DependencyCollectionException, ArtifactResolutionException{ Aether aether = new Aether( repoRepository, localRepository ); AetherResult result = aether.resolve( "com.mycompany.app", "super-app", "1.0" ); // Get the root of the resolved tree of artifacts // DependencyNode root = result.getRoot(); // Get the list of files for the artifacts resolved // List<File> artifacts = result.getResolvedFiles(); // Get the classpath of the artifacts resolved // String classpath = result.getResolvedClassPath();}
  21. 21. Aether Install & Deploy ExampleEasy to embed and simply use as a librarypublic void installAndDeploy( String remoteRepository, File localRepository String deployRepository ) throws InstallationException, DeploymentException{ Aether aether = new Aether( remoteRepository, localRepository ); Artifact artifact = new DefaultArtifact( "com.mycompany", "super-core", "jar", "1.0" ); artifact = artifact.setFile( new File( "jar-from-whatever-process.jar" ) ); Artifact pom = new SubArtifact( artifact, null, "pom" ); pom = pom.setFile( new File( "pom-from-whatever-process.xml" ) ); // Install into the local repository specified // aether.install( artifact, pom ); // Deploy to the specified deploy reposistory // aether.deploy( artifact, pom, deployRepository );}
  22. 22. Enriched component metadataWhat is that and how do we get it?• First we need to clean up the way artifacts get into Maven Central
  23. 23. Maven Central QualitySonatype is working hard to clean up Maven Central• Bullet• Bullet https://docs.sonatype.org/display/Repository/Home • Bullet
  24. 24. Enriched component metadataWhat is that and how do we get it?• Project relationships • In order to do everything we want below we need to build up a comprehensive graph of all the relationships between projects in Maven Central• Project statistics • Project really want to know how their projects are being consumed on Maven Central• Quality metadata • Test coverage • Information provided by many of the existing tools like PMD, Checkstyle, Findbugs• Provenance metadata • License information • IP information• Security metadata • Tracking vulnerabilities and determining how it affects your organization
  25. 25. Enhanced IDE connectivity to the infrastructureThe IDE is the cockpit for a developer and be easy to get into• Onboarding & updating • Getting developers up and running quickly & helping developers update environments and transition to new projects• Connectivity to • Maven • SCM • Hudson • Nexus • Proviso• Connectivity to enhanced Maven Central metadata
  26. 26. Developer Onboarding & UpdatingMSE Codebase Publish LineupEclipse Preferences Publish CodebaseCodebase Description/Icon (one or more)Source Tree SCM Information Request Codebase Project Information Materialize/Update Source RootsMSE Lineup Eclipse Distribution Eclipse Plugins/ Components
  27. 27. Nexus: Access to Archetypes
  28. 28. Nexus: Access to Artifacts
  29. 29. Nexus: Access to Plugins
  30. 30. Idiom: Access Wikis
  31. 31. Hudson: Access to Build Jobs
  32. 32. Hudson: Access to Build Job Details
  33. 33. Hudson: Direct Navigation to Test Failures
  34. 34. Questions & Answers

×