Software project management. and. Maven



Similar documents
Software project management. and. Maven

Build management & Continuous integration. with Maven & Hudson

Hands on exercise for

Maven2. Configuration and Build Management. Robert Reiz

Maven or how to automate java builds, tests and version management with open source tools

Maven 2 in the real world

Maven2 Reference. Invoking Maven General Syntax: Prints help debugging output, very useful to diagnose. Creating a new Project (jar) Example:

Continuous Integration Multi-Stage Builds for Quality Assurance

Content. Development Tools 2(63)

Continuous integration in OSGi projects using Maven (v:0.1) Sergio Blanco Diez

Sonatype CLM for Maven. Sonatype CLM for Maven

Sonatype CLM Enforcement Points - Continuous Integration (CI) Sonatype CLM Enforcement Points - Continuous Integration (CI)

Nexus Professional Whitepaper. Repository Management: Stages of Adoption

Software Quality Exercise 2

Meister Going Beyond Maven

by Charles Souillard CTO and co-founder, BonitaSoft

Presentation of Enterprise Service Bus(ESB) and. Apache ServiceMix. Håkon Sagehaug

GECKO Software. Introducing FACTORY SCHEMES. Adaptable software factory Patterns

Service Integration course. Cassandra

Builder User Guide. Version 5.4. Visual Rules Suite - Builder. Bosch Software Innovations

SDK Code Examples Version 2.4.2

Software infrastructure for Java development projects

Continuous Integration The Full Monty Artifactory and Gradle. Yoav Landman & Frederic Simon

Mind The Gap! Setting Up A Code Structure Building Bridges

Using the Adobe Access Server for Protected Streaming

Apache Karaf in real life ApacheCon NA 2014

Virtual Machine (VM) For Hadoop Training

Integrating your Maven Build and Tomcat Deployment

Builder User Guide. Version Visual Rules Suite - Builder. Bosch Software Innovations

Contents. Apache Log4j. What is logging. Disadvantages 15/01/2013. What are the advantages of logging? Enterprise Systems Log4j and Maven

CI/CD Cheatsheet. Lars Fabian Tuchel Date: 18.March 2014 DOC:

Understanding class paths in Java EE projects with Rational Application Developer Version 8.0

Crawl Proxy Installation and Configuration Guide

Enterprise Service Bus

Case Study: Using Jenkins to Build WebSphere Portal Applications for the Enterprise. #jenkinsconf. Jenkins User Conference Boston #jenkinsconf

Automated performance testing using Maven & JMeter. George Barnett, Atlassian Software

Improving Software Quality with the Continuous Integration Server Hudson. Dr. Ullrich Hafner Avaloq Evolution AG 8911

D5.4.4 Integrated SemaGrow Stack API components

BIRT Application and BIRT Report Deployment Functional Specification

WebSphere v5 Administration, Network Deployment Edition

How To Use An Orgsync With Anorgfusion Middleware

EMC DOCUMENTUM BUSINESS OBJECT FRAMEWORK

Maven the Beautiful City. Healthy, Viable, and Productive Build Infrastructures

JAVA WEB START OVERVIEW

EMC Documentum Composer

Cross-domain Identity Management System for Cloud Environment

Crystal Reports for Eclipse

Developing Applications Using Continuous Integration 12c (12.2.1)

TIBCO Runtime Agent Authentication API User s Guide. Software Release November 2012

Upping the game. Improving your software development process

Jenkins on Windows with StreamBase

Test Automation Integration with Test Management QAComplete

Coding in Industry. David Berry Director of Engineering Qualcomm Cambridge Ltd

Developer s Guide. How to Develop a Communiqué Digital Asset Management Solution

1 What is Cloud Computing? Cloud Infrastructures OpenStack Amazon EC CAMF Cloud Application Management

Extend WTP Server Tools for your application server. Tim deboer Gorkem Ercan

Coherence Managed Servers

Spring Security SAML module

Repository Management with Nexus

Configuration Manual Yahoo Cloud System Benchmark (YCSB) 24-Mar-14 SEECS-NUST Faria Mehak

Repository Management with Nexus

Eclipse installation, configuration and operation

NetIQ Identity Manager Setup Guide

Setting up Hadoop with MongoDB on Windows 7 64-bit

Jaspersoft APIs. Integrating BI with your Applications. Community and Professional Editions

Master s Thesis EEG/ERP Portal Security in New Technologies

Drupal CMS for marketing sites

Web Frameworks and WebWork

Tutorial: Android Object API Application Development. SAP Mobile Platform 2.3 SP02

Maven by Example. Maven by Example. Ed. 0.7

Jukka Kokko SOFTWARE BUILD AND RELEASE MANAGEMENT FOR A WIRELESS PRODUCT WITH OPEN SOURCE TOOLS

Creating an application with the Virgo Web Server

Continuous Integration: Put it at the heart of your development

Building a Modular Server Platform with OSGi. Dileepa Jayakody Software Engineer SSWSO2 Inc.

Unit Testing. and. JUnit

Developing Web Services with Eclipse and Open Source. Claire Rogers Developer Resources and Partner Enablement, HP February, 2004

Integration with Other Tools

Joomla! Override Plugin

BlueJ Teamwork Tutorial

Migrating Applications From IBM WebSphere to Apache Tomcat

Maven: The Complete Reference

Braindumps.C questions

HP Operations Orchestration Software

Developing Android Apps with the ArcGIS Runtime SDK for Android. Dan

GLOBAL CONSULTING SERVICES TOOLS FOR WEBMETHODS Software AG. All rights reserved. For internal use only

Adobe Summit 2015 Lab 712: Building Mobile Apps: A PhoneGap Enterprise Introduction for Developers

Beginning POJOs. From Novice to Professional. Brian Sam-Bodden

Copyright 2014, SafeNet, Inc. All rights reserved.

Developer Guide: Smartphone Mobiliser Applications. Sybase Mobiliser Platform 5.1 SP03

1 Building, Deploying and Testing DPES application

Tutorial: BlackBerry Object API Application Development. Sybase Unwired Platform 2.2 SP04

The Benefits of Utilizing a Repository Manager

Java Forum Nord Dirk Mahler

Repository Management with Nexus

Configuring the LCDS Load Test Tool

Tutorial: Android Object API Application Development. SAP Mobile Platform 2.3

Rational Application Developer Performance Tips Introduction

Transcription:

Software project management and Maven

Problem area Large software projects usually contain tens or even hundreds of projects/modules Will become messy and incomprehensible ibl if the projects don t adhere to some common principles Will be time-consuming to build all projects manually

The preferred solution Use a project management tool (like Maven) Maven helps you with various aspects: 1. Build process 2. Project structure t 3. Dependency management 4. Access to information i and documentation

1. Build process The Project Object Model (POM) an XML file is the heart of a Maven 2 project Contains project information and configuration details used to build the project Project dependencies Commands (goals) that can be executed Plugins Metadata The POM extends the Super POM Only 4 lines are required

1. POM - Simple example <project> <modelversion>4.0.0</modelversion> <groupid>no.uio.inf5750</groupid> uio inf5750</groupid> <artifactid>assignment-2</artifactid> <version>1.0-snapshot</version> <packaging>jar</packaging> <name>assignment 2</name> <dependencies> <dependency> <groupid>commons-logging</groupid> <artifactid>commons-logging</artifactid> g <version>1.4</version> <scope>compile</scope> </dependency> </dependencies> Object model version Group / organization id Id of the project itself Version of the project Packaging g type Display name of the project Dependencies </project>

1. POM Project inheritance Project A (Parent) <project> <modelversion>4.0.0</modelversion> <groupid>no.uio.inf5750</groupid> <artifactid>projecta</artifactid> <version>1</version> <packaging>war</packaging> </project> Project B Project C Project D Project B inherits war packaging <project> <parent> <groupid>no.uio.inf5750</groupid> <artifactid>projecta</artifactid> <version>1</version> </parent> <modelversion>4.0.0</modelversion> <groupid>no.uio.inf5750</groupid> <artifactid>projectb</artifactid> <version>1</version> </project>

1. POM Project aggregation Project A (Parent) <project> <modelversion>4.0.0</modelversion> <groupid>no.uio.inf5750</groupid> <artifactid>projecta</artifactid> <version>1</version> <packaging>pom</packaging> Project B Project C Project D <modules> <module>projectb</module> </modules> </project> A command against Project A will be run against Project B as well <project> <modelversion>4.0.0</modelversion> 0</modelVersion> <groupid>no.uio.inf5750</groupid> <artifactid>projectb</artifactid> <version>1</version> </project>

1. Build Lifecycle and Phases The build lifecycle is the process of building and distributing an artifact A phase is a step in the build lifecycle Most important default phases: Validate Compile Test Package Install Deploy Some common phases not default: Clean Site For each step, all previous steps are executed

2. Standard directory layout Advantages: A developer familar with Maven will quickly get familiar with a new project No time wasted on re-inventing directory structures and conventions src/main/java src/main/resources src/main/filters src/main/config src/main/webapp src/test/java src/test/resources src/test/filters src/site Java source files goes here Other resources your application needs Resource filters (properties files) Configuration files Web application directory for a WAR project Test sources like unit tests (not deployed) Test resources (not deployed) Test resource filter files (not deployed) Files used to generate the Maven project website

3. Dependency management Dependency: a third-party or project-local software library (JAR or WAR file) Dependency management is a challenge in multi-module l projects

3. Dependency management Dep. A Project A Dep. B Dep. C Project B The poor approach: Replicate all dependencies for every project (put in /lib folder within the project) Dependencies are replicated and use more storage Checking out a project will be slow Difficult to keep track of versions Dep. A Dep. B Dep. C

3. Dependency management Dep. A Dep. B Dep. C Repository The preferred solution: Use a repository Repository: A shared location for dependencies which all projects can access Only one copy exists Stored outside the project Dependencies are defined in the POM Project A Project B <dependencies> <dependency> <groupid>commons-logging</groupid> <artifactid>commons-logging</groupid> <version>1.3</version> </dependency> </dependencies>

3. Repositories Project A Remote repository: Remote repo (Internet) Provides software artifacts (dependencies) for download E.g. repo1.maven.org houses Maven s central repository Local repository: Copy on local computer which is a Local repo (Local cache of the remote downloads d computer) May contain project-local build artifacts as well Located in USER_HOME/.m2/repository Same structure as remote repos Project B

3. Repositories Downloading from a remote repository Central repo is default Can be overridden Internal repositories Often used in corporate environments to avoid connection to the internet Improves security, speed, and bandwidth Suitable for publishing private artifacts Project B <repositories> <repository> <id>my-repo-</id> <url>http://my-server/repo</url> </repository> </repositories> Remote repo (Internet) Internal repo (In-house) Local repo (Local computer) Project A (Local computer)

3. Transitive dependencies Maven reads the POM files of your dependencies and automatically includes their required libraries No limit it on the number of levelsl Dependency mediation nearest definition Commons-logging, JUnit, and Log4J 1.3 will be installed in local repo automatically Log4J 1.3 Log4J 1.2 Project A Commons-logging JUnit

3. Dependency scope Affects the classpath used for various build tasks Can be defined for all dependencies, compile default 5 dependency scopes available: Compile: Available in all classpaths (default) Provided: The JDK or the container provides it Runtime: Only required for execution, not for compilation Test: Only required for testing, not for normal use (not deployed) System: You provide it locally, not looked up in a repo <dependency> <groupid>commons-logging</groupid> <artifactid>commons-logging</artifactid> <version>1.4</version> <scope>compile</scope> </dependency>

3. Dependency management Mechanism for centralizing dependency information Favourable for projects that inherits a common parent Useful for controlling versions of transitive dependencies Parent POM <dependencymanagement> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</groupid> <version>4.0</version> <scope>test</scope> <type>jar</type> </dependency> </dependencies> </dependencymanagement> Child POMs... <dependency> <groupid>junit</groupid> <artifactid>junit</groupid> </dependency>... Child POM dependency inherits information from parent POM Transitive occurences of JUnit guaranteed to be of version 4.0

4. Project information Powerful feature in Maven: Create a project site automatically Info retrieved from the POM, source code Provides information regarding Dependencies Issue tracking Licensing Development team Provides various reports Test coverage Internationalisation JavaDocs Potential ti code problems

Useful commands $ mvn package Compile and create JARs/WARs $ mvn install Package + copy to local repo $ mvn clean Delete target directory $ mvn test Run unit tests $ mvn eclipse:eclipse Create Eclipse project files $ mvn idea:idea Create IDEA project files $ mvn jetty:run-war Run a WAR file in Jetty $ mvn site Generates project site

Summary We ve learned that Maven facilitates: Uniform building of projects through the POM Consistent project structure Management of dependencies through repositories to avoid replication and ease re-use and versioning Standardized and professional-quality project information

Resources Better builds with Maven Free PDF book online http://www.devzuz.com/ Maven homepage Documentation and guides http://maven.apache.org