gerência de configuração com maven

30
April 05 Prof. Ismael H. F. Santos - [email protected] 1 Modulo II Gerência de Configuração com Maven Professor Ismael H F Santos – [email protected]

Upload: elliando-dias

Post on 13-May-2015

929 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Gerência de Configuração com Maven

April 05 Prof. Ismael H. F. Santos - [email protected] 1

Modulo II Gerência de Configuração com Maven

Professor Ismael H F Santos – [email protected]

Page 2: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 2

Linguagem de Programação JAVA Ismael H. F. Santos, Apostila UniverCidade, 2002

The Java Tutorial: A practical guide for programmers Tutorial on-line: http://java.sun.com/docs/books/tutorial

Java in a Nutshell David Flanagan, O´Reilly & Associates

Just Java 2 Mark C. Chan, Steven W. Griffith e Anthony F. Iasi, Makron

Books. Java 1.2

Laura Lemay & Rogers Cadenhead, Editora Campos

Bibliografia

Page 3: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 3

Livros

Core Java 2, Cay S. Horstmann, Gary Cornell Volume 1 (Fundamentos) Volume 2 (Características Avançadas)

Java: Como Programar, Deitel & Deitel Thinking in Patterns with JAVA, Bruce Eckel

Gratuito. http://www.mindview.net/Books/TIJ/

Page 4: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 4

Ementa

Visão geral do MAVEN Entendendo o POM (Project Object Model) Executando um build MAVEN x ANT

Page 5: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 5

Apache Maven

POO-Java

Page 6: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 6

Agenda

Active Quality vs Passive Quality Review of Quality-related plugins Coding conventions with Checkstyle Binary compatibility with Clirr Automated functional tests with Cargo Test coverage with Clover Project documentation with a wiki (Demo of

XWiki)

Page 7: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 7

Agenda

Active Quality vs Passive Quality Review of Quality-related plugins Coding conventions with Checkstyle Binary compatibility with Clirr Automated functional tests with Cargo Test coverage with Clover Project documentation with a wiki (Demo of

XWiki)

Page 8: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 8

Active quality = before the fact

Page 9: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 9

Passive quality = after the fact

Page 10: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 10

Active and Passive quality checks are both required…

… but moving to active is the direction to take

Page 11: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 11

Agenda

Active Quality vs Passive Quality Review of Quality-related plugins Coding conventions with Checkstyle Binary compatibility with Clirr Automated functional tests with Cargo Test coverage with Clover Project documentation with a wiki (Demo of

XWiki)

Page 12: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 12

● Surefire● JUnit and

TestNG

● PMD● Checkstyle● Verifier● Clover● Changelog● Changes

In Maven In Mojo In Mojo Sandbox

Quality-related plugins

● Cargo

● Jetty

● QALab

● Clirr

● Cobertura

● Jalopy

● JDepend

● JavaNCSS

● JDiff

● Selenium

● JBoss

● DBUnit

● Jardiff

● JCoverage

● FindBugs

● Simian

● Emma

● Fit

● Tomcat

● WebLogic

Elsewhere

Page 13: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 13

Agenda

Active Quality vs Passive Quality Review of Quality-related plugins Coding conventions with Checkstyle Binary compatibility with Clirr Automated functional tests with Cargo Test coverage with Clover Project documentation with a wiki (Demo of

XWiki)

Page 14: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 14

Local Maven Repo

Local Maven Repo

Build ToolsModule

Build ToolsModule

Module to be checkedModule to be checked

build-tools.jar

Depends onbuild-tools.jar

Coding conventions with Checkstyle

Page 15: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 15

Coding conventions with Checkstyle

Page 16: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 16

Agenda

Active Quality vs Passive Quality Review of Quality-related plugins Coding conventions with Checkstyle Binary compatibility with Clirr Automated functional tests with Cargo Test coverage with Clover Project documentation with a wiki (Demo of

XWiki)

Page 17: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 17

Binary compatibility with Clirr

Automatically compares previous version API with current sources

To try it quickly: mvn clirr:check Can generate reports too:

Strategy: Exclude files that have voluntary violations

Page 18: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 18

Binary compatibility with Clirr

Page 19: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 19

Agenda

Active Quality vs Passive Quality Review of Quality-related plugins Coding conventions with Checkstyle Binary compatibility with Clirr Automated functional tests with Cargo Test coverage with Clover Project documentation with a wiki (Demo of

XWiki)

Page 20: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 20

Automated functional tests with Cargo

Cargo: A Java API to manipulate containers (install, configure, start, stop, deploy)

Has extensions for Ant, Maven1, Maven2, IntelliJ IDEA*, Netbeans*

Currently support J2EE containers Tomcat, Orion, Resin, Jetty, WebLogic, OC4J,

Geronimo, Jboss, jo! Upcoming: Glassfish, WebSphere Upcoming: database support

Page 21: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 21

Automated functional tests with Cargo

Install distributionInstall distribution

Configure containerConfigure container

DeployDeploy

Start containerStart container

Run testsRun tests

Stop containerStop container

Install from URLEx: http://www.caucho.com/download/resin-3.0.19.zip

Either created by Cargo or use an existing configuration

Deploy WAR, EAR, EJBs, etc

Use any tool: JUnit, TestNG, Selenium, etc

It’s also possible to deploy to an already started container

Page 22: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 22

Automated functional tests with Cargo

Demo!

Page 23: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 23

Full build automation

Library buildsLibrary builds Generate JARs

Components buildsComponents builds Generate WARs, EARs, etc

Databases buildDatabases build Generate databases with schema and data loaded (output is typically ZIP files)

Containers buildContainers buildGenerate fully configured containers with deployed components (output is typically ZIP files)

Applications buildApplications buildGenerate fully working applications (includes both containers and databases build outputs)

Unit tests

Functional tests

Integrationtests

Page 24: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 24

Agenda

Active Quality vs Passive Quality Review of Quality-related plugins Coding conventions with Checkstyle Binary compatibility with Clirr Automated functional tests with Cargo Test coverage with Clover Project documentation with a wiki (Demo of

XWiki)

Page 25: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 25

Test coverage with Clover

Module 1Module 1

Module 2Module 2

Module 3Module 3

Depends on

Local Repository

module1-clover.jarmodule1-clover.jar

module2-clover.jarmodule2-clover.jar

module3-clover.jarmodule3-clover.jar

Build

Dependency

Depends on

Build

Build

Page 26: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 26

Test coverage with CloverReporting Verification

Page 27: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 27

Agenda

Active Quality vs Passive Quality Review of Quality-related plugins Coding conventions with Checkstyle Binary compatibility with Clirr Automated functional tests with Cargo Test coverage with Clover Project documentation with a wiki (Demo of

XWiki)

Page 28: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 28

Project documentation with a wiki Pros

Easier participation and collaboration of everyone Even non-committers

Always published; WYSIWYG Dynamic pages

Get code snippets from SVN Mini-Applications like on the fly charts for development

metrics, etc

Cons Versioned separately from the sources More complex to package Difficult to send patches/diffs Cannot work offline

Page 29: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 29

XWiki demo

Page 30: Gerência de Configuração com Maven

Julho 06 Prof. Ismael H. F. Santos 30Me

Questions