I Got My Mojo Workin'

Similar documents
MAVEN INTERVIEW QUESTIONS

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

MAVEN MOCK TEST MAVEN MOCK TEST IV

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

Maven. INF5750/ Lecture 2 (Part II)

Maven 2 & Continuum. by Trygve Laugstøl

MAVEN MOCK TEST MAVEN MOCK TEST I

MAVEN MOCK TEST MAVEN MOCK TEST III

Maven in the wild. An introduction to Maven

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

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

Maven POM project modelversion groupid artifactid packaging version name

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

juddi Developer Guide

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

Content. Development Tools 2(57)

Apache Maven. Created by anova r&d bvba

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

Simplified Build Management with Maven

Selenium Testing Course Content

AUTOMATION TESTING FRAMEWORK FOR LUMINOUS LMS

UIMA Tools Guide and Reference

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

Packaging, automation, Continuous Integration

Build Tools. Software Engineering SS 2007

Generating A Hibernate Mapping File And Java Classes From The Sql Schema

Repository Management and Sonatype Nexus. Repository Management and Sonatype Nexus

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

SCA Java Runtime Overview

Pour aller plus loin : Programmation outillée

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

UIMA Tools Guide and Reference

Skyway Builder 6.3 Reference

AppDev StudioTM 3.2 SAS. Migration Guide

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

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

Tuscany: Applying OSGi modularity after the fact

maven Build System Making Projects Make Sense

sites</distribsiteroot>

Sonatype CLM - IDE User Guide. Sonatype CLM - IDE User Guide

Introduction to Software Engineering: Tools and Environments. Session 9. Oded Lachish

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

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

The Workshop. Slides (you have a copy in the zip) Practical labs Ask questions

Package Management and Build Tools

Maven 2.1 Artifact Resolution Specification

Info Error Deploying Artifact Failed To Transfer File Return Code Is 401

IBM. IBM WebSphere Application Server Migration Toolkit. WebSphere Application Server. Version 9.0 Release

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

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

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

The Actual Real World at EclipseCon/ALM

SELENIUM TRAINING COURSE CONTENT

vrealize Code Stream Plug-In SDK Development Guide

Build Automation Kurt Christensen

Why switch exist-db from Ant to Maven?

The Extensible Markup Language (XML) and Java technology are natural partners in helping developers exchange data and programs across the Internet.

Tuesday, April 26, 2011

Red Hat JBoss Web Server 3.1

<put document name here> 1/13

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

Class Dependency Analyzer CDA Developer Guide

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

Gradle Leveraging Groovy for Building Java Applications. Hans Dockter Gradle Project Lead

Breaking Apart the Monolith with Modularity and Microservices CON3127

Introduction to EGF. Benoît Langlois / Thales Global Services.

EMC Documentum Composer

Create your own Carbon Component. Sameera Jayasoma Technical Lead and Product Manager of WSO2 Carbon

GlassFish V3. Jerome Dochez. Sun Microsystems, Inc. hk2.dev.java.net, glassfish.dev.java.net. Session ID YOUR LOGO HERE

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

Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat

What s new in IBM Operational Decision Manager 8.9 Standard Edition

Distributing JavaFX Applications with Java WebStart and Artifactory

JPA Enhancement Guide (v5.1)

Release Notes June 15, Date: 15-Jun :49 URL:

COPYRIGHTED MATERIAL

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

Selenium Course Content

Junit. Presentation & Tools (Eclipse, Maven, Mockito, Spring)

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

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

Oracle Enterprise Pack for Eclipse 11g Hands on Labs

JDO Tools Guide (v5.1)

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

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

JPA Tools Guide (v5.0)

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

Getting Started with Gradle

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

Tattletale. What is Tattletale? Enterprise archives JBoss Application Server 7 Putting it all together Roadmap

Overview of Web Application Development

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

Setting up a Maven Project

Technical Debt in Eclipse Development. Eclipse Con France 2018

ONAP Developer Typical Setup 2017 July ONAP Virtual Developers Event

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

Apache Buildr in Action

Checking Out and Building Felix with NetBeans

Apache Axis2. Tooling with Axis2

1.2. Name(s) and address of Document Author(s)/Supplier: Sahoo: 1.3. Date of This Document: 12 July 2008

Transcription:

I Got My Mojo Workin' Gary Murphy Hilbert Computing, Inc. http://www.hilbertinc.com/ glm@hilbertinc.com Gary Murphy I Got My Mojo Workin' Slide 1

Agenda Quick overview on using Maven 2 Key features and concepts A look at the structural components of Maven 2 Developing Maven plug-ins, comprised of mojos. Gary Murphy I Got My Mojo Workin' Slide 2

What is Maven? Framework for development processes. Can be used for: Build runtime artifacts, such as jars and wars Build developer documentation, such as JavaDoc Create reports for project management Distribute applications to dev, prod, etc.... and anything else for which you write a mojo. Gary Murphy I Got My Mojo Workin' Slide 3

Installing Maven? Maven is a project managed by the Apache Software Foundation: http://maven.apache.org/ Download and install a small core of Maven functionality Maven will automatically load and install dependencies for each of the plug-ins you request Gary Murphy I Got My Mojo Workin' Slide 4

Running Maven This talk is more about writing mojos for Maven, but we should have a feel for how it works: Maven Demo Time Gary Murphy I Got My Mojo Workin' Slide 5

Maven Objectives Make the build process easy Provide a uniform build system Provide quality project information Provide guidelines for best practices development Allow for transparent migration to new features. Reference: http://maven.apache.org/what-is-maven.html Gary Murphy I Got My Mojo Workin' Slide 6

Meeting Those Objectives Maven is easy to get started, since it bootstraps most of its install. Maven build process is easy when it works. Difficult to diagnose when it doesn't. Been reliable for me. Some idiosyncrasies on some machines Way better than Maven 1. Don't judge Maven 2 based on Maven 1 experience Gary Murphy I Got My Mojo Workin' Slide 7

Meeting Those Objectives High marks for project information. Plug-ins for: JavaDoc generation Unit test reports Code style Pushes documentation closer to developer processes: Better than external documentation Documentation versioned with code http://www.hilbertinc.com/whitepapers/valueofprocess.pdf Gary Murphy I Got My Mojo Workin' Slide 8

Meeting Those Objectives Provides standard directory structure layout: Hard one for me to bite off Defaults generate artifacts in the same directory structure as Eclipse projects Default path structure can be changed, but more configuration work In short, Maven 2 is a big improvement over Maven 1 and does an adequate job of meeting its objectives Gary Murphy I Got My Mojo Workin' Slide 9

Key Features Project set up via a project object model (POM). Default super POM that is hard-coded and you override what differs POMs have an inheritance hierarchy Parent POM contains information common to all projects Parent POM references all child projects Demo time: AEntendre Frameworks POM structure. Note distribution management. Gary Murphy I Got My Mojo Workin' Slide 10

Key Features Dependency Management The POM contains the dependencies and their scope (e.g. compile, runtime, test,...) Maven will handle the installation of direct and transitive dependencies Versioned jars are maintained in a repository In Eclipse, recommend using a classpath variable (e.g. M2_REPO) to point to the repository root. Gary Murphy I Got My Mojo Workin' Slide 11

Key Features Artifact deployment Can install runtimes to remote systems using SCP or other means. Project documentation: Automatically generates a web site with the project information Demo time: AEntendre Framework site Gary Murphy I Got My Mojo Workin' Slide 12

Concepts Goals Accomplish a single, atomic task. Similar in concept to an Ant goal One goal per mojo Plug-ins Packaged jar of mojos Lifecycle (more on next slide) A collection of goals bound to a lifecycle Model a high-level process Gary Murphy I Got My Mojo Workin' Slide 13

Concepts - Lifecycle Most Common Build Lifecycle Phases install Place the packaged artifact (e.g. a jar) in the local repository. This will compile, test, package, verify and install. deploy Place the packaged artifact in the remote repository These are run at the command line: mvn install http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html Gary Murphy I Got My Mojo Workin' Slide 14

Underlying Structure Plexus (http://plexus.codehaus.org) Inversion-of-control container Uses field injection of requirements and configuration Perhaps easy for the Maven 2 developers, but hard on the Mojo developers. Not expressive! Gary Murphy I Got My Mojo Workin' Slide 15

Underlying Structure Modello (http://modello.codehaus.org/) Describes an object model in XML. In this case, the POM. Generates Java objects from the XML Generated code contains untyped collections As a result, very difficult to follow Surefire (http://maven.apache.org/surefire) Testing framework for JUnit Gary Murphy I Got My Mojo Workin' Slide 16

Underlying Structure Doxia (http://maven.apache.org/doxia) Documentation engine APT Almost plain text DocBook FML FAQ Markup Language LaTeX RTF XDoc XHTML Gary Murphy I Got My Mojo Workin' Slide 17

Questions? Gary Murphy I Got My Mojo Workin' Slide 18

What is a Mojo? A mojo is: a play on POJO - Maven plain Old Java Object an executable goal in maven A plug-in is a distribution of one or more related mojos. Gary Murphy I Got My Mojo Workin' Slide 19

Introduction to Mojos Can be written in Java or other scripting languages. This will cover Java mojos only. The interface is defined in: org.apache.maven.plugin.mojo Abstract base class in: org.apache.maven.plugin.abstractmojo Gary Murphy I Got My Mojo Workin' Slide 20

Introduction to Mojos Base class includes an implementation of a logging facility. Use instead of System.out.println Allows integration with GUI applications Concrete implementations must supply an execute() method. Gary Murphy I Got My Mojo Workin' Slide 21

plugin.xml The jar containing the plug-in classes must contain a descriptor file: META-INF/maven/plugin.xml Contains metadata about each mojo: goal name dependencies parameters in the pom.xml that can be overridden Can (and should be) generated from JavaDoc annotations Gary Murphy I Got My Mojo Workin' Slide 22

settings.xml Maven needs to know the location (group) for your plugins: <plugingroups> <plugingroup>org.aentendre.maven</plugingroup> </plugingroups> Gary Murphy I Got My Mojo Workin' Slide 23

Annotations Mojo metadata specified via JavaDoc annotations (not Java annotations). Most common follow: @goal goalname used on the command line @phase phasename used if you want your mojo to be part of the standard build Gary Murphy I Got My Mojo Workin' Slide 24

Annotations - Parameter Makes objects available to mojo via Plexus injection: @required Parameter must be available for the mojo to work @readonly Can't be configured by user (i.e. access to internal objects) @parameter expression= ${expr} - bind to available objects. Expression values are still largely undocumented.... the explore mojo will help. http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html Gary Murphy I Got My Mojo Workin' Slide 25

Explore Mojo Developed by me to reverse engineer how mojos work. Will be included on the Conference CD Used other open-source mojos for guidance. Let's go exploring... Gary Murphy I Got My Mojo Workin' Slide 26

Questions? Gary Murphy I Got My Mojo Workin' Slide 27

Thanks Thank you for attending. Please fill out the evaluations. They are helpful to Wayne and Peggy as well as me. Feel free to ask questions during the week. Time permitting, we can look at some peripheral issues... Gary Murphy I Got My Mojo Workin' Slide 28

Time Permitting... Eclipse and Maven 2 There is a plug-in for Maven 2 that I haven't used. Eases setup of classpath in Eclipse By default, Maven builds in the same directory structure as Eclipse. I changed the build directory locations Eclipse doesn't allow nesting of projects in the filesystem Gary Murphy I Got My Mojo Workin' Slide 29