Maven 2 The Maven Apache. Overview What's new in Maven 2.0 Maven 2.0 and Ant... and anything else you'd like to know about.

Slides:



Advertisements
Similar presentations
Configuration management
Advertisements

Configuration management
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Configuration Management
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Introduction to Maven Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to the Java Stack.
Build your Android App with Gradle Android new build system.
Transitions of Care Reference Implementation Development Overview July 5, 2011.
Test Automation Framework Ashesh Jain 2007EE50403 Manager Amit Maheshwari.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler.
Java development infrastructure at FMI Pekka Rantala FMI.
Maven: Build and project management in the 21th century.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Systems Analysis and Design in a Changing World, 6th Edition
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Automating the Build Process using ANT SE-2030 Dr. Mark L. Hornick 1.
2007 Adobe Systems Incorporated. All Rights Reserved. 1 Joe Berkovitz VP Engineering Allurent, Inc. Continuous Integration with Flex, FlexUnit, and Ant.
Using Ant to build J2EE Applications Kumar
This chapter is extracted from Sommerville’s slides. Text book chapter
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Maven and Stack Starter Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
SOA-14: Continuous Integration in SOA Projects Experience from the field Andreas Gies Principal Architect.
Sumedha Rubasinghe October,2009 Introduction to Programming Tools.
Automating the Build Process using Ant SE-2030 Dr. Rob Hasker 1 Based on material by Dr. Mark L. Hornick.
COMP-14: Automating your deployments using ANT Gary S Clink Business Consultant.
LDS Account Integration. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in labs Please ask questions Prerequisites:
Using the ALM Module Fully Automated Deployments in Stack 3.2.
INFSOM-RI Juelich, 10 June 2008 ETICS - Maven From competition, to collaboration.
Using the ALM Module Michael Youngstrom. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in lab Please ask questions.
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
Distributed Java Programming Distributed Java Programming Setting up a Java Development Environment.
introducing the Java Data Processing Framework Paolo Ciccarese, PhD On behalf of the JDPF Team Pavia, December 11, 2007.
© 2006 Intland Software1 Aron Gombas Architect, Intland Software Extending & customizing CodeBeamer.
Overview of the Automated Build & Deployment Process Johnita Beasley Tuesday, April 29, 2008.
14th Oct 2005CERN AB Controls Development Process of Accelerator Controls Software G.Kruk L.Mestre, V.Paris, S.Oglaza, V. Baggiolini, E.Roux and Application.
Configuration Management CSCI 5801: Software Engineering.
CPSC 871 John D. McGregor Change management Module 2 Session 3.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
Maven 2.0 Improve your build patterns Vincent Massol CTO Pivolis.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
G.Govi CERN/IT-DB 1 September 26, 2003 POOL Integration, Testing and Release Procedure Integration  Packages structure  External dependencies  Configuration.
1 Chapter 12 Configuration management This chapter is extracted from Sommerville’s slides. Text book chapter 29 1.
Build Systems Presentation December 14, 2015 Noon-1pm Kathy Lee Simunich Bldg. 203/ D120 Brought to you by: Argonne Java.
Managing your builds with Maven 2 Craig Walls LoneStar Software Symposium 2007
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
An EPICS IDE Using Eclipse Kenneth Evans, Jr. Presented at the EPICS Collaboration Meeting June 15, 2006 Argonne National Laboratory, Argonne, IL.
JRA1 Meeting – 09/02/ Software Configuration Management and Integration EGEE is proposed as a project funded by the European Union under contract.
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
CS520 Web Programming Introduction to Maven Chengyu Sun California State University, Los Angeles.
Review for Eclipse Release Review | © 2012 by Review for Eclipse Committers, made available under the EPL v1.0 1 Review for Eclipse (R4E) 0.11 Release.
Maven and Jelly James Strachan. Introduction Maven and Jelly are both Apache projects at Jakarta Ultimately both will be top.
Maven & NetBeans Platform. Agenda ● Maven NetBeans Platform Project Types ● Three NetBeans RCP project types ● Differences with Ant project types ● All.
Open-O Integration Project Introduction
Maven 04 March
Maven 2 The Maven Apache.
Brian Leonard ブライアン レオナルド
Maintaining software solutions
Advanced Integration and Deployment Techniques
What’s changed in the Shibboleth 1.2 Origin
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Module 01 ETICS Overview ETICS Online Tutorials
JENKINS TIPS Ideas for making your life with Jenkins easier
Overview Activities from additional UP disciplines are needed to bring a system into being Implementation Testing Deployment Configuration and change management.
Continuous Integration
Plug-In Architecture Pattern
Presentation transcript:

Maven 2 The Maven Apache

Overview What's new in Maven 2.0 Maven 2.0 and Ant... and anything else you'd like to know about

Maven 2.0 Is a complete rewrite from Maven 1.0/1.1 Scheduled for beta testing in July, final release in August Built around reusable libraries: –Artifact code used in Ant tasks –Wagon, SCM and project loading being used in Maven 1.1

Why rewrite Maven for 2.0? Started parallel development in early 2003, well before Maven 1.0 final! More consistent definition of all parts of the system Architecture supports features and that the original couldn't Faster, lighter, smaller - embeddable Making it simpler to use required reworking many core concepts

Maven 2.0 Architecture

Maven 2.0 Architecture - Plexus Based on Plexus – an IoC container supporting component oriented programming (COP) encouraging a clear Separation of Concerns (SoC) Plugins are handled as Plexus components though plugins have no direct dependency on Plexus

Maven 2.0 Component Architecture

Maven 2.0 New Features (alpha-3) Enhanced dependency support Build life cycle Unified project file Enhanced plug-in support Multi-module project support Site and documentation enhancements Release management Archetypes - project templates Build Profiles

Adding Dependencies Declaration will download it, add it to the classpaths, bundle it into the resulting distribution if appropriate, etc. Main hurdle is non-redistributable artifacts – manual installation Now transitive – dependencies of dependencies org.apache.maven.wagon wagon-provider-api 1.0-alpha-3

Transitive Dependencies Always enabled in Maven 2.0 Don't need to declare dependencies of dependencies yourself Frequently requested, but has more consequences than often realised... –Version conflicts –Unwanted dependencies –Bad published meta data – report at –Not a hard problem with good data

Dependency Scope compile (default), runtime, test, provided Control classpath and distribution bundling Helpful for transitive dependencies (don't get test transitively) Only need to specify one – others may be implied

Controlling Transitive Dependencies Filter out dependencies Preferably dependency would be split into isolated pieces, with one POM to aggregate back if needed E.g. Velocity “depends” on JDBC, but only in some conditions org.apache.maven.wagon wagon-provider-api 1.0-alpha-3 jdbc

Snapshot Handling Deploying to a shared repository gives a version with a time stamp and build # Don’t need to update dependency version to get updated builds Updates daily, on-demand, or at a particular interval Developers can get access to co- workers changes earlier without the need to update and build

Build Life cycle Builds in Maven follow a pattern Ensures developers moving between projects do not need to learn new processes

Build Life cycle Plugins can augment the build life cycle For example: –JAXB could register an XSD to Java goal in generate-sources, then add it to the compilation list –Xdoclet could register a goal to create a Hibernate mapping in process-resources. The builder still only needs to know to use m2 package Replaces use of preGoal from Maven 1

Unified Project File Self contained, and no file system references making it usable from the repository project.properties and maven.xml replaced by custom plugins and configuration parent element replaces extend org.apache.maven maven

Configuring Plugins Configure how your project is built In Maven 1, project.properties file Example: compile with JDK 5.0 options org.apache.maven.plugins maven-compiler-plugin 1.5

On-demand Features Plugins can be requested on-demand from the command line In Maven 1, this required manual installation For example, idea:idea will generate an IDEA project file without modifications to your project

Plugin Version Discovery Can opt not to declare a plugin version in your project Will regularly check for a new release, and download it if desired Users can opt to get prompted for new releases of plugins Release tool will record the active version for reproducible builds

Plugin Languages Java, Beanshell, Marmalade Java is the most common Beanshell is new, useful for rapid prototyping Marmalade is primarily to ease porting of Jelly-based plugins, and to make available Ant tasks in an XML syntax Can support others with a small amount of work if there is demand –For example: Jython, Groovy, JRuby

Java Plugin import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException;... /** * Goal which cleans the build. touch process-sources */ public class CoreItMojo extends AbstractMojo { expression="${project.build.directory}" */ private File outputDirectory; /** Whether it is enabled. */ private boolean enabled; public void execute() throws MojoExecutionException { if ( enabled ) { getLog().info( “Path is ” + outputDirectory ); }

Beanshell Plugin /** * Beanshell mojo integration test. it0020 */ import org.apache.maven.plugin.Mojo; import org.apache.maven.script.beanshell.BeanshellMojoAdapter; import org.codehaus.plexus.util.FileUtils; execute() { logger.info( "Executing it " ); print( "info level?" ); FileUtils.fileWrite( outDir.getAbsolutePath() + "/out.txt", "This is a Beanshell test" ); } /** * Output directory for files. * expression="${project.build.directory}" type="java.io.File" */ setOutDir( file ) { outDir = file; } return new BeanshellMojoAdapter( (Mojo) this, this.interpreter );

Marmalade it0015 Output a file with specified contents to [outDir] outDir java.lang.String ${project.build.directory} Output directory for files. <it0015:writeFile xmlns:it0015="marmalade:it0015" path="${outDir}/out.txt"> This is a test.

Multiple Modules Maven 2 natively deals with multi- module builds A module refers to another project in the build tree Goals are performed on all found modules by default, so m2 install will perform an install for all found modules Modules can in turn have modules wagon-provider-api wagon-providers

Site and Documentation A lot faster than previously Accepts several input formats –Almost Plain Text (Wiki like) –Xdoc (Maven 1.0 compatible) –FAQ (Maven 1.0 compatible) –Docbook Presently outputs XHTML, Xdoc, Docbook, Latex and RTF –PDF also planned

Example APT Document Generating a Site Brett Porter May Building a Site * Creating Content The first step to creating your site is to create some content. In Maven 2.0, the site content is separated by format, as there are several available src/ +- site/ +- apt/ | +- index.apt +- site.xml The Xdoc format is the same as {{{ used in Maven 1.0}}. However, >> has been replaced by the site descriptor (see below).

Example APT Document

Release Assistance Improvement on the tasks from the SCM plugin in Maven 1.0 Resolves information in the project to make the release reproducible Updates the version information, commits and tags a release Does a clean checkout and builds the release –Can be in the same environment, or a dedicated known build environment

Project Archetypes m2 archetype:create Generates a template project for you Currently archetypes for: –JAR/WAR –Site –Java and Marmalade Plugins Can easily create your own archetypes Uses Velocity Downloaded from the repository so they are easily shared

Build Profiles Change the build depending on the environment –Dependencies, repositories, plugins and configuration Trigger by operating system, JDK, extistence of software, and so on, as well as command line parameter Per user or per project Used to set up standard environments: –Development, Test, QA and Production

Maven 2.0 Features Coming (July) More on dependency mediation Other languages (maybe beyond 2.0)

Dependency Mediation Allows specification of a range of versions for a dependency Maven will help resolve the best version available Techniques for handling conflicts –Fail, Newest, Nearest Release tool fills in versions later jaxb jaxb-api [1.0.1,)

Support for Other Languages Being implemented as plugins Currently have seen work on a C# compiler, and plan to support C/C++ environments on Unix and Windows May not be available at Maven 2.0 final release

Moving from Ant to Maven 2 Identify sections of build.xml that are standard functionality Build Maven 2 projects from scratch –Use m2 ant:ant to generate and use from master Ant script Create Maven plugins for custom functionality, wrap them as Ant tasks If Ant already works fine for you, you can still use some Maven features from Ant 1.6 today

Using Maven 2 From Ant Currently exposes the dependency and artifact handling as Ant tasks Ant 1.7 will utilise the artifact antlib for dependency management –Download dependencies (all features) –Share a local Maven repository –Install and deploy artifacts to a repository –Expose a POM as Ant properties

The Artifact Antlib <artifact:localRepository id="local.repository" location="${basedir}/target/local-repo" /> <artifact:dependencies pathId="dependency.classpath" filesetId="dependency.fileset"> <dependency groupId="org.apache.maven.wagon" artifactId="wagon-provider-test" version="1.0-alpha-2"/> <dependency groupId="org.codehaus.modello" artifactId="modello-core" version="1.0-alpha-2-SNAPSHOT"/> Now building ${maven.project.name}...

The Artifact Antlib... <artifact:remoteRepository id="deploy.repository" url="file://${basedir}/target/deployment-repo" layout="legacy"/> <authentication username="brett" privateKey="${user.home}/.ssh/id_dsa"/>

Maven and the IDE MevenIDE project –Started out with NetBeans, Eclipse –Relatively new Jbuilder and IDEA plugins –Shared base code –Changes reflect in project and IDE –Planning support for embedded Maven 2 and remote Continuum –Independent of the Maven project Maven has project generation for several IDEs for one way creation

Resources Maven site and lists – Maven Blogs –

Getting Involved As with any open source project, there are several ways you can get involved –Join the mailing list and answer other user's questions –Report bugs, feature requests and other issues in the issue tracking application. –Submit patches to reported issues (both those you find, or that others have filed)

Questions? Thanks for listening!