صفحه 1:
WANOG - Opt COk, COOO
اب" ماو
صفحه 2:
SS ۰ ۰ ۰ ۰ ۰ ۰
* hava Dui Pool Oowparisoa
* Desired Prctures
۰ (۳ Oocteuders
+ Oa + Ty
+ Owen
* Groce
٠ @Duatch-
+ Otkers
* Results Datrix
5 Gubjevive udhraiod
* Okick Oould You Chovse?
صفحه 3:
" 777۳۳ ۰ ۰.
۱ Desired (Peutures
* Oppendeusy woorngewect
* Obrrsivciag
* Oovopile dave code, build jars
* @xevute tests od report results, Pall build oo Poiled tests
* Rue qualip-chevk tools (POO, Piedbucs, Chevkstytes)
۰ ,هدن باعلا ,ما0 مس با Bopevt!)
۰ مج ررنومو۳) | toheo substituticc
اهر جر راوج ون للن) ۰
* Pl coat له نی
ممسصخلدام- ووم 0 ٠
* 106 Guppont
© Opornventaica / Support
صفحه 4:
SS
Oat + Ip
© otis ubiquittus dave-based build tool
\Oses XOL “script” Piles
7 uy is 0 depenteuy wooaer
OriPuct repository
-> Wibercrte -> Cowwous-Colleriive)
صفحه 5:
۲ 7۳۳ ۰ ۰.
Oat + Ip
© Oodde depeudeuies ore declared fr yet
<ivy-module version="2.0"
xmlns:xsi="http: //www.w3.org/2001/XMLSchema-instance">
<info organisation=“org.hjug" module=“myModule"/>
<dependencies>
<dependency org="org.apache" name:
<dependency org="org.apache" name:
<dependency org="org. junit" name='
</dependencies>
</ivy-module>
"ant" rev="1.7.0"/>
"axis" re -2rc3"/>
junit" rev="4.4"/>
صفحه 6:
Oat + Ip
ddd this por Dat bake (buklannd)
<project xmlns:ivy="antlib:org.apache. ivy.ant nane="pdk" default="default" basedir=".">
!-- Ivy Taskdefs -->
<path id=" ivy. Lib.path">
<fileset dir="C:/java-tools/apache-ivy-2.0.0" include:
</path>
<tagkdet resources"org/apache/ivy/ant/antLib.xml" uri="antLib:org.apache. ivy.ant™
Classpathref="ivy. lib.path*/>
+ jart/>
<!-- Reference Ivy settings -->
<ivy:settings file="${basedir}/. ./ivysettings.xmU"/>
<target name="ivy.resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve pattern="${Lib.dir}/[conf]/[artifact] . [ext]”/>
</target>
<target name="ivy.publish" description="--> publish artifacts to local repository">
<ivy:publish resolver="Local” pubrevision="${version}”>
<artifacts pattern="dist/ [artifact] .[ext]"/>
</ivy:publish>
</target>
صفحه 7:
رد + 9
۳ لول جروت لان() ood executed wit Bat
© Oppeudeuwies wooaged wi I
© (ot targets to iustal, netdeve م چاه Aw
repositpry
صفحه 8:
Oat + Ip
عااطنام
Cosi
<ivy:installl /> <ivy:resolve />
<ivy:ret >
رت 1۱۷۷:۳۵۵۵ |
Repository
۲ ۲ معزمم
<ivy:publish /> ees
“hee cay Preble rhe. Dire ak
صفحه 9:
Oweu
© Priert io dePiced by POO (Prviect Objert Doce)
| @rvjevis vaca pootaia sub-projevis (wodules)
| used vo reco weated project strurtune (2.4.
srolwuinjava, solani , arvliestiiova, ...)
" Orihact-Pooused (ie. Okt Piles does this build
a Wewy ewphusis vo deP out | ام
صفحه 10:
صفحه 11:
Oweu
® Gack Chose oon be wede up of zero or wore @Cous
(the)
4 @riectspecihic oodPiguroivg involves biedtey speciPic yrds
to spevitic phuses (bepyoud the dePoull sete)
© Cxtewsible plugin syetew (colled Dvine)
) dave-bused or Butbused
J Cowprekeusive set oP third-party phugics همرت
صفحه 12:
SS 0
Crate
* (ult va top خام Bat + Ip
™ Bud OGL writes ia Grow
# Oses Crow @PutBuiter
له موه
® (Phagics الاك بل ۳ وه موه ول
types oF حیرص
NUT, UDO), Wor, ...
صفحه 13:
SS
Groce
2 Ossuves Owed cowedtivas Por Pite looove
(drop-ia replace went Por Owen)
ICoc be ohered wits tke Convention object
™ Can use existing Maven or Ivy
repositories
صفحه 14:
)
= Bult va Ruby
O Rake is sitar to Bat (Ruby Dake)
Rub) Brews is vivitar to rpeo (package WuUTdyer,
Quid soript writes it Ruby (istercral DEL)
صفحه 15:
صفحه 16:
SS 00000
uid
® Ossuves Owed coweulioas Por Pile bpooicns
(drop-ia replocewedt Por Daven)
Occ be chered
™ Can use existing Maven repositories
صفحه 17:
Others
® Gant
# Rube
2 Cus Oat
7 سین
صفحه 18:
2
۹
اس reports
لكك
۷ Ouch the box
26 Det supported
Oars Grade
7
v
v v
v Dorset reoknke
herd revert
صميعام تحدم و | Derry
ار بو و | Deny
Results Dutrix
Gat Ww
4
و
2
7
سیسات
سملا
Om pony kek
میا
0
۱
ای
و لا ,طلت مرول سامومو
rere mets, report revuly, Pal
badd oc Pale tents
check tbs (POO, رطلمی مس
PrkDure, eaxkDov)
le تا مسج
XL, Orbos, Doperal)
صفحه 19:
8 VY 0اف «صط صما خم
Results Dutrix poat'd 16 Oot revered
Orored Prare at Ww Oars rede Oke
فصو expt | thew 2 7 7
هه
uk ve. depby ve. rele Dendy Pied | v
(Pd eral whea weeded Owen Ol [One nsw —— | Onmy ank Ruby woke
00 جام تاس عه معام Pl | chee a bas Pe
لمللممايت 04
رد
Orvee-phihore 7 v v Rene os Ruby,
Ree lOO | Raw mlOO | Rue raid ww ery
محا مسوم
100 میت x ۸ 7 x
otpor oly
Derrnvrcrters | Oxon Orr Crowrnitra sil | Overct rere — | Doel promet
0 مس | مهس
ای تن ای تب
صفحه 20:
۰ ال
Gubievive Cudkatioa
a ®ua, Iw, Owed hove beeo aud the Irocgest
© Restrictive vs. Open phitpsvphy
© Goo dePoutis
© Oepentewy Ounce wed is 0 Good Phe ™
® (at kes bp Por the best domavectativd ond exaroples
wottoble otic
a Grande is the feust wotune (but very prowisicny)
a Quitdr is very vovl but kos poteutal plaPoren issues
(Ruby us. IRuby, OF-bi)
صفحه 21:
Okick تلور S’ou Choose?
Java Build Tool
Comparison
HJUG - April 29th, 2009
John Tyler
Java Build Tool Comparison
•
•
Desired Features
The Contenders
•
•
•
•
•
•
•
•
Ant + Ivy
Maven
Gradle
Buildr
Others
Results Matrix
Subjective Evaluation
Which Would You Choose?
Desired Features
•
•
•
•
•
•
•
•
•
•
•
•
Dependency management
Versioning
Compile Java code, build jars
Execute tests and report results, fail build on failed tests
Run quality-check tools (PMD, Findbugs, Checkstyles)
File generation (XmlBeans, Xsl, Velocity, AspectJ)
Property expansion / token substitution
Build vs. deploy vs. release
Full control when needed
Cross-platform
IDE Support
Documentation / Support
Ant + Ivy
Ant is ubiquitous Java-based build tool
Uses
XML “script” files
Ivy is a dependency manager
Artifact
repository
Dependency resolution, including transitive (Project A
-> Hibernate -> Commons-Collections)
Sync with external repositories
Ant + Ivy
Module dependencies are declared in ivy.xml
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<info organisation=“org.hjug" module=“myModule"/>
<dependencies>
<dependency org="org.apache" name="ant" rev="1.7.0"/>
<dependency org="org.apache" name="axis" rev="1.2rc3"/>
<dependency org="org.junit" name="junit" rev="4.4"/>
</dependencies>
</ivy-module>
Ant + Ivy
Add this to your Ant buildfile (build.xml)
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="pdk" default="default" basedir=".">
…
<!-- Ivy Taskdefs -->
<path id="ivy.lib.path">
<fileset dir="C:/java-tools/apache-ivy-2.0.0" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant"
classpathref="ivy.lib.path"/>
<!-- Reference Ivy settings -->
<ivy:settings file="${basedir}/../ivysettings.xml"/>
<target name="ivy.resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve pattern=“${lib.dir}/[conf]/[artifact].[ext]”/>
</target>
<target name="ivy.publish" description="--> publish artifacts to local repository">
<ivy:publish resolver=“local” pubrevision=“${version}”>
<artifacts pattern=“dist/[artifact].[ext]”/>
</ivy:publish>
</target>
Ant + Ivy
Build steps defined and executed with Ant
Dependencies managed with Ivy
Ant targets to install, retrieve artifacts from Ivy
repository
Ant + Ivy
Image copied from http://ant.apache.org/ivy/history/2.0.0/principle.html
Maven
Project is defined by POM (Project Object Model)
Projects
can contain sub-projects (modules)
Based on recommended project structure (e.g.
src/main/java, src/main/resources, src/test/java, …)
Artifact-focused (i.e. What files does this build
produce?)
Heavy emphasis on default configuration
Maven
Build Lifecycle is defined as Phases, which execute
sequentially
1.
2.
3.
4.
5.
6.
7.
8.
Validate
Compile
Test
Package
Integration-test
Verify
Install
Deploy
Maven
Each Phase can be made up of zero or more Goals
(tasks)
Project-specific
configuration involves binding specific goals
to specific phases (beyond the default settings)
Extensible plugin system (called Mojos)
Java-based
or Ant-based
Comprehensive set of third-party plugins available
Gradle
Built on top of Ant + Ivy
Build DSL written in Groovy
Uses Groovy AntBuilder
ant.compile,
ant.jar
Plugins define common tasks to build different
types of projects
java,
groovy, war, …
Gradle
Assumes Maven conventions for file locations
(drop-in replacement for Maven)
Can
be altered with the convention object
Can use existing Maven or Ivy
repositories
Buildr
Built on Ruby
Rake
is similar to Ant (Ruby Make)
RubyGems is similar to rpm (package manager,
handles dependencies)
Build script written in Ruby (internal DSL)
Buildr
Pre-defined tasks
clean
compile
build
upload
install
javadoc
package
test
uninstall
Buildr
Assumes Maven conventions for file locations
(drop-in replacement for Maven)
Can
be altered
Can use existing Maven repositories
Others
Gant
Rake
EasyAnt
Custom ?
Out of the box
Results Matrix
Desired Feature
Ant + Ivy
Not supported
Maven
Gradle
Buildr
Dependency management
Versioning
manually
Compile Java code, build jars
Execute tests, report results, fail
build on failed tests
Doesn’t include
html reports
Doesn’t include
html reports
Run quality check tools (PMD,
FindBugs, JavaDoc)
3rd party task
libraries
3rd party plugins
Manually
Manually
File generation (XmlBeans,
XSL, Velocity, AspectJ)
3rd party task
libraries
3rd party plugins
Manually
Manually
Out of the box
Results Matrix cont’d
Desired Feature
Ant + Ivy
Maven
Not supported
Gradle
Buildr
Property expansion / token
substitution
Build vs. deploy vs. release
Manually defined
Full control when needed
Custom XML
“scripts”
Write custom
plugin or
embedded Ant
script
Groovy code
directly in build file
Ruby code
directly in build file
Runs on JVM
Runs on Ruby,
may need to
compile from
source
Cross-platform
Runs on JVM
Runs on JVM
IDE Support
Eclipse only
Documentation / Support
Excellent
Growing but still
inconsistent
Decent project
documentation,
few articles
Good project
documentation,
few articles
Subjective Evaluation
Ant, Ivy, Maven have been around the longest
Restrictive vs. Open philosophy
Smart defaults
Dependency Management is a Good Thing™
Ant has by far the best documentation and examples
available online
Gradle is the least mature (but very promising)
Buildr is very cool but has potential platform issues
(Ruby vs. JRuby, 64-bit)
Which Would You Choose?