duminică, martie 25, 2007

Better builds with Maven

Este o mica carticica editata de Mergere . Nu stiu foarte clar statutul acestei firme si de ce ingrijesc ei aceasta carte, dar se pare ca ofera suport comercial pentru Maven (care ramane open source sub Apache). Un articol interesant (apropos de better)

Deosebirea esentiala intre Maven si Ant pare a fi urmatoarea: Ant poate fi deprins incetul cu incetul, exersand task cu task (sunt cateva idei de baza: task-uri, target-uri, proprietati, access pre file system, etc). Maven trebuie inteles in toata plinatatea sa pentru a fi intradevar util in dezvoltarea proiectului. Poti sa pornesti destul de usor la inceput dar ce urmeaza poate fi groaznic. Acest lucru poate fi desprins dintr-un interviu interesant despre Maven pe care il puteti asculta pe JavaPosse.

Ce incerc eu sa construiesc este automatizarea procesului de build pentru aplicatiile enterprise.

Pe langa Maven, din toate unelte enuntate in post-ul anterior am ales drept

  • SCM: subversion (mai la moda decat CVS, oferint acces via HTTP).
  • Server de integrare: Continuum ; nu sunt 100% convins asupra lui – pot sa schimb eventual cu Bamboo, Hudson, Luntbuild sau orice server de integrare care ofera supor pentru Maven 2 - o lista a lor o puteti gasi aici.
  • Maven Proxy: Artifactory

Problema principala pe care mi-am pus-o. Care este diferenta intre cei doi termini: build si release. Raspunsul nu l-am gasit usor.

Ca o precizare: am gasit 2 carti car se ocupa de automatizarea build-urilor:

  1. Pragmatic Project Automation – The Pragmatic Programmersautomatizare cu ANT, CVS, Cruise Control
  2. Accelerating and Automating the Build Process – IBM Press – automatizare cu ANT, Clear Case, Cruise Control

Dar nici o carte care sa cuprinda Maven, SVN, si alt server de integrare diferit de Cruise Control. Cruise Control este veteranul serverelor de integrare, cu fisier de configurare complex, dupa parerea mea invechit. Uneltele folosite au specificul lo rasa incat cele doua carti nu pot adduce lucruri practice ci doar aspecte generice despre build.

In a doua carte am gasit un raspuns interesant la intrebarile mele:

  • build si release nu sunt acelasi lucru
  • nu trebuie folosite ca verbe ci ca substantive – ele sunt un rezultat nu un process – putem vorbi doar despre un process care le genereaza

O definitie pentru build:

an operational version of a system or part of a system that demonstrates a subset of the capabilities to be provided in the final product.

O impartire a build-urilor:

· Private Build - A build that is created by a developer in his or her own workspace. This type of build is usually created for the purpose of checking the ongoing status of the developer's changes, such as to assess whether his or her source code compiles.

· Integration Build - A build that is carried out by an assigned integrator or central function. This type of build can be performed manually by a lead developer or a member of the build team, or alternatively through an automatically scheduled program or service. This build is created to assess the effect of integrating a set of changes across a development team.

· Release Build - A build that is carried out by a central function, usually a member of the build team. This build is created with the express intention of being delivered to a customer, either internal or external. A release build is usually created in an isolated and controlled environment.

Definitia unui release:

...a stable, executable version of product, together with any artifacts necessary to use this release, such as release notes or installation instructions. A release can be internal or external. An internal release is used only by the development organization, as part of a milestone, or for a demonstration to users or customers. An external release (or delivery) is delivered to end users. A release is not necessarily a complete product, but can just be one step along the way, with its usefulness measured only from an engineering perspective.

Inseama ca un release este construit si folosit pentru a fi folosit de un third party – un client sau o echipa de testare (echipa de testare poate fi gandita ca un client intern).

Cum se reflecta toate acestea in uneltele alese deja (maven, svn, continuum)? Raspunsul in urmatorul post.