What is Maven? Apache Maven is a software project management and comprehension tool (build, test, packaging, reporting, site, deploy).

Similar documents
Maven. INF5750/ Lecture 2 (Part II)

Simplified Build Management with Maven

Apache Maven. Created by anova r&d bvba

Pour aller plus loin : Programmation outillée

MAVEN MOCK TEST MAVEN MOCK TEST IV

Topics covered. Introduction to Maven Maven for Dependency Management Maven Lifecycles and Plugins Hands on session. Maven 2

Content. Development Tools 2(57)

MAVEN MOCK TEST MAVEN MOCK TEST I

Set up Maven plugins in Eclipse. Creating a new project

4. Check the site specified in previous step to work with, expand Maven osgi-bundles, and select slf4j.api,

I Got My Mojo Workin'

MAVEN INTERVIEW QUESTIONS

Setting up a Maven Project

Maven 2 & Continuum. by Trygve Laugstøl

Administering Apache Geronimo With Custom Server Assemblies and Maven. David Jencks

Maven Introduction to Concepts: POM, Dependencies, Plugins, Phases

maven Build System Making Projects Make Sense

Apache Maven MarsJUG. Arnaud Héritier exo platform Software Factory Manager

Software Engineering - Development Infrastructure 2. Kristjan Talvar Nortal

TIBCO StreamBase 10.2 Building and Running Applications in Studio, Studio Projects and Project Structure. November 2017

sites</distribsiteroot>

DevOps and Maven. Eamonn de Leastar Dr. Siobhán Drohan Produced by:

TOP REASONS WHY YOU SHOULD SWITCH TO MAVEN 3

Oracle Code Day Hands On Labs (HOL) (Install, Repository, Local Deploy, DevCS, OACCS)

Maven POM project modelversion groupid artifactid packaging version name

Repository Management and Sonatype Nexus. Repository Management and Sonatype Nexus

Component based Development. Table of Contents. Notes. Notes. Notes. Web Application Development. Zsolt Tóth

Oracle Code Day Hands On Labs HOL

Maven 2 The powerful buildsystem. a presentation for EL4J developers by Martin Zeltner (MZE) November 2007

Package Management and Build Tools

BUILD AND DEPLOY SOA PROJECTS FROM DEVELOPER CLOUD SERVICE TO ORACLE SOA CLOUD SERVICE

Contents. Enterprise Systems Maven and Log4j. Maven. What is maven?

Produced by. Agile Software Development. Eamonn de Leastar

FROM NOTHING TO COMPLETE ENVIRONMENT WITH MAVEN, OOMPH & DOCKER. Max Bureck, 21. June 2017

Geronimo Server Release Process

Session 24. Spring Framework Introduction. Reading & Reference. dev.to/lechatthecat/how-to-use-spring-boot-java-web-framework-withintellij-idea-202p

juddi Developer Guide

Packaging, automation, Continuous Integration

Maven in the wild. An introduction to Maven

Apache Maven: Best Practices

... Apache Maven PDF Plugin v. 1.4 User Guide.... The Apache Software Foundation

Why switch exist-db from Ant to Maven?

Action Developers Guide

GlassFish V3 Engineer's guide

... Maven.... The Apache Maven Project

Getting started with Geomajas. Geomajas Developers and Geosparc

MANUAL DO ALUNO DE ENGENHARIA DE SOFTWARE

Construction: version control and system building

Gant as Ant and Maven Replacement

Maven Plugin Guide OpenL Tablets BRMS Release 5.16

Sonatype CLM Enforcement Points - Nexus. Sonatype CLM Enforcement Points - Nexus

Build Tools. Software Engineering SS A tool was needed. Agenda for today. Build tools. Software complexity. Build tools

SE256 : Scalable Systems for Data Science

Build Tools. Software Engineering SS 2007

Struts 2 Maven Archetypes

Introduction to project industrialization using Maven YaJUG 06/10/2009. Copyright Pierre-Antoine Grégoire License Creative Commons 2.

Unable To The Artifact From Any Repository Maven-clean-plugin

JPA Tools Guide (v5.0)

BUILD AND DEPLOY ORACLE SERVICE BUS PROJECTS FROM ORACLE DEVELOPER CLOUD SERVICE TO ORACLE SOA CLOUD SERVICE USING THE ORACLE SERVICE BUS PLUG-IN

Hello Maven. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

HP Operations Orchestration

HP Operations Orchestration

... Fisheye Crucible Bamboo

Selenium Testing Course Content

Overall Design of SSS Software

Red Hat JBoss Web Server 3.1

Denn n i n s i s L und n b d erg r

MAVEN SUCKS NO(W) REALLY

<put document name here> 1/13

AUTOMATION TESTING FRAMEWORK FOR LUMINOUS LMS

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

MAVEN MOCK TEST MAVEN MOCK TEST III

JDO Tools Guide (v5.1)

STQA Mini Project No. 1

Creating Custom Builder Components

Continuous Integration INRIA

OOP with Java. Homework 05: Maven. Thomas Weise 汤卫思.

Fat / Uber jars - Using the Shade Plugin

Introduction: Manual Testing :

JavaSE: First Simple Module Exercise

Apache Isis Maven plugin

CONTINUOUS DELIVERY IN THE ORACLE CLOUD

JUG Saxony Day Dirk Mahler

A Journey in So,ware Development An overview of methods and tools (part 2)

Red Hat JBoss Fuse 6.1

Directory structure and development environment set up

Jenkins User Conference Israel. #jenkinsconf. CI / Liveperson. Gidi Samuels. July 16, #jenkinsconf

This tutorial explains how you can use Gradle as a build automation tool for Java as well as Groovy projects.

mvn package -Dmaven.test.skip=false //builds DSpace and runs tests

The Maven 2 POM demystified

An Integrated Approach to Managing Windchill Customizations. Todd Baltes Lead PLM Technical Architect SRAM

The Actual Real World at EclipseCon/ALM

... SysML version SNAPSHOT Developer Guide.... Eclipse

What s new in IBM Operational Decision Manager 8.9 Standard Edition

Funambol Connector Development Tutorial

Distributing JavaFX Applications with Java WebStart and Artifactory

ONAP Developer Typical Setup 2017 July ONAP Virtual Developers Event

Sonatype CLM - CI User Guide. Sonatype CLM - CI User Guide

JavaLand Dirk Mahler

Transcription:

Plan What is Maven? Links : mvn command line tool POM : 1 pom.xml = 1 artifact POM POM Inheritance Standard Directory Layout Demo on JMMC projects Plugins Conclusion

What is Maven? Apache Maven is a software project management and comprehension tool (build, test, packaging, reporting, site, deploy).!= Apache ant (make like) Key features : POM : Project Object Model Dependency management Convention over configuration Plugins IDE integration (eclipse, netbeans...)

Links : Project page : http://maven.apache.org/ Plugins : http://maven.apache.org/plugins/index.html Maven book : http://books.sonatype.com/mvnref-book/reference/index.html En français : http://maven-guide-fr.erwan-alliaume.com/ Mvn repository : http://mvnrepository.com/

mvn command line tool Install Maven (Java tool) => mvn command Settings : <home>/.m2/settings.xml Local repository : <home>/.m2/repository/ mvn install:install-file (missing library) mvn clean mvn package mvn clean install (into local repository) mvn test... GOALS Easy to use Maven in IDE

<settings> <offline>false</offline> <proxies> <proxy> <active>true</active> <protocol>http</protocol> <host>www-cache.ujf-grenoble.fr</host> <port>3128</port> <nonproxyhosts>*.jmmc.fr</nonproxyhosts> </proxy> </proxies> <profiles> <profile> <id>dev</id> <properties> <!-- disable jar signer --> <jarsigner.skip>true</jarsigner.skip> <!-- disable javadoc --> <maven.javadoc.skip>true</maven.javadoc.skip> <!-- disable tests --> <maven.test.skip>true</maven.test.skip> </properties> </profile> </profiles> <activeprofiles> <activeprofile>dev</activeprofile> </activeprofiles> </settings>.m2/settings.xml

POM : 1 pom.xml = 1 artifact

POM <?xml version="1.0" encoding="utf-8" standalone="no"?> <project xmlns="http://maven.apache.org/pom/4.0.0"> <modelversion>4.0.0</modelversion> <parent> </parent> <groupid>fr.jmmc.jmcs</groupid> <artifactid>jmcs</artifactid> <version>x.y</version> <packaging>jar</packaging>... <properties>... </properties> <dependencies>... </dependencies> <build> <plugins>... </plugins> </build> </project> <parent> <groupid>fr.jmmc</groupid> <artifactid>jmmc</artifactid> <version>trunk</version> </parent> <dependency> <groupid>org.slf4j</groupid> <artifactid>jul-to-slf4j</artifactid> <version>1.7.6</version> </dependency> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> INHERITANCE ARTIFACT DEPENDENCY PLUGIN

POM Inheritance Override default configuration in POM : 1) Maven settings 2) Parent POM(s) (hierarchy) 3) POM (current project) 4) Active Profiles (dev) to finally set properties, login/password and env settings... => Use Effective POM or an IDE mvn help:effective-pom

Standard Directory Layout http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html Use configuration to customize folders to your project setup! src/main/java src/main/resources src/main/config src/main/scripts src/main/webapp src/test/java src/test/resources src/site pom.xml LICENSE.txt target/ Source code Resource files Configuration files Scripts Web application source Test source code Test resource files Site POM License Build output

Demo on JMMC projects Many artifacts : jmmc (super pom) gathers common config Jmcs library + deps Jmal library + deps Aspro2 application Multi-module approach : exist oidb project Interest : dependencies are shared and transitive final package gathers all jar files + code signing

Plugins http://maven.apache.org/plugins/index.html - resource filtering (variable substitution) - site : generate a web site for the project - surefire : unit tests (junit) - packaging : jar, war, source... - reporting : javadoc, pmd, checkstyle, changelog Tools : - antrun : executes custom ant tasks - archetype : create a new project (template) - assembly (packaging) : jar with deps, zip, project or custom - dependency : copy dependencies - scm : versioning integration (svn, git) - tomcat : run + deployment

Conclusion Very powerful but A lot of conventions / configurations and Plugins = a bit cumbersome to find what you need Easier if you adopt the standard directory layout Other language support : PHP : http://www.php-maven.org/ C/C++ : http://maven-nar.github.io/