SlideShare a Scribd company logo
1 of 6
Tomek's Blog http://kaczanowscy.pl/tomek A brief comparison of  Convention-over-Configuration  features of popular build tools: Ant Maven 3 Polyglot Maven Gradle Based on very simple Java 1.5 project with two dependencies: commons-lang 2.5 jUnit 4.8.2
<?xml version=&quot;1.0&quot;?> <project name=&quot;simple&quot; default=&quot;dist&quot; basedir=&quot;.&quot;> <property name=&quot;src&quot; location=&quot;src/main/java&quot;/> <property name=&quot;srcTest&quot; location=&quot;src/test/java&quot;/> <property name=&quot;build&quot; location=&quot;build&quot;/> <property name=&quot;dist&quot; location=&quot;${build}/lib&quot;/> <property name=&quot;version&quot; value=&quot;1.0-SNAPSHOT&quot; /> <path id=&quot;classpath.compile&quot;> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> </path> <path id=&quot;classpath.test&quot;> <pathelement location=&quot;libs/junit-4.8.2.jar&quot;/> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> <pathelement location=&quot;${srcTest}&quot;/> <pathelement location=&quot;${build}/classes&quot;/> <pathelement location=&quot;${build}/test-classes&quot;/> </path> <target name=&quot;init&quot;> <mkdir dir=&quot;${build}/classes&quot;/> <mkdir dir=&quot;${build}/test-classes&quot;/> </target> <target name=&quot;compile&quot; depends=&quot;init&quot;> <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}/classes&quot;> <classpath refid=&quot;classpath.compile&quot;/> </javac> </target> <target name=&quot;testCompile&quot; depends=&quot;compile&quot;> <javac srcdir=&quot;${srcTest}&quot; destdir=&quot;${build}/test-classes&quot;> <classpath refid=&quot;classpath.test&quot;/> </javac> </target> <target name=&quot;test&quot; depends=&quot;testCompile&quot;> <junit fork=&quot;yes&quot; haltonfailure=&quot;yes&quot;> <batchtest fork=&quot;yes&quot;> <fileset dir=&quot;${srcTest}&quot;> <include name=&quot;**/*Test.java&quot;/> </fileset> </batchtest> <classpath refid=&quot;classpath.test&quot;/> <formatter type=&quot;plain&quot;/> </junit> </target> <target name=&quot;dist&quot; depends=&quot;test&quot;> <mkdir dir=&quot;${dist}&quot;/> <jar jarfile=&quot;${dist}/coc-comparison-${version}.jar&quot; basedir=&quot;${build}/classes&quot;/> </target> <target name=&quot;clean&quot;> <delete dir=&quot;${build}&quot;/> </target> </project> Tomek's Blog http://kaczanowscy.pl/tomek Convention Over Configuration
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0  http://maven.apache.org/maven-v4_0_0.xsd&quot;> <modelVersion>4.0.0</modelVersion> <groupId>grId</groupId> <artifactId>coc-comparison</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project> <?xml version=&quot;1.0&quot;?> <project name=&quot;simple&quot; default=&quot;dist&quot; basedir=&quot;.&quot;> <property name=&quot;src&quot; location=&quot;src/main/java&quot;/> <property name=&quot;srcTest&quot; location=&quot;src/test/java&quot;/> <property name=&quot;build&quot; location=&quot;build&quot;/> <property name=&quot;dist&quot; location=&quot;${build}/lib&quot;/> <property name=&quot;version&quot; value=&quot;1.0-SNAPSHOT&quot; /> <path id=&quot;classpath.compile&quot;> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> </path> <path id=&quot;classpath.test&quot;> <pathelement location=&quot;libs/junit-4.8.2.jar&quot;/> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> <pathelement location=&quot;${srcTest}&quot;/> <pathelement location=&quot;${build}/classes&quot;/> <pathelement location=&quot;${build}/test-classes&quot;/> </path> <target name=&quot;init&quot;> <mkdir dir=&quot;${build}/classes&quot;/> <mkdir dir=&quot;${build}/test-classes&quot;/> </target> <target name=&quot;compile&quot; depends=&quot;init&quot;> <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}/classes&quot;> <classpath refid=&quot;classpath.compile&quot;/> </javac> </target> <target name=&quot;testCompile&quot; depends=&quot;compile&quot;> <javac srcdir=&quot;${srcTest}&quot; destdir=&quot;${build}/test-classes&quot;> <classpath refid=&quot;classpath.test&quot;/> </javac> </target> <target name=&quot;test&quot; depends=&quot;testCompile&quot;> <junit fork=&quot;yes&quot; haltonfailure=&quot;yes&quot;> <batchtest fork=&quot;yes&quot;> <fileset dir=&quot;${srcTest}&quot;> <include name=&quot;**/*Test.java&quot;/> </fileset> </batchtest> <classpath refid=&quot;classpath.test&quot;/> <formatter type=&quot;plain&quot;/> </junit> </target> <target name=&quot;dist&quot; depends=&quot;test&quot;> <mkdir dir=&quot;${dist}&quot;/> <jar jarfile=&quot;${dist}/coc-comparison-${version}.jar&quot; basedir=&quot;${build}/classes&quot;/> </target> <target name=&quot;clean&quot;> <delete dir=&quot;${build}&quot;/> </target> </project> Tomek's Blog http://kaczanowscy.pl/tomek Convention Over Configuration
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0  http://maven.apache.org/maven-v4_0_0.xsd&quot;> <modelVersion>4.0.0</modelVersion> <groupId>grId</groupId> <artifactId>coc-comparison</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project> <?xml version=&quot;1.0&quot;?> <project name=&quot;simple&quot; default=&quot;dist&quot; basedir=&quot;.&quot;> <property name=&quot;src&quot; location=&quot;src/main/java&quot;/> <property name=&quot;srcTest&quot; location=&quot;src/test/java&quot;/> <property name=&quot;build&quot; location=&quot;build&quot;/> <property name=&quot;dist&quot; location=&quot;${build}/lib&quot;/> <property name=&quot;version&quot; value=&quot;1.0-SNAPSHOT&quot; /> <path id=&quot;classpath.compile&quot;> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> </path> <path id=&quot;classpath.test&quot;> <pathelement location=&quot;libs/junit-4.8.2.jar&quot;/> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> <pathelement location=&quot;${srcTest}&quot;/> <pathelement location=&quot;${build}/classes&quot;/> <pathelement location=&quot;${build}/test-classes&quot;/> </path> <target name=&quot;init&quot;> <mkdir dir=&quot;${build}/classes&quot;/> <mkdir dir=&quot;${build}/test-classes&quot;/> </target> <target name=&quot;compile&quot; depends=&quot;init&quot;> <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}/classes&quot;> <classpath refid=&quot;classpath.compile&quot;/> </javac> </target> <target name=&quot;testCompile&quot; depends=&quot;compile&quot;> <javac srcdir=&quot;${srcTest}&quot; destdir=&quot;${build}/test-classes&quot;> <classpath refid=&quot;classpath.test&quot;/> </javac> </target> <target name=&quot;test&quot; depends=&quot;testCompile&quot;> <junit fork=&quot;yes&quot; haltonfailure=&quot;yes&quot;> <batchtest fork=&quot;yes&quot;> <fileset dir=&quot;${srcTest}&quot;> <include name=&quot;**/*Test.java&quot;/> </fileset> </batchtest> <classpath refid=&quot;classpath.test&quot;/> <formatter type=&quot;plain&quot;/> </junit> </target> <target name=&quot;dist&quot; depends=&quot;test&quot;> <mkdir dir=&quot;${dist}&quot;/> <jar jarfile=&quot;${dist}/coc-comparison-${version}.jar&quot; basedir=&quot;${build}/classes&quot;/> </target> <target name=&quot;clean&quot;> <delete dir=&quot;${build}&quot;/> </target> </project> Tomek's Blog http://kaczanowscy.pl/tomek project { modelVersion '4.0.0' artifactId 'coc-comparison' groupId 'grId' version '1.0-SNAPSHOT' dependencies { dependency('commons-lang:commons-lang:2.5') dependency('junit:junit:4.8.2') } build { plugins { plugin { groupId 'org.apache.maven.plugins' artifactId 'maven-compiler-plugin' configuration { source '1.5' target '1.5' } } } } } Convention Over Configuration Polyglot
apply plugin: 'java' version=&quot;1.0-SNAPSHOT&quot; group=&quot;grId&quot; archivesBaseName=&quot;coc-comparison&quot; repositories { mavenCentral() } dependencies { compile 'commons-lang:commons-lang:2.5' testCompile 'junit:junit:4.8.1' } <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0  http://maven.apache.org/maven-v4_0_0.xsd&quot;> <modelVersion>4.0.0</modelVersion> <groupId>grId</groupId> <artifactId>coc-comparison</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project> <?xml version=&quot;1.0&quot;?> <project name=&quot;simple&quot; default=&quot;dist&quot; basedir=&quot;.&quot;> <property name=&quot;src&quot; location=&quot;src/main/java&quot;/> <property name=&quot;srcTest&quot; location=&quot;src/test/java&quot;/> <property name=&quot;build&quot; location=&quot;build&quot;/> <property name=&quot;dist&quot; location=&quot;${build}/lib&quot;/> <property name=&quot;version&quot; value=&quot;1.0-SNAPSHOT&quot; /> <path id=&quot;classpath.compile&quot;> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> </path> <path id=&quot;classpath.test&quot;> <pathelement location=&quot;libs/junit-4.8.2.jar&quot;/> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> <pathelement location=&quot;${srcTest}&quot;/> <pathelement location=&quot;${build}/classes&quot;/> <pathelement location=&quot;${build}/test-classes&quot;/> </path> <target name=&quot;init&quot;> <mkdir dir=&quot;${build}/classes&quot;/> <mkdir dir=&quot;${build}/test-classes&quot;/> </target> <target name=&quot;compile&quot; depends=&quot;init&quot;> <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}/classes&quot;> <classpath refid=&quot;classpath.compile&quot;/> </javac> </target> <target name=&quot;testCompile&quot; depends=&quot;compile&quot;> <javac srcdir=&quot;${srcTest}&quot; destdir=&quot;${build}/test-classes&quot;> <classpath refid=&quot;classpath.test&quot;/> </javac> </target> <target name=&quot;test&quot; depends=&quot;testCompile&quot;> <junit fork=&quot;yes&quot; haltonfailure=&quot;yes&quot;> <batchtest fork=&quot;yes&quot;> <fileset dir=&quot;${srcTest}&quot;> <include name=&quot;**/*Test.java&quot;/> </fileset> </batchtest> <classpath refid=&quot;classpath.test&quot;/> <formatter type=&quot;plain&quot;/> </junit> </target> <target name=&quot;dist&quot; depends=&quot;test&quot;> <mkdir dir=&quot;${dist}&quot;/> <jar jarfile=&quot;${dist}/coc-comparison-${version}.jar&quot; basedir=&quot;${build}/classes&quot;/> </target> <target name=&quot;clean&quot;> <delete dir=&quot;${build}&quot;/> </target> </project> Tomek's Blog http://kaczanowscy.pl/tomek project { modelVersion '4.0.0' artifactId 'coc-comparison' groupId 'grId' version '1.0-SNAPSHOT' dependencies { dependency('commons-lang:commons-lang:2.5') dependency('junit:junit:4.8.2') } build { plugins { plugin { groupId 'org.apache.maven.plugins' artifactId 'maven-compiler-plugin' configuration { source '1.5' target '1.5' } } } } } Convention Over Configuration Polyglot
Thank you Tomek Kaczanowski http://kaczanowscy.pl/tomek

More Related Content

Viewers also liked

Présentation Energy Enhancer
Présentation Energy EnhancerPrésentation Energy Enhancer
Présentation Energy EnhancerHerve Royal
 
Présentation des MOOC at Google GDG BARCAMP Douala
Présentation des MOOC  at Google GDG BARCAMP DoualaPrésentation des MOOC  at Google GDG BARCAMP Douala
Présentation des MOOC at Google GDG BARCAMP DoualaMarc NGIAMBA
 
Le point OOAS/WAHO-SFMC-StratAdviser sur ébola au vendredi 26 septembre 2014
Le point OOAS/WAHO-SFMC-StratAdviser sur ébola au vendredi 26 septembre 2014Le point OOAS/WAHO-SFMC-StratAdviser sur ébola au vendredi 26 septembre 2014
Le point OOAS/WAHO-SFMC-StratAdviser sur ébola au vendredi 26 septembre 2014Jan-Cedric Hansen
 
Partie 5: Mémoire Dynamique — Programmation orientée objet en C++
Partie 5: Mémoire Dynamique — Programmation orientée objet en C++Partie 5: Mémoire Dynamique — Programmation orientée objet en C++
Partie 5: Mémoire Dynamique — Programmation orientée objet en C++Fabio Hernandez
 
Glosario 4, p. manuel
Glosario 4, p. manuelGlosario 4, p. manuel
Glosario 4, p. manuelejoya
 
Trampas sicologicas en la toma de decisiones jr
Trampas sicologicas en la toma de decisiones jrTrampas sicologicas en la toma de decisiones jr
Trampas sicologicas en la toma de decisiones jrJonathanRiveraTeran
 
Primeiras fotos a cores
Primeiras fotos a coresPrimeiras fotos a cores
Primeiras fotos a coresguest07d190
 
La réforme de la formation professionnelle : qu'est-ce qui va changer pour le...
La réforme de la formation professionnelle : qu'est-ce qui va changer pour le...La réforme de la formation professionnelle : qu'est-ce qui va changer pour le...
La réforme de la formation professionnelle : qu'est-ce qui va changer pour le...Nextformation
 
software como soporte en el mejoramiento de la comprensión y producción de cu...
software como soporte en el mejoramiento de la comprensión y producción de cu...software como soporte en el mejoramiento de la comprensión y producción de cu...
software como soporte en el mejoramiento de la comprensión y producción de cu...Mariluz Ascuntar
 
CON LAS TIC NAVEGUEMOS POR EL INCREIBLE MUNDO DE LA IMAGINACIÓN
CON LAS TIC NAVEGUEMOS POR EL INCREIBLE MUNDO DE LA IMAGINACIÓNCON LAS TIC NAVEGUEMOS POR EL INCREIBLE MUNDO DE LA IMAGINACIÓN
CON LAS TIC NAVEGUEMOS POR EL INCREIBLE MUNDO DE LA IMAGINACIÓNMariluz Ascuntar
 

Viewers also liked (17)

Reinos cristianos
Reinos cristianosReinos cristianos
Reinos cristianos
 
Présentation Energy Enhancer
Présentation Energy EnhancerPrésentation Energy Enhancer
Présentation Energy Enhancer
 
L' Alimentation Responsable( Partie 3)
L' Alimentation Responsable( Partie 3)L' Alimentation Responsable( Partie 3)
L' Alimentation Responsable( Partie 3)
 
Présentation des MOOC at Google GDG BARCAMP Douala
Présentation des MOOC  at Google GDG BARCAMP DoualaPrésentation des MOOC  at Google GDG BARCAMP Douala
Présentation des MOOC at Google GDG BARCAMP Douala
 
Equipo9_ ac1
Equipo9_ ac1Equipo9_ ac1
Equipo9_ ac1
 
Le point OOAS/WAHO-SFMC-StratAdviser sur ébola au vendredi 26 septembre 2014
Le point OOAS/WAHO-SFMC-StratAdviser sur ébola au vendredi 26 septembre 2014Le point OOAS/WAHO-SFMC-StratAdviser sur ébola au vendredi 26 septembre 2014
Le point OOAS/WAHO-SFMC-StratAdviser sur ébola au vendredi 26 septembre 2014
 
Partie 5: Mémoire Dynamique — Programmation orientée objet en C++
Partie 5: Mémoire Dynamique — Programmation orientée objet en C++Partie 5: Mémoire Dynamique — Programmation orientée objet en C++
Partie 5: Mémoire Dynamique — Programmation orientée objet en C++
 
Tektonik boysss
Tektonik boysssTektonik boysss
Tektonik boysss
 
Glosario 4, p. manuel
Glosario 4, p. manuelGlosario 4, p. manuel
Glosario 4, p. manuel
 
Antiguoregimen
AntiguoregimenAntiguoregimen
Antiguoregimen
 
Trampas sicologicas en la toma de decisiones jr
Trampas sicologicas en la toma de decisiones jrTrampas sicologicas en la toma de decisiones jr
Trampas sicologicas en la toma de decisiones jr
 
Primeiras fotos a cores
Primeiras fotos a coresPrimeiras fotos a cores
Primeiras fotos a cores
 
La réforme de la formation professionnelle : qu'est-ce qui va changer pour le...
La réforme de la formation professionnelle : qu'est-ce qui va changer pour le...La réforme de la formation professionnelle : qu'est-ce qui va changer pour le...
La réforme de la formation professionnelle : qu'est-ce qui va changer pour le...
 
software como soporte en el mejoramiento de la comprensión y producción de cu...
software como soporte en el mejoramiento de la comprensión y producción de cu...software como soporte en el mejoramiento de la comprensión y producción de cu...
software como soporte en el mejoramiento de la comprensión y producción de cu...
 
Samillustrations01
Samillustrations01Samillustrations01
Samillustrations01
 
02 Trouduculboss
02 Trouduculboss02 Trouduculboss
02 Trouduculboss
 
CON LAS TIC NAVEGUEMOS POR EL INCREIBLE MUNDO DE LA IMAGINACIÓN
CON LAS TIC NAVEGUEMOS POR EL INCREIBLE MUNDO DE LA IMAGINACIÓNCON LAS TIC NAVEGUEMOS POR EL INCREIBLE MUNDO DE LA IMAGINACIÓN
CON LAS TIC NAVEGUEMOS POR EL INCREIBLE MUNDO DE LA IMAGINACIÓN
 

More from Tomek Kaczanowski

Grupowe podejmowanie decyzji
Grupowe podejmowanie decyzjiGrupowe podejmowanie decyzji
Grupowe podejmowanie decyzjiTomek Kaczanowski
 
2013 DevFest Vienna - Bad Tests, Good Tests
2013 DevFest Vienna - Bad Tests, Good Tests2013 DevFest Vienna - Bad Tests, Good Tests
2013 DevFest Vienna - Bad Tests, Good TestsTomek Kaczanowski
 
33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good TestsTomek Kaczanowski
 
2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good TestsTomek Kaczanowski
 
Confitura 2012 Bad Tests, Good Tests
Confitura 2012 Bad Tests, Good TestsConfitura 2012 Bad Tests, Good Tests
Confitura 2012 Bad Tests, Good TestsTomek Kaczanowski
 
GeeCON 2012 Bad Tests, Good Tests
GeeCON 2012 Bad Tests, Good TestsGeeCON 2012 Bad Tests, Good Tests
GeeCON 2012 Bad Tests, Good TestsTomek Kaczanowski
 
Sample Chapter of Practical Unit Testing with TestNG and Mockito
Sample Chapter of Practical Unit Testing with TestNG and MockitoSample Chapter of Practical Unit Testing with TestNG and Mockito
Sample Chapter of Practical Unit Testing with TestNG and MockitoTomek Kaczanowski
 
Practical Unit Testing with TestNG and Mockito
Practical Unit Testing with TestNG and MockitoPractical Unit Testing with TestNG and Mockito
Practical Unit Testing with TestNG and MockitoTomek Kaczanowski
 
GeeCON 2011 Who Watches The Watchmen? - On Quality Of Tests
GeeCON 2011 Who Watches The Watchmen? - On Quality Of TestsGeeCON 2011 Who Watches The Watchmen? - On Quality Of Tests
GeeCON 2011 Who Watches The Watchmen? - On Quality Of TestsTomek Kaczanowski
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Tomek Kaczanowski
 

More from Tomek Kaczanowski (11)

2015 ACE! Conference slides
2015 ACE! Conference slides2015 ACE! Conference slides
2015 ACE! Conference slides
 
Grupowe podejmowanie decyzji
Grupowe podejmowanie decyzjiGrupowe podejmowanie decyzji
Grupowe podejmowanie decyzji
 
2013 DevFest Vienna - Bad Tests, Good Tests
2013 DevFest Vienna - Bad Tests, Good Tests2013 DevFest Vienna - Bad Tests, Good Tests
2013 DevFest Vienna - Bad Tests, Good Tests
 
33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests
 
2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests
 
Confitura 2012 Bad Tests, Good Tests
Confitura 2012 Bad Tests, Good TestsConfitura 2012 Bad Tests, Good Tests
Confitura 2012 Bad Tests, Good Tests
 
GeeCON 2012 Bad Tests, Good Tests
GeeCON 2012 Bad Tests, Good TestsGeeCON 2012 Bad Tests, Good Tests
GeeCON 2012 Bad Tests, Good Tests
 
Sample Chapter of Practical Unit Testing with TestNG and Mockito
Sample Chapter of Practical Unit Testing with TestNG and MockitoSample Chapter of Practical Unit Testing with TestNG and Mockito
Sample Chapter of Practical Unit Testing with TestNG and Mockito
 
Practical Unit Testing with TestNG and Mockito
Practical Unit Testing with TestNG and MockitoPractical Unit Testing with TestNG and Mockito
Practical Unit Testing with TestNG and Mockito
 
GeeCON 2011 Who Watches The Watchmen? - On Quality Of Tests
GeeCON 2011 Who Watches The Watchmen? - On Quality Of TestsGeeCON 2011 Who Watches The Watchmen? - On Quality Of Tests
GeeCON 2011 Who Watches The Watchmen? - On Quality Of Tests
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 

Convention Over Configuration - Maven 3, Polyglot Maven, Gradle and Ant

  • 1. Tomek's Blog http://kaczanowscy.pl/tomek A brief comparison of Convention-over-Configuration features of popular build tools: Ant Maven 3 Polyglot Maven Gradle Based on very simple Java 1.5 project with two dependencies: commons-lang 2.5 jUnit 4.8.2
  • 2. <?xml version=&quot;1.0&quot;?> <project name=&quot;simple&quot; default=&quot;dist&quot; basedir=&quot;.&quot;> <property name=&quot;src&quot; location=&quot;src/main/java&quot;/> <property name=&quot;srcTest&quot; location=&quot;src/test/java&quot;/> <property name=&quot;build&quot; location=&quot;build&quot;/> <property name=&quot;dist&quot; location=&quot;${build}/lib&quot;/> <property name=&quot;version&quot; value=&quot;1.0-SNAPSHOT&quot; /> <path id=&quot;classpath.compile&quot;> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> </path> <path id=&quot;classpath.test&quot;> <pathelement location=&quot;libs/junit-4.8.2.jar&quot;/> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> <pathelement location=&quot;${srcTest}&quot;/> <pathelement location=&quot;${build}/classes&quot;/> <pathelement location=&quot;${build}/test-classes&quot;/> </path> <target name=&quot;init&quot;> <mkdir dir=&quot;${build}/classes&quot;/> <mkdir dir=&quot;${build}/test-classes&quot;/> </target> <target name=&quot;compile&quot; depends=&quot;init&quot;> <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}/classes&quot;> <classpath refid=&quot;classpath.compile&quot;/> </javac> </target> <target name=&quot;testCompile&quot; depends=&quot;compile&quot;> <javac srcdir=&quot;${srcTest}&quot; destdir=&quot;${build}/test-classes&quot;> <classpath refid=&quot;classpath.test&quot;/> </javac> </target> <target name=&quot;test&quot; depends=&quot;testCompile&quot;> <junit fork=&quot;yes&quot; haltonfailure=&quot;yes&quot;> <batchtest fork=&quot;yes&quot;> <fileset dir=&quot;${srcTest}&quot;> <include name=&quot;**/*Test.java&quot;/> </fileset> </batchtest> <classpath refid=&quot;classpath.test&quot;/> <formatter type=&quot;plain&quot;/> </junit> </target> <target name=&quot;dist&quot; depends=&quot;test&quot;> <mkdir dir=&quot;${dist}&quot;/> <jar jarfile=&quot;${dist}/coc-comparison-${version}.jar&quot; basedir=&quot;${build}/classes&quot;/> </target> <target name=&quot;clean&quot;> <delete dir=&quot;${build}&quot;/> </target> </project> Tomek's Blog http://kaczanowscy.pl/tomek Convention Over Configuration
  • 3. <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;> <modelVersion>4.0.0</modelVersion> <groupId>grId</groupId> <artifactId>coc-comparison</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project> <?xml version=&quot;1.0&quot;?> <project name=&quot;simple&quot; default=&quot;dist&quot; basedir=&quot;.&quot;> <property name=&quot;src&quot; location=&quot;src/main/java&quot;/> <property name=&quot;srcTest&quot; location=&quot;src/test/java&quot;/> <property name=&quot;build&quot; location=&quot;build&quot;/> <property name=&quot;dist&quot; location=&quot;${build}/lib&quot;/> <property name=&quot;version&quot; value=&quot;1.0-SNAPSHOT&quot; /> <path id=&quot;classpath.compile&quot;> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> </path> <path id=&quot;classpath.test&quot;> <pathelement location=&quot;libs/junit-4.8.2.jar&quot;/> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> <pathelement location=&quot;${srcTest}&quot;/> <pathelement location=&quot;${build}/classes&quot;/> <pathelement location=&quot;${build}/test-classes&quot;/> </path> <target name=&quot;init&quot;> <mkdir dir=&quot;${build}/classes&quot;/> <mkdir dir=&quot;${build}/test-classes&quot;/> </target> <target name=&quot;compile&quot; depends=&quot;init&quot;> <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}/classes&quot;> <classpath refid=&quot;classpath.compile&quot;/> </javac> </target> <target name=&quot;testCompile&quot; depends=&quot;compile&quot;> <javac srcdir=&quot;${srcTest}&quot; destdir=&quot;${build}/test-classes&quot;> <classpath refid=&quot;classpath.test&quot;/> </javac> </target> <target name=&quot;test&quot; depends=&quot;testCompile&quot;> <junit fork=&quot;yes&quot; haltonfailure=&quot;yes&quot;> <batchtest fork=&quot;yes&quot;> <fileset dir=&quot;${srcTest}&quot;> <include name=&quot;**/*Test.java&quot;/> </fileset> </batchtest> <classpath refid=&quot;classpath.test&quot;/> <formatter type=&quot;plain&quot;/> </junit> </target> <target name=&quot;dist&quot; depends=&quot;test&quot;> <mkdir dir=&quot;${dist}&quot;/> <jar jarfile=&quot;${dist}/coc-comparison-${version}.jar&quot; basedir=&quot;${build}/classes&quot;/> </target> <target name=&quot;clean&quot;> <delete dir=&quot;${build}&quot;/> </target> </project> Tomek's Blog http://kaczanowscy.pl/tomek Convention Over Configuration
  • 4. <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;> <modelVersion>4.0.0</modelVersion> <groupId>grId</groupId> <artifactId>coc-comparison</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project> <?xml version=&quot;1.0&quot;?> <project name=&quot;simple&quot; default=&quot;dist&quot; basedir=&quot;.&quot;> <property name=&quot;src&quot; location=&quot;src/main/java&quot;/> <property name=&quot;srcTest&quot; location=&quot;src/test/java&quot;/> <property name=&quot;build&quot; location=&quot;build&quot;/> <property name=&quot;dist&quot; location=&quot;${build}/lib&quot;/> <property name=&quot;version&quot; value=&quot;1.0-SNAPSHOT&quot; /> <path id=&quot;classpath.compile&quot;> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> </path> <path id=&quot;classpath.test&quot;> <pathelement location=&quot;libs/junit-4.8.2.jar&quot;/> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> <pathelement location=&quot;${srcTest}&quot;/> <pathelement location=&quot;${build}/classes&quot;/> <pathelement location=&quot;${build}/test-classes&quot;/> </path> <target name=&quot;init&quot;> <mkdir dir=&quot;${build}/classes&quot;/> <mkdir dir=&quot;${build}/test-classes&quot;/> </target> <target name=&quot;compile&quot; depends=&quot;init&quot;> <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}/classes&quot;> <classpath refid=&quot;classpath.compile&quot;/> </javac> </target> <target name=&quot;testCompile&quot; depends=&quot;compile&quot;> <javac srcdir=&quot;${srcTest}&quot; destdir=&quot;${build}/test-classes&quot;> <classpath refid=&quot;classpath.test&quot;/> </javac> </target> <target name=&quot;test&quot; depends=&quot;testCompile&quot;> <junit fork=&quot;yes&quot; haltonfailure=&quot;yes&quot;> <batchtest fork=&quot;yes&quot;> <fileset dir=&quot;${srcTest}&quot;> <include name=&quot;**/*Test.java&quot;/> </fileset> </batchtest> <classpath refid=&quot;classpath.test&quot;/> <formatter type=&quot;plain&quot;/> </junit> </target> <target name=&quot;dist&quot; depends=&quot;test&quot;> <mkdir dir=&quot;${dist}&quot;/> <jar jarfile=&quot;${dist}/coc-comparison-${version}.jar&quot; basedir=&quot;${build}/classes&quot;/> </target> <target name=&quot;clean&quot;> <delete dir=&quot;${build}&quot;/> </target> </project> Tomek's Blog http://kaczanowscy.pl/tomek project { modelVersion '4.0.0' artifactId 'coc-comparison' groupId 'grId' version '1.0-SNAPSHOT' dependencies { dependency('commons-lang:commons-lang:2.5') dependency('junit:junit:4.8.2') } build { plugins { plugin { groupId 'org.apache.maven.plugins' artifactId 'maven-compiler-plugin' configuration { source '1.5' target '1.5' } } } } } Convention Over Configuration Polyglot
  • 5. apply plugin: 'java' version=&quot;1.0-SNAPSHOT&quot; group=&quot;grId&quot; archivesBaseName=&quot;coc-comparison&quot; repositories { mavenCentral() } dependencies { compile 'commons-lang:commons-lang:2.5' testCompile 'junit:junit:4.8.1' } <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;> <modelVersion>4.0.0</modelVersion> <groupId>grId</groupId> <artifactId>coc-comparison</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project> <?xml version=&quot;1.0&quot;?> <project name=&quot;simple&quot; default=&quot;dist&quot; basedir=&quot;.&quot;> <property name=&quot;src&quot; location=&quot;src/main/java&quot;/> <property name=&quot;srcTest&quot; location=&quot;src/test/java&quot;/> <property name=&quot;build&quot; location=&quot;build&quot;/> <property name=&quot;dist&quot; location=&quot;${build}/lib&quot;/> <property name=&quot;version&quot; value=&quot;1.0-SNAPSHOT&quot; /> <path id=&quot;classpath.compile&quot;> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> </path> <path id=&quot;classpath.test&quot;> <pathelement location=&quot;libs/junit-4.8.2.jar&quot;/> <pathelement location=&quot;libs/commons-lang-2.5.jar&quot;/> <pathelement location=&quot;${srcTest}&quot;/> <pathelement location=&quot;${build}/classes&quot;/> <pathelement location=&quot;${build}/test-classes&quot;/> </path> <target name=&quot;init&quot;> <mkdir dir=&quot;${build}/classes&quot;/> <mkdir dir=&quot;${build}/test-classes&quot;/> </target> <target name=&quot;compile&quot; depends=&quot;init&quot;> <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}/classes&quot;> <classpath refid=&quot;classpath.compile&quot;/> </javac> </target> <target name=&quot;testCompile&quot; depends=&quot;compile&quot;> <javac srcdir=&quot;${srcTest}&quot; destdir=&quot;${build}/test-classes&quot;> <classpath refid=&quot;classpath.test&quot;/> </javac> </target> <target name=&quot;test&quot; depends=&quot;testCompile&quot;> <junit fork=&quot;yes&quot; haltonfailure=&quot;yes&quot;> <batchtest fork=&quot;yes&quot;> <fileset dir=&quot;${srcTest}&quot;> <include name=&quot;**/*Test.java&quot;/> </fileset> </batchtest> <classpath refid=&quot;classpath.test&quot;/> <formatter type=&quot;plain&quot;/> </junit> </target> <target name=&quot;dist&quot; depends=&quot;test&quot;> <mkdir dir=&quot;${dist}&quot;/> <jar jarfile=&quot;${dist}/coc-comparison-${version}.jar&quot; basedir=&quot;${build}/classes&quot;/> </target> <target name=&quot;clean&quot;> <delete dir=&quot;${build}&quot;/> </target> </project> Tomek's Blog http://kaczanowscy.pl/tomek project { modelVersion '4.0.0' artifactId 'coc-comparison' groupId 'grId' version '1.0-SNAPSHOT' dependencies { dependency('commons-lang:commons-lang:2.5') dependency('junit:junit:4.8.2') } build { plugins { plugin { groupId 'org.apache.maven.plugins' artifactId 'maven-compiler-plugin' configuration { source '1.5' target '1.5' } } } } } Convention Over Configuration Polyglot
  • 6. Thank you Tomek Kaczanowski http://kaczanowscy.pl/tomek