maven university-course
TRANSCRIPT
Java Build Tooling
Apache Maven
Olivier Lamy | @olamy
VP Apache Maven, ASF Member
Agenda
Who am I: Introduction
What is the Apache Software Foundation
Java build tools evolution
Apache Maven
Extend Apache Maven
Complementary Tooling
Put the item people are least familiar with, but which is really most important, first.While the Apache Projects provide all the code, it's the Foundation and the Apache Way that enable them to do that independently, and for the long-term.
/me
Olivier Lamy (@olamy ) (twitter.com/olamy)
https://www.slideshare.net/olamy / http://olamy.blogspot.fr
Apache Software FoundationMember
VP, Maven
PMCs: Maven, Archiva, Tomcat, Sqoop, DirectMemory, Kalumet
Commiter: Commons
Jenkins etc.. (add bugs in various opensource projects)
Also a OpenSource Architect at Talend
Note that currently 100% of my time on Apache work is as an unpaid volunteer; my IBM job is completely unrelated (both technically and organizationally).
What is The ASF
Membership-based corporation; Non-profit US 501(c)3 Charity
Directors, officers all unpaid volunteers
Paid contractors: sysadmins, press officer
Broad-based Membership of individuals ensures independence
Collection of Apache project communities
The most important thing to realize on this slide: while the Foundation provides a home for over 100 projects, each of those projects is really an independent community of developers and users.
Board of9 DirectorsPMCs100++Apache Org Chart
Nominate, elect Directors annually
Members~400Nominate, elect new members
Appoint officers
Report monthly
Officers~10Define organizational & legal policies
Create & update upon PMC request
Report quarterly
Committers~3,000Write project code
Vote for project releases
Nominate, elect new committers
OrganizationalOversight
TechnicalOversight
Fundamentally, the organization is pretty simple. The Membership elects a Board of Nine Directors annually. The Board sets overall policy and provides oversight for all operations.Note especially that officers and PMCs report directly to the board. The President and VP, Infrastructure manage day-to-day operations but only of the infrastrucutre itself, not of our projects.The most important thing to realize from this picture is (click) that everything to the left of the page only provides organizational oversight. All technical decisions are made on the right hand half within the PMCs and projects individually.
Apache Mission: What
Provide open source software to the public free of chargeApache
aims to provide a pragmatic, non-technical framework to its
projects.
- Justin Erenkrantz
Let coders code; Foundation exists to do rest
Community over code
It's really that simple. The Foundation's purpose is to serve as a stable and independent home for it's projects. The Foundation should only be there to handle the stuff coders don't want to do or aren't good at handling; everything else and especially all technical decisions are made by the coders in PMCs and projects.
Apache License
Apache projects use the Apache License 2.0
Pragmatic and permissiveMaximum freedom for users
Includes patent grant
Easily and frequently used by other groups
All Apache software should be useable under our license. This
ensures maximum freedom for users.
This also ensures that software released with our license is
available to the public.
Apache Projects
Over 100 code-producing community driven projects50+ Podlings in Incubation
Apache Projects include millions of lines of code overseen by an all-volunteer community across six continents. Apache technologies power more than half the Internet, petabytes of data, teraflops of operations, billions of objects, and enhance the lives of countless users and developers.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Projects
Industry standards:Apache HTTP Server (original project from the foundation)
Apache Tomcat (Servlet container)
Apache Hadoop
Apache Commons *
Apache Subversion
Etc http://projects.apache.org/indexes/alpha.html
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Java Build Tools Evolution
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Javac
Basic command line tool
Too many parameters to set for classpath, sourcepath, annotations processors etc..
Use it for hello world only
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Java Build Evolution
We don't only build one or two classes.
Use of external dependencies
Complex packaging (not only jars)
Running tests (complex tests)
Interaction with external tools (issues trackers, scm, ci servers)
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles-Apache Ant Website
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
Why create another tool when make, gnumake already exist?
They all have some limitationsThey are more Shell BasedLimits you to one kind of OS
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
Ant has Java Class like extensionsUse of XML instead of Shell ScriptsEach task is taken care of by creating its objectStandardizedPlatform Independent
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
Build.xml:Similar to makefile but an XML file
It's the default file where ant will look for what to build, how to build
Has projects, targets, tasks
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
Simple build file
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
Download from http://ant.apache.org/bindownload.cgi
Sample project: https://github.com/olamy/hello-worldgit clone https://github.com/olamy/hello-world.gitorhttps://github.com/olamy/hello-world/archive/master.zip
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
ant -p: list all targets ant compile
ant run-tests
ant package
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
So you have to define everythinginclude jars in your source tree/scmeach ant build is a rewrite of an other one
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution: Maven
Download from http://maven.apache.org/download.html
M2_HOME= path to maven home installPATH=$M2_HOME/bin:$PATH
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution: Maven
pom.xml is small Same project: mvn test, mvn package
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution : Ant
Ant doesn't have formal conventions like a common project directory structure, you have to tell Ant exactly where to find the source and where to put the output. Informal conventions have emerged over time, but they haven't been codified into the product.
Ant is procedural, you have to tell Ant exactly what to do and when to do it. You had to tell it to compile, then copy, then compress.
Ant doesn't have a lifecycle, you had to define goals and goal dependencies. You had to attach a sequence of tasks to each goal manually.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Build Evolution: Maven
Maven has conventions, it already knew where your source code was because you followed the convention. It put the bytecode in target/classes, and it produced a JAR file in target.Maven is declarative. All you had to do was create a pom.xml file and put your source in the default directory. Maven took care of the rest.Maven has a lifecycle, which you invoked when you executed mvn install. This command told Maven to execute a series of sequence steps until it reached the lifecycle. Maven executed a number of default plugin goals which did things like compile and create a JAR.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven: History
Maven, a Yiddish word meaning accumulator of knowledge, was originally started as an attempt to simplify the build processes in the Jakarta projects. There were several projects each with their own Ant build files that were all slightly different and JARs were checked into CVS. We wanted a standard way to build the projects, a clear definition of what the project consisted of, an easy way to publish project information and a way to share JARs across several projects.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven: History
Maven 1.0
Introduced dependency mechanism and remote repositoriesPlugin mechanismLimited to a wrapper on the top of Ant using ant and jelly scriplet
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven: History
Maven 2.0
Full rewrite using plain Java and IoC container Plexus (fork of dead Apache Avalon)New Pom syntax: migration from maven 1.0 need rewrite.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven: History
Maven 3.0
Move to Guice IoC (with a layer to mimic Plexus api).More extensible~99% backward compatible.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven
Goals:Making the build process easy
Providing a uniform build system
Providing quality project information
Providing guidelines for best practice development
Allowing transparent migration to new features
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Definition
Apache Maven is a software project management and comprehension tool.
Based on the concept of a project object model (POM), Maven can manage a project's build, binaries, reporting and documentation from a central piece of information.
Apache Maven is a command line tool with some IDE integrations.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Definition
Convention over Configuration !!
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Conventions
1 project = 1 artifact (jar,war,ear, etc )
Standardized : directories layout
project descriptor (POM)
build lifecycle
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven POM
POM: Project Object ModelProject Coordinates
Dependencies
Build settings
Description
Distribution mode
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Coordinate
groupId:artifactId:version
org.olamy.maven.course hello-world 1.0-SNAPSHOT
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
junit junit 3.8.1 test sources
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
Scope
Compile (by default) : Required to build and run the applicationRuntime : not required to build the application but needed at runtime (Ex : taglibs)Provided : required to build the application but not needed at runtime (provided by the container) (Ex : Servlet API, Driver SGBD, )Test : required to build and launch tests but not needed by the application itself to build and run (Ex : Junit,) TestNG, DbUnit, System : local library with absolute path
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
Transitiviy
Project A needs project B
Project B needs project C
So Maven detect project A needs project C
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
Transitiviy: exclude
org.apache.cxf cxf-bundle-jaxrs org.eclipse.jetty jetty-server
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
Nearest version approach
Project A needs project B
Project B needs project C 1.1
Project A needs project C 1.0
Maven detect project A needs project C 1.0
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
Artifact repository
Download by default from: http://repo.maven.apache.org/maven2/
Cached locally to ${user.home}/repositoryUsed by maven
Used by your projects
Produced by your projects
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
Remote repository
http(s) transport
Url format: ${groupId}/${artifactId}/${artifactId}-${version}(-${classifier}).${type} groupId: dot replaced by slash
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
Remote repository
dependency: org.apache.maven.plugins:maven-compiler-plugin:3.0
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Dependencies
Central repository
contains most of the open source projectsStats: http://search.maven.org/#stats
Total number of artifacts indexed (GAV): 402,355
Total number of unique artifacts indexed (GA): 48,632
Current size of repository on disk: 650,388 MB
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Version
Project and dependency versions
Two different version variantsSNAPSHOT versionThe version number ends with SNAPSHOT
The project is in development
Deliveries are changing over the time and are overridden after each build
Artifacts are deployed with a timestamp on remote repositories
RELEASE versionThe version number doesnt end with SNAPSHOT
Binaries wont change
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Version
SNAPSHOT versions
Maven allows the configuration of an update policy. The update policy defines the recurrence of checks if there is a new SNAPSHOT version available on the remote repository :always
daily (by default)
interval:X (a given period in minutes)
never
Must not be used in a released projectThe release can thus also be changed
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Version
RANGE versions
From ... to Maven automatically searches for the corresponding version (using the update policy for released artifacts)To use with cautionRisk of non reproducibility of the build
Risk of side effects on your projects and projects depending on them.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Archetype
Easy start with archetype
More than 600 projects type template !
mvn archetype:generateChoose one (you can apply filtering on the name)Start to code/enhance the generated template
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Archetype
Start with Tomcat Archetypemvn install
Import in an IDE
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Lifecycle
Lifecycle is a sequence of plugin executions called phasesFull reference: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference validate
compile
Etc...
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Lifecycle
A project has a packaging type
default is jar (war, ear etc..)
With a packaging comes a lifecycle with plugins mapping
As long as you respect standard layout maven will pack for you respecting standards
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Lifecycle
Add a plugin execution to your lifecycle org.apache.tomcat.maven tomcat7-maven-plugin tomcat-run run-war-only pre-integration-test
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
Build multiple projectsSOC: Separation Of Concern
Module with an api
N modules with different implementation
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
Parent packaging pom
module-api module-api-tck module-impl-a module-impl-b
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
Inheritence
Define common values in parent pom no need to repeat common values
Dependency Management dependencies version defined in only one place
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
Inheritence
All projects inherit from super pom which defined some values:Main sources: src/main/java
Test sources: src/test/java
Etc....
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
Dependency Managementparent pom
org.lamy foo 1.0
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
Dependency Managementchild poms org.lamy foo
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
Plugin Managementparent pom org.lamy foo
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
Plugin Managementchild poms Nothing version, and will be inherited
inheritance can be overridden.inheritance can be removed: true plugins won't be executed in child projects.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Multi Modules projects
child poms: configuration inheritence override.
Elements under configuration have attributes to control inheritance mode
combine.children=append (default is merge) appen or not child content to parent content
combine.self=override (default is merge) stop inheritance
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
Each plugin execution is Java class
by default each packaging comes with plugins attached to lifecycle phases.
For simple projects nothing to do
But you can attach new plugins and executions to lifecycle
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
Override default
section
All used plugins must have a version
Default configuration override
Inherited in child poms
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
Configuration
bar ${project.build.directory}
xml configuration command line override with -Ddirectory=path
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
Write your own
A maven project with maven-pluginclass extends AbstractMojo :Implements method execute
Some services getLog() to log as Maven do
getPluginContext(): possible to share information between plugins
Class lifecycle: initializable method when it starts (by default it's a singleton class across your build)
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
How ?
Maven will read metadata available in annotations from your class: a plugin descriptor will be generated and Maven execution will understand that.@Mojo( name = "foo", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )Mvn ${groupId}:${artifactId}:${version}:foo
Dependencies to scope test will be resolved
ThreadSafe for multi thread build
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
hackGenerate a mojo from archetype.Default with doclet
With annotations: mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-plugin -DarchetypeVersion=1.2 -DarchetypeRepository=https://repository.apache.org/content/repositories/maven-090/
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
Parametersusers parameters@Parameter( property = "tomcat.delegate", defaultValue = "true" )private boolean delegate = true;
false Or -Dtomcat.delegate=false
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
Maven Parameters Injected@Parameter( defaultValue = "${project.packaging}", required = true, readonly = true )private String packaging;
@Componentprotected MavenProject project;
@Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )private Set dependencies;
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
Component Injected
your own@Component( role = MavenFileFilter.class, hint = "default" )private MavenFileFilter mavenFileFilter;
from Maven core@Componentprotected ArtifactResolver resolver;
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Plugins
AdvancedInvoke a plugin directly which need previous phases executiontomcat7:run will start an embeded Tomcat but need classes to be compiled first.
Fork lifecycle
@Execute( phase = LifecyclePhase.PROCESS_CLASSES )will reach process-classes phase then execute your mojo.
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven
Artifacts Distribution apache.releases.https Apache Release Distribution Repository apache.snapshots.https ${distMgmtSnapshotsName} ${distMgmtSnapshotsUrl}
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven Settings
Your local settings in ~/.m2/settings.xml
your credentials to deploy to a remote server
apache.snapshots.https uid password
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven Settings
Your local settings in ~/.m2/settings.xml
Mirrors for corporate env:
archiva-repository central (or * ) archiva-asf-mirror https://archiva-repository.apache.org/archiva/repository/public
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven Site
mvn site:site target/site
Build a web site with your documentations.Formats:Apt (files in src/site/apt) (http://maven.apache.org/doxia/references/apt-format.html)
Xdoc (files in src/site/xdoc)(http://maven.apache.org/doxia/references/xdoc-format.html)
Markdown (files in src/site/markdown)no real specs for that :-)
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven Site
Descriptor src/site/site.xml
menu entries
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven Site
customize
skin org.apache.maven.skins maven-fluido-skin 1.3.0
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven Site
Add reports
Reporting section with maven plugins org.apache.maven.plugins maven-project-info-reports-plugin 2.6
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven Site
Instrumental reports
Findbugs org.codehaus.mojo findbugs-maven-plugin 2.5.2
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Maven Site
Deploy
Protocols: ftp, scp, webdav, scm id for your settings.xml dav:url
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven
Complementary tooling
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Repository
Deploying to share your projectAn open source project ? So ask to deploy it to central
Use a repository manager to share inside your entity/compayApache Archiva: http://archiva.apache.org
Nexus: http://www.sonatype.org/nexus/
Artifactory: http://www.jfrog.com
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Repository
Install Archiva locallyDownload from http://archiva.apache.org/download.html
Archiva 1.4-M3 Standalone new UI
Unzip
cd bin
archiva console
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Apache Maven Repository
Proxy to external repositoriesSome organisations doesn't allow external access
Artifacts will be cached not access to external repositories
Control repositories you are using
*
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Continuous Integration
Detect issues as soon as possible
Code will be rebuild on any scm change
New artifact snapshots deployed for others
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Continuous Integration
Bamboo from Atlassian (paying product)
TeamCity from Jetbrains (paying product)
Continuum from Apache
CruiseControl
Hudson/Jenkins
We will talk about Jenkins :-)
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Continuous Integration
Jenkins
http://jenkins-ci.org
Easy to install/use: java -jar jenkins.war
No need for external tools (database etc..)
Configuration stored on the file system
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Continuous Inspection
SonarDashboard with various metrics
Aggregator of existing Maven reports (and more)
http://sonar.codehaus.org
Easy install
Daily run in Jenkins
Tests it
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
References
http://maven.apache.org
http://archiva.apache.org
http://jenkins-ci.org
http://sonar.codehaus.org
http://fr.slideshare.net/olamy/maven-universitycourse
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)
Thanks/Merci
Questions ?
[email protected]
This is a great quote from today's press release by the ASF.We also have about a dozen past projects, and a number of other, non-code projects to assist with operations.Conferences committee, Community Development, and others are tasked to manage various operations like events and educating new contributors (Legal, Brand Management, Fundraising, and Marketing & Publicity are all officers, not PMCs)