SlideShare a Scribd company logo
1 of 79
Download to read offline
David Gómez G.
@dgomezg
BIGOTENTIOS
Automatizar la construcción… ¿Pur qué?
•

Evitar empaquetado
manual

•

Construir rápidamente
y en cualquier entorno

•

Foto de Steindy
http://commons.wikimedia.org/wiki/File:Jose_Mourinho_-_Inter_Mailand_(7).jpg

Builds programadas (C.I.)
Herramientas
Fichero de descripción
+
Código fuente
+
Gestión de dependencias
=
Artefacto
Características
•

Basado en Java

•

Configuración basada en XML

•

Gestor de dependencias adicional (Ivy)

•

Muy flexible
•

Todas las tareas se definen
específicamente
Pegas
•

Muy verboso. XML muy extensos

•

Difícil escribir lógica compleja (condiciones)

•

Estructura de proyecto libre.

•

Difícil de mantener

•

Difícil de entender el proceso de construcción.
Ejemplo
Ejemplo
<?xml version="1.0" encoding="UTF-8"?>	
<project>	
<target name="clean">	
<delete dir="build"/>	
</target>	
<target name="compile">	
<mkdir dir="build/classes"/>	
<javac srcdir="src" destdir="build/classes"/>	
</target>	
<target name="jar">	
<mkdir dir="build/jar"/>	
<jar destfile="build/jar/HelloWorld.jar" 	
	
basedir="build/classes">	
<manifest>	
<attribute name="Main-Class" 	
value="com.autentia.dgomezg.sandbox.ant.HelloWorld"/>	
</manifest>	
</jar>	
</target>	

!
!

<target name="run">	
<java jar="build/jar/HelloWorld.jar" fork="true"/>	
</target>	

</project>
Ejemplo
<?xml version="1.0" encoding="UTF-8"?>	
<project>	
<target name="clean">	
<delete dir="build"/>	
</target>	
<target name="compile">	
<mkdir dir="build/classes"/>	
dolamroth:ant-sample dgomezg$ ant clean compile jar run	
<javac srcdir="src" destdir="build/classes"/>	
Buildfile: /Users/dgomezg/Documents/workspace/ant-sample/build.xml	
</target>	
!
<target name="jar">	
clean:	
<mkdir dir="build/jar"/>	 !
compile:	
<jar destfile="build/jar/HelloWorld.jar" 	
	
basedir="build/classes">	 [mkdir] Created dir: /Users/dgomezg/Documents/workspace/ant-sample/
build/classes	
<manifest>	
[javac] Compiling 1 source file to /Users/dgomezg/Documents/
<attribute name="Main-Class" 	
workspace/ant-sample/build/classes	
value="com.autentia.dgomezg.sandbox.ant.HelloWorld"/>	
!
</manifest>	
jar:	
</jar>	
[mkdir] Created dir: /Users/dgomezg/Documents/workspace/ant-sample/
build/jar	
</target>	

!
!

[jar] Building jar: /Users/dgomezg/Documents/workspace/ant-sample/
build/jar/HelloWorld.jar	

<target name="run">	
!
<java jar="build/jar/HelloWorld.jar" fork="true"/>	
run:	
</target>	
[java] Hello World	

</project>

!

BUILD SUCCESSFUL	
Total time: 1 second	
dolamroth:ant-sample dgomezg$
Características
•

Convención sobre configuración
•

Estructura de proyecto
determinada

•

Proceso de construcción
definido

•

Gestor de dependencias

•

Informes de construcción y de test

•

Arquetipos

•

Ampliable con Plugins (Mojos)
Pegas
•

Estructura demasiado rígida

•

Extensión complicada

•

Fichero de build verboso
•

Especialmente si configuramos plugins
Ejemplo
Ejemplo
<?xml version="1.0" encoding="UTF-8"?>	
<project>	
<modelVersion>4.0.0</modelVersion>	
<groupId>com.autentia.dgomezg.sandbox</groupId>	
<artifactId>mvn-sample</artifactId>	
<version>1.0.0</version>	
</project>
Ejemplo
<?xml version="1.0" encoding="UTF-8"?>	
<project>	
<modelVersion>4.0.0</modelVersion>	
<groupId>com.autentia.dgomezg.sandbox</groupId>	mvn package	
dolamroth:mvn-sample dgomezg$
[INFO] Scanning for projects...	
<artifactId>mvn-sample</artifactId>	
[INFO]
	
[INFO] ------------------------------------------------------------------------	
[INFO] Building mvn-sample 1.0.0	
<version>1.0.0</version>	
[INFO] ------------------------------------------------------------------------	
[INFO] 	
</project>
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ mvn-sample ---	
[debug] execute contextualize	
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!	
[INFO] Copying 0 resource	
[INFO] 	
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ mvn-sample ---	
[INFO] Nothing to compile - all classes are up to date	
[INFO] 	
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ mvn-sample ---	
[debug] execute contextualize	
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!	
[INFO] Copying 0 resource	
[INFO] 	
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ mvn-sample ---	
[INFO] Nothing to compile - all classes are up to date	
[INFO] 	
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ mvn-sample ---	
[INFO] Surefire report directory: /Users/dgomezg/Documents/workspace/mvn-sample/target/surefire-reports	

!

-------------------------------------------------------	
T E S T S	
-------------------------------------------------------	

!
!
!

Results :	
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0	
[INFO] 	
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ mvn-sample ---	
[INFO] Building jar: /Users/dgomezg/Documents/workspace/mvn-sample/target/mvn-sample-1.0.0.jar	
[INFO] ------------------------------------------------------------------------	
[INFO] BUILD SUCCESS	
[INFO] ------------------------------------------------------------------------	
[INFO] Total time: 0.876s	
[INFO] Finished at: Wed Nov 20 13:32:06 CET 2013	
[INFO] Final Memory: 7M/245M	
[INFO] ------------------------------------------------------------------------	
dolamroth:mvn-sample dgomezg$
¿Qué se puede mejorar?
Ficheros de build más concisos
Convención para estructura
Flexibilidad para requisitos
Builds incrementales
Reutilización de partes del script
Soporte para implementar lógica
Características
•

Flexibilidad

•

•

Definición de nuevas
tareas

Convención sobre
configuración

•

Multi-Módulo

•

Plugins

•

Gestor de dependencias

•

Gestor de
dependencias (Ivy)
Características
•

Basado en Groovy
•

Lenguaje completo

•

Permite definir lógica más compleja

•

Convenciones Flexibles

•

Extensibilidad

•

Integración con Ant (AntExecutor) y
maven
Ejemplo
Ejemplo
apply plugin: 'java'	

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	
version = '0.1.0-SNAPSHOT'	

!
Ejemplo
apply plugin: 'java'	

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	
version = '0.1.0-SNAPSHOT'	

!

dolamroth:gradle-sample dgomezg$ gradle build	
:compileJava UP-TO-DATE	
:processResources UP-TO-DATE	
:classes UP-TO-DATE	
:jar	
:assemble	
:compileTestJava UP-TO-DATE	
:processTestResources UP-TO-DATE	
:testClasses UP-TO-DATE	
:test	
:check	
:build	

!

BUILD SUCCESSFUL	

!

Total time: 2.375 secs	
dolamroth:gradle-sample dgomezg$
Ejemplo
apply plugin: 'java'	

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	
version = '0.1.0-SNAPSHOT'	

!

sourceCompatibility = 1.6	

!

jar {	
manifest {	
attributes 'Main-Class':
}	
}	

dolamroth:gradle-sample dgomezg$ gradle build	
:compileJava UP-TO-DATE	
:processResources UP-TO-DATE	
:classes UP-TO-DATE	
:jar	
:assemble	
:compileTestJava UP-TO-DATE	
'com.autentia.dgomezg.sandbox.gradle.HelloWorld'	
:processTestResources UP-TO-DATE	
:testClasses UP-TO-DATE	
:test	
:check	
:build	

!

BUILD SUCCESSFUL	

!

Total time: 2.375 secs	
dolamroth:gradle-sample dgomezg$
Fundamentos Gradle
El proceso
Groovy DSL
Todo tiene un equivalente en clases java
Groovy DSL
Mayor flexibilidad a la hora de definir nuevas tareas
Groovy DSL
Mayor flexibilidad a la hora de definir nuevas tareas
task projectVersion {	
doLast {	
println ‘Project version’ + project.version	
}	
}
Groovy DSL
Mayor flexibilidad a la hora de definir nuevas tareas
task projectVersion {	
doLast {	
println ‘Project version’ + project.version	
}	
}	

dolamroth:gradle-sample dgomezg$ gradle projectVersion	
:projectVersion	
Project Version: 0.1.0-SNAPSHOT	

!
BUILD SUCCESSFUL	

!
Total time: 3.708 secs
Groovy DSL
Mayor flexibilidad a la hora de definir nuevas tareas
task projectVersion {	
doLast {	
println ‘Project version’ + project.version	
}	
}	

dolamroth:gradle-sample dgomezg$ gradle projectVersion	
:projectVersion	
Project Version: 0.1.0-SNAPSHOT	

!
BUILD SUCCESSFUL	

!
Total time: 3.708 secs
dolamroth:gradle-sample dgomezg$ gradle -q projectVersion	
Project Version: 0.1.0-SNAPSHOT	
dolamroth:gradle-sample dgomezg
Plugins
Permiten activar funcionalidades
Plugins
Permiten activar funcionalidades
apply
apply
apply
apply

plugin:
plugin:
plugin:
plugin:

'java'	
'maven'	
‘eclipse'	
'war'	

!
group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	
version = '0.1.0-SNAPSHOT'	

!
sourceCompatibility = 1.6
Plugins
Permiten activar funcionalidades
apply
apply
apply
apply

!

plugin:
plugin:
plugin:
plugin:

'java'	
'maven'	
‘eclipse'	
$
'war'	

!

gradle tasks	

Build tasks	
group = 'com.autentia.dgomezg.sandbox'	
-----------	
assemble - Assembles the outputs of this project.	
archivesBaseName = 'gradle-sample'	
build - Assembles and tests this project.	
version = '0.1.0-SNAPSHOT'	
buildDependents - Assembles and tests this project and all projects that depend on it.	
buildNeeded - Assembles and tests this project and all projects it depends on.	
clean
sourceCompatibility = 1.6	 - Deletes the build directory.	
jar - Assembles a jar archive containing the main classes.	
war - Generates a war archive with all the compiled classes, the web-app content and
the libraries.	

!

!

Documentation tasks	
-------------------	
javadoc - Generates Javadoc API documentation for the main source code.	

!

IDE tasks	
---------	
cleanEclipse - Cleans all Eclipse files.	
eclipse - Generates all Eclipse files.	

!

Other tasks	
-----------	
install - Installs the 'archives' artifacts into the local Maven repository.
Integración con ant
Propiedad ant disponible en todas las tareas
Integración con ant
Propiedad ant disponible en todas las tareas
task projectVersion {	
	
doLast {	
	
ant.echo(message: 'Project Version: ' + project.version)	
	
}	
}
Integración con ant
Propiedad ant disponible en todas las tareas
task projectVersion {	
	
doLast {	
	
ant.echo(message: 'Project Version: ' + project.version)	
	
}	
}

dolamroth:gradle-sample dgomezg$ gradle -q projectVersion	
dolamroth:gradle-sample dgomezg$ 	
dolamroth:gradle-sample dgomezg$ gradle projectVersion	
:projectVersion	
[ant:echo] Project Version: 0.1.0-SNAPSHOT	

!

BUILD SUCCESSFUL	

!

Total time: 2.914 secs	
dolamroth:gradle-sample dgomezg$
Integración con maven
Por defecto, toma las convenciones de maven
Se puede integrar con los repositorios de maven
Integración con maven
Por defecto, toma las convenciones de maven
Se puede integrar con los repositorios de maven
repositories {	
	 mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public'	
mavenCentral()	
mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone'
mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/'	
}
Integración con maven
Por defecto, toma las convenciones de maven
Se puede integrar con los repositorios de maven
repositories {	
	 mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public'	
mavenCentral()	
mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone'
mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/'	
}	

Declaración compacta de dependencias
Integración con maven
Por defecto, toma las convenciones de maven
Se puede integrar con los repositorios de maven
repositories {	
	 mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public'	
mavenCentral()	
mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone'
mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/'	
}	

Declaración compacta de dependencias
dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
runtime	 	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

"com.google.guava:guava:12.0",	
"org.apache.commons:commons-lang3:3.1",	
"org.slf4j:jcl-over-slf4j:1.6.1",	
"org.springframework.security:spring-security-core:3.0.1.RELEASE",	
"org.springframework:spring-jdbc:3.0.0.RELEASE",	
"org.springframework:spring-tx:3.0.0.RELEASE"	
	
"org.apache.geronimo.specs:geronimo-jpa_3.0_spec:1.1.1",	
"org.apache.geronimo.specs:geronimo-servlet_2.4_spec:1.1.1"	
	
"junit:junit:4.5",	
"org.springframework:spring-test:3.0.0.RELEASE"
Integración con maven
Se pueden excluir dependencias transitivas
Integración con maven
Se pueden excluir dependencias transitivas
configurations {	
	
sources.exclude group: 'com.google.code.guice'	
	
all*.exclude module: 'commons-logging'	
}
Integración con maven
Se pueden excluir dependencias transitivas
configurations {	
	
sources.exclude group: 'com.google.code.guice'	
	
all*.exclude module: 'commons-logging'	
}	

Se pueden subir artefactos al repositorio
Integración con maven
Se pueden excluir dependencias transitivas
configurations {	
	
sources.exclude group: 'com.google.code.guice'	
	
all*.exclude module: 'commons-logging'	
}	

Se pueden subir artefactos al repositorio
apply plugin: 'maven'	

!

uploadArchives {	

!

}

repositories.mavenDeployer {	
def credentials = [userName: 'user', password: 'password']	
uniqueVersion = true	
snapshotRepository(url: 'http://gitrepo:8081/nexus/content/repositories/snapshots') {	
	
authentication(credentials)	
}	
repository(url: 'http://gitrepo:8081/nexus/content/repositories/releases') {	
	
authentication(credentials)	
}	
}
Propiedades

Se pueden utilizar propiedades internas
Propiedades

Se pueden utilizar propiedades internas
project.ext {	
	
springVersion = ‘3.2.5.RELEASE’	
}	

!

dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

“org.springframework.security:spring-security-core:${springVersion}”,	
"org.springframework:spring-jdbc:${springVersion}",	
"org.springframework:spring-tx:${springVersion}"	
	
"junit:junit:4.5",	
“org.springframework:spring-test:${springVersion}”
Propiedades

Se pueden utilizar propiedades internas
project.ext {	
	
springVersion = ‘3.2.5.RELEASE’	
}	

!

dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

“org.springframework.security:spring-security-core:${springVersion}”,	
"org.springframework:spring-jdbc:${springVersion}",	
"org.springframework:spring-tx:${springVersion}"	
	
"junit:junit:4.5",	
“org.springframework:spring-test:${springVersion}”	

Se pueden utilizar propiedades externas
Propiedades

Se pueden utilizar propiedades internas
project.ext {	
	
springVersion = ‘3.2.5.RELEASE’	
}	

!

dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

“org.springframework.security:spring-security-core:${springVersion}”,	
"org.springframework:spring-jdbc:${springVersion}",	
"org.springframework:spring-tx:${springVersion}"	
	
"junit:junit:4.5",	
“org.springframework:spring-test:${springVersion}”	

Se pueden utilizar propiedades externas
version=0.1.0-SNAPSHOT	
springVersion=3.2.5.RELEASE	
sharedLocation=https://raw.github.com/autentia/common/
Propiedades

Se pueden utilizar propiedades internas
project.ext {	
	
springVersion = ‘3.2.5.RELEASE’	
}	

!

dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

“org.springframework.security:spring-security-core:${springVersion}”,	
"org.springframework:spring-jdbc:${springVersion}",	
"org.springframework:spring-tx:${springVersion}"	
	
"junit:junit:4.5",	
“org.springframework:spring-test:${springVersion}”	

Se pueden utilizar propiedades externas
gradle.properties
version=0.1.0-SNAPSHOT	
springVersion=3.2.5.RELEASE	
sharedLocation=https://raw.github.com/autentia/common/
Propiedades

Se pueden utilizar propiedades internas
project.ext {	
	
springVersion = ‘3.2.5.RELEASE’	
}	

!

dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

“org.springframework.security:spring-security-core:${springVersion}”,	
"org.springframework:spring-jdbc:${springVersion}",	
"org.springframework:spring-tx:${springVersion}"	
	
"junit:junit:4.5",	
“org.springframework:spring-test:${springVersion}”	

Se pueden utilizar propiedades externas
gradle.properties
version=0.1.0-SNAPSHOT	
springVersion=3.2.5.RELEASE	
sharedLocation=https://raw.github.com/autentia/common/
dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

“org.springframework.security:spring-security-core:${springVersion}”,	
"org.springframework:spring-jdbc:${springVersion}",	
"org.springframework:spring-tx:${springVersion}"	
	
"junit:junit:4.5",	
“org.springframework:spring-test:${springVersion}”
Propiedades

Se pueden utilizar propiedades internas
project.ext {	
	
springVersion = ‘3.2.5.RELEASE’	
}	

!

dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

“org.springframework.security:spring-security-core:${springVersion}”,	
"org.springframework:spring-jdbc:${springVersion}",	
"org.springframework:spring-tx:${springVersion}"	
	
"junit:junit:4.5",	
“org.springframework:spring-test:${springVersion}”	

Se pueden utilizar propiedades externas
gradle.properties
version=0.1.0-SNAPSHOT	
springVersion=3.2.5.RELEASE	
sharedLocation=https://raw.github.com/autentia/common/
dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}

build.gradle
“org.springframework.security:spring-security-core:${springVersion}”,	
"org.springframework:spring-jdbc:${springVersion}",	
"org.springframework:spring-tx:${springVersion}"	
	
"junit:junit:4.5",	
“org.springframework:spring-test:${springVersion}”
Gradle Wrapper
Gradle Wrapper
Gradle Wrapper
task wrapper(type: Wrapper) {	
	
gradleVersion = '1.7'	
}
Gradle Wrapper
task wrapper(type: Wrapper) {	
	
gradleVersion = '1.7'	
$ gradle wrapper	
}
:wrapper	

!

BUILD SUCCESSFUL	

!

Total time: 5.071 secs	

!

$ ls -l gradle/wrapper	
total 112	
-rw-r--r-- 1 dgomezg staff 49875 Nov 20 16:53 gradle-wrapper.jar	
-rw-r--r-- 1 dgomezg staff
229 Nov 20 16:53 gradle-wrapper.properties	
$ ls gradle*	
gradle.properties	 gradlew	 	 	 gradlew.bat	
$ ./gradlew build	
:compileJava UP-TO-DATE	
:processResources UP-TO-DATE	
:classes UP-TO-DATE	
:war UP-TO-DATE	
:assemble UP-TO-DATE	
:compileTestJava UP-TO-DATE	
:processTestResources UP-TO-DATE	
:testClasses UP-TO-DATE	
:test UP-TO-DATE	
:check UP-TO-DATE	
:build UP-TO-DATE	

!

BUILD SUCCESSFUL	

!

Total time: 3.531 secs
Convención flexible
Se pueden adaptar las convenciones de estructura de
proyecto
Convención flexible
Se pueden adaptar las convenciones de estructura de
proyecto
sourceSets {	
	
main {	
	
	
java {	
	
	
	
srcDirs = ['src']	
	
	
}	
	
}	
	
test {	
	
	
java {	
	
	
	
srcDirs = ['test']	
	
	
}	
	
}	
}	
buildDir = 'out'
Convención flexible
Se pueden adaptar las convenciones de estructura de
proyecto
sourceSets {	
	
main {	
	
	
java {	
	
	
	
srcDirs = ['src']	
	
	
}	
	
}	
	
test {	
	
	
java {	
	
	
	
srcDirs = ['test']	
	
	
}	
	
}	
}	
buildDir = 'out'	

compileJava {	
source 'src/protobuf/java'	
source 'src/main/java'	
}
Reutilización
Los archivos se pueden modularizar
Reutilización
Los archivos se pueden modularizar
apply plugin: 'java'	
apply plugin: 'maven'	
apply plugin: 'eclipse'	

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	

!

sourceCompatibility = 1.6	

!

repositories {	
	 //mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public'	
mavenCentral()	
mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone'
mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/'	
}	

!

dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}	

!

"org.springframework.security:spring-security-core:3.0.1.RELEASE",	
"org.springframework:spring-jdbc:3.0.0.RELEASE",	
"org.springframework:spring-tx:3.0.0.RELEASE"	
"junit:junit:4.5",	
"org.springframework:spring-test:3.0.0.RELEASE"
Reutilización
Los archivos se pueden modularizar
apply plugin: 'java'	
apply plugin: 'maven'	
apply plugin: 'eclipse'	

project.gradle

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	

!

sourceCompatibility = 1.6	

!

repositories {	
	 //mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public'	
mavenCentral()	
mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone'
mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/'	
}	

!

dependencies {	
	
compile	 	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
	
	
	
	
	
}	

!

"org.springframework.security:spring-security-core:3.0.1.RELEASE",	
"org.springframework:spring-jdbc:3.0.0.RELEASE",	
"org.springframework:spring-tx:3.0.0.RELEASE"	
"junit:junit:4.5",	
"org.springframework:spring-test:3.0.0.RELEASE"
Reutilización
Los archivos se pueden importar
Reutilización
Los archivos se pueden importar
apply plugin: 'java'	
apply plugin: 'maven'	
apply plugin: 'eclipse'	

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	

!

sourceCompatibility = 1.6	

!

repositories {	
}	

!

dependencies {	
}
Reutilización
Los archivos se pueden importar
apply plugin: 'java'	
apply plugin: 'maven'	
apply plugin: 'eclipse'	

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	

!

sourceCompatibility = 1.6	

!

repositories {	
}	

!

dependencies {	
}	

project.gradle
Reutilización
Los archivos se pueden importar
apply plugin: 'java'	
apply plugin: 'maven'	
apply plugin: 'eclipse'	

project.gradle

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	

!

sourceCompatibility = 1.6	

!

repositories {	
apply from: ‘../autentia-common/project.gradle’	
}	

!

!

dependencies {	
dependencies {	
	
compile 	
	
}	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}	

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		

"com.google.guava:guava:r05",	
"org.apache.commons:commons-lang3:3.1",	
	
	
	
	
	
"org.slf4j:slf4j-api:1.6.1",	
"ch.qos.logback:logback-classic:0.9.24",	
"org.springframework:spring-aop:$springVersion",	
"org.springframework:spring-beans:$springVersion",	
"org.springframework:spring-context:$springVersion",	
"org.springframework:spring-core:$springVersion",	
"org.springframework:spring-web:$springVersion",	
"org.springframework.data:spring-data-mongodb:1.0.1.RELEASE",	
"org.mongodb:mongo-java-driver:2.7.1"	
	
"org.mockito:mockito-core:1.8.5"
Reutilización
Los archivos se pueden importar
apply plugin: 'java'	
apply plugin: 'maven'	
apply plugin: 'eclipse'	

project.gradle

!

group = 'com.autentia.dgomezg.sandbox'	
archivesBaseName = 'gradle-sample'	

!

sourceCompatibility = 1.6	

!

repositories {	
apply from: ‘../autentia-common/project.gradle’	
}	

!

!

dependencies {	
dependencies {	
	
compile 	
	
}	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}	

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		

build.gradle

"com.google.guava:guava:r05",	
"org.apache.commons:commons-lang3:3.1",	
	
	
	
	
	
"org.slf4j:slf4j-api:1.6.1",	
"ch.qos.logback:logback-classic:0.9.24",	
"org.springframework:spring-aop:$springVersion",	
"org.springframework:spring-beans:$springVersion",	
"org.springframework:spring-context:$springVersion",	
"org.springframework:spring-core:$springVersion",	
"org.springframework:spring-web:$springVersion",	
"org.springframework.data:spring-data-mongodb:1.0.1.RELEASE",	
"org.mongodb:mongo-java-driver:2.7.1"	
	
"org.mockito:mockito-core:1.8.5"
Reutilización
Los archivos se pueden compartir
Reutilización
Los archivos se pueden compartir
version=0.1.0-SNAPSHOT	
springVersion=3.2.5.RELEASE	
sharedLocation=https://raw.github.com/autentia/common/	
#commitId of the version to be used	
commonComponentsVersion=c7e2110511112c5055e0aaaa7db953b35129a95b
Reutilización
Los archivos se pueden compartir
gradle.properties

version=0.1.0-SNAPSHOT	
springVersion=3.2.5.RELEASE	
sharedLocation=https://raw.github.com/autentia/common/	
#commitId of the version to be used	
commonComponentsVersion=c7e2110511112c5055e0aaaa7db953b35129a95b
Reutilización
Los archivos se pueden compartir
gradle.properties

version=0.1.0-SNAPSHOT	
springVersion=3.2.5.RELEASE	
sharedLocation=https://raw.github.com/autentia/common/	
#commitId of the version to be used	
commonComponentsVersion=c7e2110511112c5055e0aaaa7db953b35129a95b

apply from: ‘$sharedLocation/$commonComponentsVersion/autentia.gradle’	

!

dependencies {	
	
compile 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
}	

"com.google.guava:guava:r05",	
"org.apache.commons:commons-lang3:3.1",	
	
	
	
	
	
"org.slf4j:slf4j-api:1.6.1",	
"ch.qos.logback:logback-classic:0.9.24",	
"org.springframework:spring-aop:$springVersion",	
"org.springframework:spring-beans:$springVersion",	
"org.springframework:spring-context:$springVersion",	
"org.springframework:spring-core:$springVersion",	
"org.springframework:spring-web:$springVersion",	
"org.springframework.data:spring-data-mongodb:1.0.1.RELEASE",	
"org.mongodb:mongo-java-driver:2.7.1"	
	
"org.mockito:mockito-core:1.8.5"
Reutilización
Los archivos se pueden compartir
gradle.properties

version=0.1.0-SNAPSHOT	
springVersion=3.2.5.RELEASE	
sharedLocation=https://raw.github.com/autentia/common/	
#commitId of the version to be used	
commonComponentsVersion=c7e2110511112c5055e0aaaa7db953b35129a95b

apply from: ‘$sharedLocation/$commonComponentsVersion/autentia.gradle’	

build.gradle

!

dependencies {	
	
compile 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
testCompile 		
}	

"com.google.guava:guava:r05",	
"org.apache.commons:commons-lang3:3.1",	
	
	
	
	
	
"org.slf4j:slf4j-api:1.6.1",	
"ch.qos.logback:logback-classic:0.9.24",	
"org.springframework:spring-aop:$springVersion",	
"org.springframework:spring-beans:$springVersion",	
"org.springframework:spring-context:$springVersion",	
"org.springframework:spring-core:$springVersion",	
"org.springframework:spring-web:$springVersion",	
"org.springframework.data:spring-data-mongodb:1.0.1.RELEASE",	
"org.mongodb:mongo-java-driver:2.7.1"	
	
"org.mockito:mockito-core:1.8.5"
Extensibilidad
Podemos ampliar la funcionalidad fácilmente
Extensibilidad
Podemos ampliar la funcionalidad fácilmente
task deployJetty(dependsOn: assertJettyHome) << {	
	
new File("$jettyHome/contexts/${webappName}.xml").write (	
"""<?xml version="1.0" encoding="ISO-8859-1"?>	
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">	
<Configure class="org.mortbay.jetty.webapp.WebAppContext">	
<Set name="contextPath">/${webappName}</Set>	
<Set name="resourceBase">${projectDir}/src/main/webapp</Set>	
</Configure>		
""")	
}	

!

task undeployJetty(dependsOn: assertJettyHome) << {	
	
ant.delete file: "$jettyHome/contexts/${webappName}.xml"	
}
Extensibilidad
Podemos ampliar la funcionalidad fácilmente
jetty.gradle
task deployJetty(dependsOn: assertJettyHome) << {	
	
new File("$jettyHome/contexts/${webappName}.xml").write (	
"""<?xml version="1.0" encoding="ISO-8859-1"?>	
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">	
<Configure class="org.mortbay.jetty.webapp.WebAppContext">	
<Set name="contextPath">/${webappName}</Set>	
<Set name="resourceBase">${projectDir}/src/main/webapp</Set>	
</Configure>		
""")	
}	

!

task undeployJetty(dependsOn: assertJettyHome) << {	
	
ant.delete file: "$jettyHome/contexts/${webappName}.xml"	
}
Extensibilidad
Podemos ampliar la funcionalidad fácilmente
jetty.gradle
task deployJetty(dependsOn: assertJettyHome) << {	
	
new File("$jettyHome/contexts/${webappName}.xml").write (	
"""<?xml version="1.0" encoding="ISO-8859-1"?>	
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">	
<Configure class="org.mortbay.jetty.webapp.WebAppContext">	
<Set name="contextPath">/${webappName}</Set>	
<Set name="resourceBase">${projectDir}/src/main/webapp</Set>	
</Configure>		
""")	
}	

!

task undeployJetty(dependsOn: assertJettyHome) << {	
	
ant.delete file: "$jettyHome/contexts/${webappName}.xml"	
}

apply from: ‘$sharedLocation/$commonComponentsVersion/jetty.gradle’	

!

project.ext {	
webappName=gradle-sample	
jettyHome= System.getenv(“JETTY_HOME”);	
}	
…
Extensibilidad
Podemos ampliar la funcionalidad fácilmente
jetty.gradle
task deployJetty(dependsOn: assertJettyHome) << {	
	
new File("$jettyHome/contexts/${webappName}.xml").write (	
"""<?xml version="1.0" encoding="ISO-8859-1"?>	
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">	
<Configure class="org.mortbay.jetty.webapp.WebAppContext">	
<Set name="contextPath">/${webappName}</Set>	
<Set name="resourceBase">${projectDir}/src/main/webapp</Set>	
</Configure>		
""")	
}	

!

task undeployJetty(dependsOn: assertJettyHome) << {	
	
ant.delete file: "$jettyHome/contexts/${webappName}.xml"	
}

apply from: ‘$sharedLocation/$commonComponentsVersion/jetty.gradle’	

!

project.ext {	
webappName=gradle-sample	
jettyHome= System.getenv(“JETTY_HOME”);	
}	
…

build.gradle
‘Arquetipos’
Hay un proyecto de plugin que procura cubrir ese hueco:
https://github.com/townsfolk/gradle-templates
!
‘Arquetipos’
Hay un proyecto de plugin que procura cubrir ese hueco:
https://github.com/townsfolk/gradle-templates
apply from: 'http://www.tellurianring.com/projects/gradle-plugins/gradle-templates/1.3/apply.groovy'	

!

…	

!
‘Arquetipos’
Hay un proyecto de plugin que procura cubrir ese hueco:
https://github.com/townsfolk/gradle-templates
apply from: 'http://www.tellurianring.com/projects/gradle-plugins/gradle-templates/1.3/apply.groovy'	

!

!

…	
$ gradle tasks	

!

Template tasks	
--------------	
createGradlePlugin - Creates a new Gradle Plugin project in a new directory named after your project.	
createGroovyClass - Creates a new Groovy class in the current project.	
createGroovyProject - Creates a new Gradle Groovy project in a new directory named after your project.	
createJavaClass - Creates a new Java class in the current project.	
createJavaProject - Creates a new Gradle Java project in a new directory named after your project.	
createScalaClass - Creates a new Scala class in the current project.	
createScalaObject - Creates a new Scala object in the current project.	
createScalaProject - Creates a new Gradle Scala project in a new directory named after your project.	
createWebappProject - Creates a new Gradle Webapp project in a new directory named after your project.	
exportAllTemplates - Exports all the default template files into the current directory.	
exportGroovyTemplates - Exports the default groovy template files into the current directory.	
exportJavaTemplates - Exports the default java template files into the current directory.	
exportPluginTemplates - Exports the default plugin template files into the current directory.	
exportScalaTemplates - Exports the default scala template files into the current directory.	
exportWebappTemplates - Exports the default webapp template files into the current directory.	
initGradlePlugin - Initializes a new Gradle Plugin project in the current directory.	
initGroovyProject - Initializes a new Gradle Groovy project in the current directory.	
initJavaProject - Initializes a new Gradle Java project in the current directory.	
initScalaProject - Initializes a new Gradle Scala project in the current directory.	
initWebappProject - Initializes a new Gradle Webapp project in the current directory.
Y mucho más
•

Posibilidad de ejecutar gradle como demonio

•

Toda la potencia de un lenguaje para los scripts

•

Integración con sistemas de Integración Continua
•

Jenkins

•

ClinkerHQ

•

Consola
Conclusiones
•

No más XML Oriented Programming

•

Concisión y legibilidad

•

Toda la potencia de las convenciones de maven

•

Integración con Ant

•

Gestor de dependencias

•

Flexibilidad de un lenguaje de programación

•

Modularización y reutilización

More Related Content

What's hot

The world of gradle - an introduction for developers
The world of gradle  - an introduction for developersThe world of gradle  - an introduction for developers
The world of gradle - an introduction for developersTricode (part of Dept)
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradleLiviu Tudor
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-kyon mm
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Tomek Kaczanowski
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaJadson Santos
 
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Eric Wendelin
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeansRyan Cuprak
 
maven
mavenmaven
mavenakd11
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Ontico
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin WritingSchalk Cronjé
 

What's hot (20)

Hands on the Gradle
Hands on the GradleHands on the Gradle
Hands on the Gradle
 
The world of gradle - an introduction for developers
The world of gradle  - an introduction for developersThe world of gradle  - an introduction for developers
The world of gradle - an introduction for developers
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Gradle
GradleGradle
Gradle
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradle
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and Java
 
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!
 
Maven
MavenMaven
Maven
 
Scaling Django
Scaling DjangoScaling Django
Scaling Django
 
Building with Gradle
Building with GradleBuilding with Gradle
Building with Gradle
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
 
Ant, Maven and Jenkins
Ant, Maven and JenkinsAnt, Maven and Jenkins
Ant, Maven and Jenkins
 
maven
mavenmaven
maven
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin Writing
 

Viewers also liked

Breve introducción a Apache Ant
Breve introducción a Apache AntBreve introducción a Apache Ant
Breve introducción a Apache AntIker Canarias
 
Regla del Boy Scout y la Oxidación del Software
Regla del Boy Scout y la Oxidación del SoftwareRegla del Boy Scout y la Oxidación del Software
Regla del Boy Scout y la Oxidación del SoftwareAlejandro Pérez García
 
JAX-RS 2.0: RESTful Java on Steroids, by Aron Gupta
JAX-RS 2.0: RESTful Java on Steroids, by Aron GuptaJAX-RS 2.0: RESTful Java on Steroids, by Aron Gupta
JAX-RS 2.0: RESTful Java on Steroids, by Aron GuptaCodemotion
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and ODataAnil Allewar
 
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rsJava colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rsSagara Gunathunga
 
JAX-RS 2.0: What’s New in JSR 339 ?
JAX-RS 2.0: What’s New in JSR 339 ?JAX-RS 2.0: What’s New in JSR 339 ?
JAX-RS 2.0: What’s New in JSR 339 ?Arun Gupta
 
Cas 2011 Integración continua vs controlada
Cas 2011 Integración continua vs controladaCas 2011 Integración continua vs controlada
Cas 2011 Integración continua vs controladapsluaces
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to MavenJoao Pereira
 
Design in Tech Report 2017
Design in Tech Report 2017Design in Tech Report 2017
Design in Tech Report 2017John Maeda
 

Viewers also liked (18)

Gradle vs Maven
Gradle vs MavenGradle vs Maven
Gradle vs Maven
 
Breve introducción a Apache Ant
Breve introducción a Apache AntBreve introducción a Apache Ant
Breve introducción a Apache Ant
 
Regla del Boy Scout y la Oxidación del Software
Regla del Boy Scout y la Oxidación del SoftwareRegla del Boy Scout y la Oxidación del Software
Regla del Boy Scout y la Oxidación del Software
 
JAX-RS 2.0: RESTful Java on Steroids, by Aron Gupta
JAX-RS 2.0: RESTful Java on Steroids, by Aron GuptaJAX-RS 2.0: RESTful Java on Steroids, by Aron Gupta
JAX-RS 2.0: RESTful Java on Steroids, by Aron Gupta
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rsJava colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rs
 
Maven
MavenMaven
Maven
 
Maven
Maven Maven
Maven
 
Maven (EN ESPANOL)
Maven (EN ESPANOL)Maven (EN ESPANOL)
Maven (EN ESPANOL)
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 
JAX-RS 2.0: What’s New in JSR 339 ?
JAX-RS 2.0: What’s New in JSR 339 ?JAX-RS 2.0: What’s New in JSR 339 ?
JAX-RS 2.0: What’s New in JSR 339 ?
 
Java desde cero maven
Java desde cero mavenJava desde cero maven
Java desde cero maven
 
Cas 2011 Integración continua vs controlada
Cas 2011 Integración continua vs controladaCas 2011 Integración continua vs controlada
Cas 2011 Integración continua vs controlada
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Clean code
Clean codeClean code
Clean code
 
Death by PowerPoint
Death by PowerPointDeath by PowerPoint
Death by PowerPoint
 
Design in Tech Report 2017
Design in Tech Report 2017Design in Tech Report 2017
Design in Tech Report 2017
 

Similar to Gradle como alternativa a maven

The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptDocker, Inc.
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Ortus Solutions, Corp
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)DECK36
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungKAI CHU CHUNG
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CISebastian Witowski
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipseMike Slinn
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDocker, Inc.
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardwayDave Pitts
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDocker, Inc.
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Ryan Cuprak
 

Similar to Gradle como alternativa a maven (20)

The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChung
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best Practices
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 

More from David Gómez García

Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022David Gómez García
 
Building Modular monliths that could scale to microservices (only if they nee...
Building Modular monliths that could scale to microservices (only if they nee...Building Modular monliths that could scale to microservices (only if they nee...
Building Modular monliths that could scale to microservices (only if they nee...David Gómez García
 
Building modular monoliths that could scale to microservices (only if they ne...
Building modular monoliths that could scale to microservices (only if they ne...Building modular monoliths that could scale to microservices (only if they ne...
Building modular monoliths that could scale to microservices (only if they ne...David Gómez García
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyDavid Gómez García
 
Builiding Modular monoliths that can scale to microservices. JBCNConf 2021
Builiding Modular monoliths that can scale to microservices. JBCNConf 2021Builiding Modular monoliths that can scale to microservices. JBCNConf 2021
Builiding Modular monoliths that can scale to microservices. JBCNConf 2021David Gómez García
 
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationCdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationDavid Gómez García
 
What's in a community like Liferay's
What's in a community like Liferay'sWhat's in a community like Liferay's
What's in a community like Liferay'sDavid Gómez García
 
Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadDavid Gómez García
 
T3chFest2016 - Uso del API JavaScript de Photoshop para obtener fotos HDTR
T3chFest2016 - Uso del API JavaScript de Photoshop para obtener fotos HDTRT3chFest2016 - Uso del API JavaScript de Photoshop para obtener fotos HDTR
T3chFest2016 - Uso del API JavaScript de Photoshop para obtener fotos HDTRDavid Gómez García
 
Managing user's data with Spring Session
Managing user's data with Spring SessionManaging user's data with Spring Session
Managing user's data with Spring SessionDavid Gómez García
 
Construccion de proyectos con gradle
Construccion de proyectos con gradleConstruccion de proyectos con gradle
Construccion de proyectos con gradleDavid Gómez García
 
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.David Gómez García
 
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)David Gómez García
 
Measuring Code Quality in WTF/min.
Measuring Code Quality in WTF/min. Measuring Code Quality in WTF/min.
Measuring Code Quality in WTF/min. David Gómez García
 
El poder del creador de Software. Entre la ingeniería y la artesanía
El poder del creador de Software. Entre la ingeniería y la artesaníaEl poder del creador de Software. Entre la ingeniería y la artesanía
El poder del creador de Software. Entre la ingeniería y la artesaníaDavid Gómez García
 
HDTR images with Photoshop Javascript Scripting
HDTR images with Photoshop Javascript ScriptingHDTR images with Photoshop Javascript Scripting
HDTR images with Photoshop Javascript ScriptingDavid Gómez García
 

More from David Gómez García (20)

Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022
 
Building Modular monliths that could scale to microservices (only if they nee...
Building Modular monliths that could scale to microservices (only if they nee...Building Modular monliths that could scale to microservices (only if they nee...
Building Modular monliths that could scale to microservices (only if they nee...
 
Building modular monoliths that could scale to microservices (only if they ne...
Building modular monoliths that could scale to microservices (only if they ne...Building modular monoliths that could scale to microservices (only if they ne...
Building modular monoliths that could scale to microservices (only if they ne...
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results Asynchrhonously
 
Builiding Modular monoliths that can scale to microservices. JBCNConf 2021
Builiding Modular monoliths that can scale to microservices. JBCNConf 2021Builiding Modular monoliths that can scale to microservices. JBCNConf 2021
Builiding Modular monoliths that can scale to microservices. JBCNConf 2021
 
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationCdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
 
What's in a community like Liferay's
What's in a community like Liferay'sWhat's in a community like Liferay's
What's in a community like Liferay's
 
Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidad
 
T3chFest2016 - Uso del API JavaScript de Photoshop para obtener fotos HDTR
T3chFest2016 - Uso del API JavaScript de Photoshop para obtener fotos HDTRT3chFest2016 - Uso del API JavaScript de Photoshop para obtener fotos HDTR
T3chFest2016 - Uso del API JavaScript de Photoshop para obtener fotos HDTR
 
Managing user's data with Spring Session
Managing user's data with Spring SessionManaging user's data with Spring Session
Managing user's data with Spring Session
 
Parallel streams in java 8
Parallel streams in java 8Parallel streams in java 8
Parallel streams in java 8
 
Construccion de proyectos con gradle
Construccion de proyectos con gradleConstruccion de proyectos con gradle
Construccion de proyectos con gradle
 
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.
 
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
 
Measuring Code Quality in WTF/min.
Measuring Code Quality in WTF/min. Measuring Code Quality in WTF/min.
Measuring Code Quality in WTF/min.
 
Spring4 whats up doc?
Spring4 whats up doc?Spring4 whats up doc?
Spring4 whats up doc?
 
El poder del creador de Software. Entre la ingeniería y la artesanía
El poder del creador de Software. Entre la ingeniería y la artesaníaEl poder del creador de Software. Entre la ingeniería y la artesanía
El poder del creador de Software. Entre la ingeniería y la artesanía
 
Geo-SentimentZ
Geo-SentimentZGeo-SentimentZ
Geo-SentimentZ
 
HDTR images with Photoshop Javascript Scripting
HDTR images with Photoshop Javascript ScriptingHDTR images with Photoshop Javascript Scripting
HDTR images with Photoshop Javascript Scripting
 
Wtf per lineofcode
Wtf per lineofcodeWtf per lineofcode
Wtf per lineofcode
 

Recently uploaded

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Gradle como alternativa a maven

  • 3. Automatizar la construcción… ¿Pur qué? • Evitar empaquetado manual • Construir rápidamente y en cualquier entorno • Foto de Steindy http://commons.wikimedia.org/wiki/File:Jose_Mourinho_-_Inter_Mailand_(7).jpg Builds programadas (C.I.)
  • 4. Herramientas Fichero de descripción + Código fuente + Gestión de dependencias = Artefacto
  • 5. Características • Basado en Java • Configuración basada en XML • Gestor de dependencias adicional (Ivy) • Muy flexible • Todas las tareas se definen específicamente
  • 6. Pegas • Muy verboso. XML muy extensos • Difícil escribir lógica compleja (condiciones) • Estructura de proyecto libre. • Difícil de mantener • Difícil de entender el proceso de construcción.
  • 8. Ejemplo <?xml version="1.0" encoding="UTF-8"?> <project> <target name="clean"> <delete dir="build"/> </target> <target name="compile"> <mkdir dir="build/classes"/> <javac srcdir="src" destdir="build/classes"/> </target> <target name="jar"> <mkdir dir="build/jar"/> <jar destfile="build/jar/HelloWorld.jar" basedir="build/classes"> <manifest> <attribute name="Main-Class" value="com.autentia.dgomezg.sandbox.ant.HelloWorld"/> </manifest> </jar> </target> ! ! <target name="run"> <java jar="build/jar/HelloWorld.jar" fork="true"/> </target> </project>
  • 9. Ejemplo <?xml version="1.0" encoding="UTF-8"?> <project> <target name="clean"> <delete dir="build"/> </target> <target name="compile"> <mkdir dir="build/classes"/> dolamroth:ant-sample dgomezg$ ant clean compile jar run <javac srcdir="src" destdir="build/classes"/> Buildfile: /Users/dgomezg/Documents/workspace/ant-sample/build.xml </target> ! <target name="jar"> clean: <mkdir dir="build/jar"/> ! compile: <jar destfile="build/jar/HelloWorld.jar" basedir="build/classes"> [mkdir] Created dir: /Users/dgomezg/Documents/workspace/ant-sample/ build/classes <manifest> [javac] Compiling 1 source file to /Users/dgomezg/Documents/ <attribute name="Main-Class" workspace/ant-sample/build/classes value="com.autentia.dgomezg.sandbox.ant.HelloWorld"/> ! </manifest> jar: </jar> [mkdir] Created dir: /Users/dgomezg/Documents/workspace/ant-sample/ build/jar </target> ! ! [jar] Building jar: /Users/dgomezg/Documents/workspace/ant-sample/ build/jar/HelloWorld.jar <target name="run"> ! <java jar="build/jar/HelloWorld.jar" fork="true"/> run: </target> [java] Hello World </project> ! BUILD SUCCESSFUL Total time: 1 second dolamroth:ant-sample dgomezg$
  • 10. Características • Convención sobre configuración • Estructura de proyecto determinada • Proceso de construcción definido • Gestor de dependencias • Informes de construcción y de test • Arquetipos • Ampliable con Plugins (Mojos)
  • 11. Pegas • Estructura demasiado rígida • Extensión complicada • Fichero de build verboso • Especialmente si configuramos plugins
  • 14. Ejemplo <?xml version="1.0" encoding="UTF-8"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>com.autentia.dgomezg.sandbox</groupId> mvn package dolamroth:mvn-sample dgomezg$ [INFO] Scanning for projects... <artifactId>mvn-sample</artifactId> [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building mvn-sample 1.0.0 <version>1.0.0</version> [INFO] ------------------------------------------------------------------------ [INFO] </project> [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ mvn-sample --- [debug] execute contextualize [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ mvn-sample --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ mvn-sample --- [debug] execute contextualize [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ mvn-sample --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.10:test (default-test) @ mvn-sample --- [INFO] Surefire report directory: /Users/dgomezg/Documents/workspace/mvn-sample/target/surefire-reports ! ------------------------------------------------------- T E S T S ------------------------------------------------------- ! ! ! Results : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ mvn-sample --- [INFO] Building jar: /Users/dgomezg/Documents/workspace/mvn-sample/target/mvn-sample-1.0.0.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.876s [INFO] Finished at: Wed Nov 20 13:32:06 CET 2013 [INFO] Final Memory: 7M/245M [INFO] ------------------------------------------------------------------------ dolamroth:mvn-sample dgomezg$
  • 15. ¿Qué se puede mejorar? Ficheros de build más concisos Convención para estructura Flexibilidad para requisitos Builds incrementales Reutilización de partes del script Soporte para implementar lógica
  • 16. Características • Flexibilidad • • Definición de nuevas tareas Convención sobre configuración • Multi-Módulo • Plugins • Gestor de dependencias • Gestor de dependencias (Ivy)
  • 17. Características • Basado en Groovy • Lenguaje completo • Permite definir lógica más compleja • Convenciones Flexibles • Extensibilidad • Integración con Ant (AntExecutor) y maven
  • 19. Ejemplo apply plugin: 'java' ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' version = '0.1.0-SNAPSHOT' !
  • 20. Ejemplo apply plugin: 'java' ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' version = '0.1.0-SNAPSHOT' ! dolamroth:gradle-sample dgomezg$ gradle build :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar :assemble :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test :check :build ! BUILD SUCCESSFUL ! Total time: 2.375 secs dolamroth:gradle-sample dgomezg$
  • 21. Ejemplo apply plugin: 'java' ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' version = '0.1.0-SNAPSHOT' ! sourceCompatibility = 1.6 ! jar { manifest { attributes 'Main-Class': } } dolamroth:gradle-sample dgomezg$ gradle build :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar :assemble :compileTestJava UP-TO-DATE 'com.autentia.dgomezg.sandbox.gradle.HelloWorld' :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test :check :build ! BUILD SUCCESSFUL ! Total time: 2.375 secs dolamroth:gradle-sample dgomezg$
  • 24. Groovy DSL Todo tiene un equivalente en clases java
  • 25. Groovy DSL Mayor flexibilidad a la hora de definir nuevas tareas
  • 26. Groovy DSL Mayor flexibilidad a la hora de definir nuevas tareas task projectVersion { doLast { println ‘Project version’ + project.version } }
  • 27. Groovy DSL Mayor flexibilidad a la hora de definir nuevas tareas task projectVersion { doLast { println ‘Project version’ + project.version } } dolamroth:gradle-sample dgomezg$ gradle projectVersion :projectVersion Project Version: 0.1.0-SNAPSHOT ! BUILD SUCCESSFUL ! Total time: 3.708 secs
  • 28. Groovy DSL Mayor flexibilidad a la hora de definir nuevas tareas task projectVersion { doLast { println ‘Project version’ + project.version } } dolamroth:gradle-sample dgomezg$ gradle projectVersion :projectVersion Project Version: 0.1.0-SNAPSHOT ! BUILD SUCCESSFUL ! Total time: 3.708 secs dolamroth:gradle-sample dgomezg$ gradle -q projectVersion Project Version: 0.1.0-SNAPSHOT dolamroth:gradle-sample dgomezg
  • 30. Plugins Permiten activar funcionalidades apply apply apply apply plugin: plugin: plugin: plugin: 'java' 'maven' ‘eclipse' 'war' ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' version = '0.1.0-SNAPSHOT' ! sourceCompatibility = 1.6
  • 31. Plugins Permiten activar funcionalidades apply apply apply apply ! plugin: plugin: plugin: plugin: 'java' 'maven' ‘eclipse' $ 'war' ! gradle tasks Build tasks group = 'com.autentia.dgomezg.sandbox' ----------- assemble - Assembles the outputs of this project. archivesBaseName = 'gradle-sample' build - Assembles and tests this project. version = '0.1.0-SNAPSHOT' buildDependents - Assembles and tests this project and all projects that depend on it. buildNeeded - Assembles and tests this project and all projects it depends on. clean sourceCompatibility = 1.6 - Deletes the build directory. jar - Assembles a jar archive containing the main classes. war - Generates a war archive with all the compiled classes, the web-app content and the libraries. ! ! Documentation tasks ------------------- javadoc - Generates Javadoc API documentation for the main source code. ! IDE tasks --------- cleanEclipse - Cleans all Eclipse files. eclipse - Generates all Eclipse files. ! Other tasks ----------- install - Installs the 'archives' artifacts into the local Maven repository.
  • 32. Integración con ant Propiedad ant disponible en todas las tareas
  • 33. Integración con ant Propiedad ant disponible en todas las tareas task projectVersion { doLast { ant.echo(message: 'Project Version: ' + project.version) } }
  • 34. Integración con ant Propiedad ant disponible en todas las tareas task projectVersion { doLast { ant.echo(message: 'Project Version: ' + project.version) } } dolamroth:gradle-sample dgomezg$ gradle -q projectVersion dolamroth:gradle-sample dgomezg$ dolamroth:gradle-sample dgomezg$ gradle projectVersion :projectVersion [ant:echo] Project Version: 0.1.0-SNAPSHOT ! BUILD SUCCESSFUL ! Total time: 2.914 secs dolamroth:gradle-sample dgomezg$
  • 35. Integración con maven Por defecto, toma las convenciones de maven Se puede integrar con los repositorios de maven
  • 36. Integración con maven Por defecto, toma las convenciones de maven Se puede integrar con los repositorios de maven repositories { mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public' mavenCentral() mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone' mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/' }
  • 37. Integración con maven Por defecto, toma las convenciones de maven Se puede integrar con los repositorios de maven repositories { mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public' mavenCentral() mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone' mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/' } Declaración compacta de dependencias
  • 38. Integración con maven Por defecto, toma las convenciones de maven Se puede integrar con los repositorios de maven repositories { mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public' mavenCentral() mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone' mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/' } Declaración compacta de dependencias dependencies { compile runtime testCompile } "com.google.guava:guava:12.0", "org.apache.commons:commons-lang3:3.1", "org.slf4j:jcl-over-slf4j:1.6.1", "org.springframework.security:spring-security-core:3.0.1.RELEASE", "org.springframework:spring-jdbc:3.0.0.RELEASE", "org.springframework:spring-tx:3.0.0.RELEASE" "org.apache.geronimo.specs:geronimo-jpa_3.0_spec:1.1.1", "org.apache.geronimo.specs:geronimo-servlet_2.4_spec:1.1.1" "junit:junit:4.5", "org.springframework:spring-test:3.0.0.RELEASE"
  • 39. Integración con maven Se pueden excluir dependencias transitivas
  • 40. Integración con maven Se pueden excluir dependencias transitivas configurations { sources.exclude group: 'com.google.code.guice' all*.exclude module: 'commons-logging' }
  • 41. Integración con maven Se pueden excluir dependencias transitivas configurations { sources.exclude group: 'com.google.code.guice' all*.exclude module: 'commons-logging' } Se pueden subir artefactos al repositorio
  • 42. Integración con maven Se pueden excluir dependencias transitivas configurations { sources.exclude group: 'com.google.code.guice' all*.exclude module: 'commons-logging' } Se pueden subir artefactos al repositorio apply plugin: 'maven' ! uploadArchives { ! } repositories.mavenDeployer { def credentials = [userName: 'user', password: 'password'] uniqueVersion = true snapshotRepository(url: 'http://gitrepo:8081/nexus/content/repositories/snapshots') { authentication(credentials) } repository(url: 'http://gitrepo:8081/nexus/content/repositories/releases') { authentication(credentials) } }
  • 43. Propiedades Se pueden utilizar propiedades internas
  • 44. Propiedades Se pueden utilizar propiedades internas project.ext { springVersion = ‘3.2.5.RELEASE’ } ! dependencies { compile testCompile } “org.springframework.security:spring-security-core:${springVersion}”, "org.springframework:spring-jdbc:${springVersion}", "org.springframework:spring-tx:${springVersion}" "junit:junit:4.5", “org.springframework:spring-test:${springVersion}”
  • 45. Propiedades Se pueden utilizar propiedades internas project.ext { springVersion = ‘3.2.5.RELEASE’ } ! dependencies { compile testCompile } “org.springframework.security:spring-security-core:${springVersion}”, "org.springframework:spring-jdbc:${springVersion}", "org.springframework:spring-tx:${springVersion}" "junit:junit:4.5", “org.springframework:spring-test:${springVersion}” Se pueden utilizar propiedades externas
  • 46. Propiedades Se pueden utilizar propiedades internas project.ext { springVersion = ‘3.2.5.RELEASE’ } ! dependencies { compile testCompile } “org.springframework.security:spring-security-core:${springVersion}”, "org.springframework:spring-jdbc:${springVersion}", "org.springframework:spring-tx:${springVersion}" "junit:junit:4.5", “org.springframework:spring-test:${springVersion}” Se pueden utilizar propiedades externas version=0.1.0-SNAPSHOT springVersion=3.2.5.RELEASE sharedLocation=https://raw.github.com/autentia/common/
  • 47. Propiedades Se pueden utilizar propiedades internas project.ext { springVersion = ‘3.2.5.RELEASE’ } ! dependencies { compile testCompile } “org.springframework.security:spring-security-core:${springVersion}”, "org.springframework:spring-jdbc:${springVersion}", "org.springframework:spring-tx:${springVersion}" "junit:junit:4.5", “org.springframework:spring-test:${springVersion}” Se pueden utilizar propiedades externas gradle.properties version=0.1.0-SNAPSHOT springVersion=3.2.5.RELEASE sharedLocation=https://raw.github.com/autentia/common/
  • 48. Propiedades Se pueden utilizar propiedades internas project.ext { springVersion = ‘3.2.5.RELEASE’ } ! dependencies { compile testCompile } “org.springframework.security:spring-security-core:${springVersion}”, "org.springframework:spring-jdbc:${springVersion}", "org.springframework:spring-tx:${springVersion}" "junit:junit:4.5", “org.springframework:spring-test:${springVersion}” Se pueden utilizar propiedades externas gradle.properties version=0.1.0-SNAPSHOT springVersion=3.2.5.RELEASE sharedLocation=https://raw.github.com/autentia/common/ dependencies { compile testCompile } “org.springframework.security:spring-security-core:${springVersion}”, "org.springframework:spring-jdbc:${springVersion}", "org.springframework:spring-tx:${springVersion}" "junit:junit:4.5", “org.springframework:spring-test:${springVersion}”
  • 49. Propiedades Se pueden utilizar propiedades internas project.ext { springVersion = ‘3.2.5.RELEASE’ } ! dependencies { compile testCompile } “org.springframework.security:spring-security-core:${springVersion}”, "org.springframework:spring-jdbc:${springVersion}", "org.springframework:spring-tx:${springVersion}" "junit:junit:4.5", “org.springframework:spring-test:${springVersion}” Se pueden utilizar propiedades externas gradle.properties version=0.1.0-SNAPSHOT springVersion=3.2.5.RELEASE sharedLocation=https://raw.github.com/autentia/common/ dependencies { compile testCompile } build.gradle “org.springframework.security:spring-security-core:${springVersion}”, "org.springframework:spring-jdbc:${springVersion}", "org.springframework:spring-tx:${springVersion}" "junit:junit:4.5", “org.springframework:spring-test:${springVersion}”
  • 52. Gradle Wrapper task wrapper(type: Wrapper) { gradleVersion = '1.7' }
  • 53. Gradle Wrapper task wrapper(type: Wrapper) { gradleVersion = '1.7' $ gradle wrapper } :wrapper ! BUILD SUCCESSFUL ! Total time: 5.071 secs ! $ ls -l gradle/wrapper total 112 -rw-r--r-- 1 dgomezg staff 49875 Nov 20 16:53 gradle-wrapper.jar -rw-r--r-- 1 dgomezg staff 229 Nov 20 16:53 gradle-wrapper.properties $ ls gradle* gradle.properties gradlew gradlew.bat $ ./gradlew build :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :war UP-TO-DATE :assemble UP-TO-DATE :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE :check UP-TO-DATE :build UP-TO-DATE ! BUILD SUCCESSFUL ! Total time: 3.531 secs
  • 54. Convención flexible Se pueden adaptar las convenciones de estructura de proyecto
  • 55. Convención flexible Se pueden adaptar las convenciones de estructura de proyecto sourceSets { main { java { srcDirs = ['src'] } } test { java { srcDirs = ['test'] } } } buildDir = 'out'
  • 56. Convención flexible Se pueden adaptar las convenciones de estructura de proyecto sourceSets { main { java { srcDirs = ['src'] } } test { java { srcDirs = ['test'] } } } buildDir = 'out' compileJava { source 'src/protobuf/java' source 'src/main/java' }
  • 57. Reutilización Los archivos se pueden modularizar
  • 58. Reutilización Los archivos se pueden modularizar apply plugin: 'java' apply plugin: 'maven' apply plugin: 'eclipse' ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' ! sourceCompatibility = 1.6 ! repositories { //mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public' mavenCentral() mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone' mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/' } ! dependencies { compile testCompile } ! "org.springframework.security:spring-security-core:3.0.1.RELEASE", "org.springframework:spring-jdbc:3.0.0.RELEASE", "org.springframework:spring-tx:3.0.0.RELEASE" "junit:junit:4.5", "org.springframework:spring-test:3.0.0.RELEASE"
  • 59. Reutilización Los archivos se pueden modularizar apply plugin: 'java' apply plugin: 'maven' apply plugin: 'eclipse' project.gradle ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' ! sourceCompatibility = 1.6 ! repositories { //mavenRepo name: 'nexus', url: 'http://terraka:8080/nexus/content/repositories/public' mavenCentral() mavenRepo name: 'spring-milestones', url: 'http://maven.springframework.org/milestone' mavenRepo name: 'java.net', url: 'http://download.java.net/maven/2/' } ! dependencies { compile testCompile } ! "org.springframework.security:spring-security-core:3.0.1.RELEASE", "org.springframework:spring-jdbc:3.0.0.RELEASE", "org.springframework:spring-tx:3.0.0.RELEASE" "junit:junit:4.5", "org.springframework:spring-test:3.0.0.RELEASE"
  • 61. Reutilización Los archivos se pueden importar apply plugin: 'java' apply plugin: 'maven' apply plugin: 'eclipse' ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' ! sourceCompatibility = 1.6 ! repositories { } ! dependencies { }
  • 62. Reutilización Los archivos se pueden importar apply plugin: 'java' apply plugin: 'maven' apply plugin: 'eclipse' ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' ! sourceCompatibility = 1.6 ! repositories { } ! dependencies { } project.gradle
  • 63. Reutilización Los archivos se pueden importar apply plugin: 'java' apply plugin: 'maven' apply plugin: 'eclipse' project.gradle ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' ! sourceCompatibility = 1.6 ! repositories { apply from: ‘../autentia-common/project.gradle’ } ! ! dependencies { dependencies { compile } } testCompile "com.google.guava:guava:r05", "org.apache.commons:commons-lang3:3.1", "org.slf4j:slf4j-api:1.6.1", "ch.qos.logback:logback-classic:0.9.24", "org.springframework:spring-aop:$springVersion", "org.springframework:spring-beans:$springVersion", "org.springframework:spring-context:$springVersion", "org.springframework:spring-core:$springVersion", "org.springframework:spring-web:$springVersion", "org.springframework.data:spring-data-mongodb:1.0.1.RELEASE", "org.mongodb:mongo-java-driver:2.7.1" "org.mockito:mockito-core:1.8.5"
  • 64. Reutilización Los archivos se pueden importar apply plugin: 'java' apply plugin: 'maven' apply plugin: 'eclipse' project.gradle ! group = 'com.autentia.dgomezg.sandbox' archivesBaseName = 'gradle-sample' ! sourceCompatibility = 1.6 ! repositories { apply from: ‘../autentia-common/project.gradle’ } ! ! dependencies { dependencies { compile } } testCompile build.gradle "com.google.guava:guava:r05", "org.apache.commons:commons-lang3:3.1", "org.slf4j:slf4j-api:1.6.1", "ch.qos.logback:logback-classic:0.9.24", "org.springframework:spring-aop:$springVersion", "org.springframework:spring-beans:$springVersion", "org.springframework:spring-context:$springVersion", "org.springframework:spring-core:$springVersion", "org.springframework:spring-web:$springVersion", "org.springframework.data:spring-data-mongodb:1.0.1.RELEASE", "org.mongodb:mongo-java-driver:2.7.1" "org.mockito:mockito-core:1.8.5"
  • 65. Reutilización Los archivos se pueden compartir
  • 66. Reutilización Los archivos se pueden compartir version=0.1.0-SNAPSHOT springVersion=3.2.5.RELEASE sharedLocation=https://raw.github.com/autentia/common/ #commitId of the version to be used commonComponentsVersion=c7e2110511112c5055e0aaaa7db953b35129a95b
  • 67. Reutilización Los archivos se pueden compartir gradle.properties version=0.1.0-SNAPSHOT springVersion=3.2.5.RELEASE sharedLocation=https://raw.github.com/autentia/common/ #commitId of the version to be used commonComponentsVersion=c7e2110511112c5055e0aaaa7db953b35129a95b
  • 68. Reutilización Los archivos se pueden compartir gradle.properties version=0.1.0-SNAPSHOT springVersion=3.2.5.RELEASE sharedLocation=https://raw.github.com/autentia/common/ #commitId of the version to be used commonComponentsVersion=c7e2110511112c5055e0aaaa7db953b35129a95b apply from: ‘$sharedLocation/$commonComponentsVersion/autentia.gradle’ ! dependencies { compile testCompile } "com.google.guava:guava:r05", "org.apache.commons:commons-lang3:3.1", "org.slf4j:slf4j-api:1.6.1", "ch.qos.logback:logback-classic:0.9.24", "org.springframework:spring-aop:$springVersion", "org.springframework:spring-beans:$springVersion", "org.springframework:spring-context:$springVersion", "org.springframework:spring-core:$springVersion", "org.springframework:spring-web:$springVersion", "org.springframework.data:spring-data-mongodb:1.0.1.RELEASE", "org.mongodb:mongo-java-driver:2.7.1" "org.mockito:mockito-core:1.8.5"
  • 69. Reutilización Los archivos se pueden compartir gradle.properties version=0.1.0-SNAPSHOT springVersion=3.2.5.RELEASE sharedLocation=https://raw.github.com/autentia/common/ #commitId of the version to be used commonComponentsVersion=c7e2110511112c5055e0aaaa7db953b35129a95b apply from: ‘$sharedLocation/$commonComponentsVersion/autentia.gradle’ build.gradle ! dependencies { compile testCompile } "com.google.guava:guava:r05", "org.apache.commons:commons-lang3:3.1", "org.slf4j:slf4j-api:1.6.1", "ch.qos.logback:logback-classic:0.9.24", "org.springframework:spring-aop:$springVersion", "org.springframework:spring-beans:$springVersion", "org.springframework:spring-context:$springVersion", "org.springframework:spring-core:$springVersion", "org.springframework:spring-web:$springVersion", "org.springframework.data:spring-data-mongodb:1.0.1.RELEASE", "org.mongodb:mongo-java-driver:2.7.1" "org.mockito:mockito-core:1.8.5"
  • 70. Extensibilidad Podemos ampliar la funcionalidad fácilmente
  • 71. Extensibilidad Podemos ampliar la funcionalidad fácilmente task deployJetty(dependsOn: assertJettyHome) << { new File("$jettyHome/contexts/${webappName}.xml").write ( """<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <Set name="contextPath">/${webappName}</Set> <Set name="resourceBase">${projectDir}/src/main/webapp</Set> </Configure> """) } ! task undeployJetty(dependsOn: assertJettyHome) << { ant.delete file: "$jettyHome/contexts/${webappName}.xml" }
  • 72. Extensibilidad Podemos ampliar la funcionalidad fácilmente jetty.gradle task deployJetty(dependsOn: assertJettyHome) << { new File("$jettyHome/contexts/${webappName}.xml").write ( """<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <Set name="contextPath">/${webappName}</Set> <Set name="resourceBase">${projectDir}/src/main/webapp</Set> </Configure> """) } ! task undeployJetty(dependsOn: assertJettyHome) << { ant.delete file: "$jettyHome/contexts/${webappName}.xml" }
  • 73. Extensibilidad Podemos ampliar la funcionalidad fácilmente jetty.gradle task deployJetty(dependsOn: assertJettyHome) << { new File("$jettyHome/contexts/${webappName}.xml").write ( """<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <Set name="contextPath">/${webappName}</Set> <Set name="resourceBase">${projectDir}/src/main/webapp</Set> </Configure> """) } ! task undeployJetty(dependsOn: assertJettyHome) << { ant.delete file: "$jettyHome/contexts/${webappName}.xml" } apply from: ‘$sharedLocation/$commonComponentsVersion/jetty.gradle’ ! project.ext { webappName=gradle-sample jettyHome= System.getenv(“JETTY_HOME”); } …
  • 74. Extensibilidad Podemos ampliar la funcionalidad fácilmente jetty.gradle task deployJetty(dependsOn: assertJettyHome) << { new File("$jettyHome/contexts/${webappName}.xml").write ( """<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <Set name="contextPath">/${webappName}</Set> <Set name="resourceBase">${projectDir}/src/main/webapp</Set> </Configure> """) } ! task undeployJetty(dependsOn: assertJettyHome) << { ant.delete file: "$jettyHome/contexts/${webappName}.xml" } apply from: ‘$sharedLocation/$commonComponentsVersion/jetty.gradle’ ! project.ext { webappName=gradle-sample jettyHome= System.getenv(“JETTY_HOME”); } … build.gradle
  • 75. ‘Arquetipos’ Hay un proyecto de plugin que procura cubrir ese hueco: https://github.com/townsfolk/gradle-templates !
  • 76. ‘Arquetipos’ Hay un proyecto de plugin que procura cubrir ese hueco: https://github.com/townsfolk/gradle-templates apply from: 'http://www.tellurianring.com/projects/gradle-plugins/gradle-templates/1.3/apply.groovy' ! … !
  • 77. ‘Arquetipos’ Hay un proyecto de plugin que procura cubrir ese hueco: https://github.com/townsfolk/gradle-templates apply from: 'http://www.tellurianring.com/projects/gradle-plugins/gradle-templates/1.3/apply.groovy' ! ! … $ gradle tasks ! Template tasks -------------- createGradlePlugin - Creates a new Gradle Plugin project in a new directory named after your project. createGroovyClass - Creates a new Groovy class in the current project. createGroovyProject - Creates a new Gradle Groovy project in a new directory named after your project. createJavaClass - Creates a new Java class in the current project. createJavaProject - Creates a new Gradle Java project in a new directory named after your project. createScalaClass - Creates a new Scala class in the current project. createScalaObject - Creates a new Scala object in the current project. createScalaProject - Creates a new Gradle Scala project in a new directory named after your project. createWebappProject - Creates a new Gradle Webapp project in a new directory named after your project. exportAllTemplates - Exports all the default template files into the current directory. exportGroovyTemplates - Exports the default groovy template files into the current directory. exportJavaTemplates - Exports the default java template files into the current directory. exportPluginTemplates - Exports the default plugin template files into the current directory. exportScalaTemplates - Exports the default scala template files into the current directory. exportWebappTemplates - Exports the default webapp template files into the current directory. initGradlePlugin - Initializes a new Gradle Plugin project in the current directory. initGroovyProject - Initializes a new Gradle Groovy project in the current directory. initJavaProject - Initializes a new Gradle Java project in the current directory. initScalaProject - Initializes a new Gradle Scala project in the current directory. initWebappProject - Initializes a new Gradle Webapp project in the current directory.
  • 78. Y mucho más • Posibilidad de ejecutar gradle como demonio • Toda la potencia de un lenguaje para los scripts • Integración con sistemas de Integración Continua • Jenkins • ClinkerHQ • Consola
  • 79. Conclusiones • No más XML Oriented Programming • Concisión y legibilidad • Toda la potencia de las convenciones de maven • Integración con Ant • Gestor de dependencias • Flexibilidad de un lenguaje de programación • Modularización y reutilización