SlideShare una empresa de Scribd logo
1 de 39
Descargar para leer sin conexión
CREATING
BETTER BUILDS
WITH GRADLE
ANDRES ALMIRAY
@AALMIRAY
@aalmiray
HTTP://BIT.LY/KORDAMP-WORKSHOP
@aalmiray
@aalmiray
POM.XML
• POM stands for Project Object Model.
• A POM file defines both how a project should be built and how
consumers may interact with the published artifacts.
• Maven delivers lots of features out of the box thanks to the
hierarchical nature of the POM.
• The Maven Super POM provides default configuration for
common plugins such as compiler, resources, surefire, etc.
• The strict nature of the structure found in the POM allows
anyone to understand the configuration.
@aalmiray
@aalmiray
BUILD.GRADLE
• Gradle build files only specify how projects should be built.
• The definition for consumers is delivered through a generated
POM file.
• Gradle builds are highly customizable, resulting in a wider
range of build patterns.


CAN WE HAVE A
MAVEN-LIKE
STRUCTURE ON TOP
OF GRADLE?






HTTP://GITHUB.COM/AALMIRAY/KORDAMP-GRADLE-PLUGINS







HTTPS://AALMIRAY.GITHUB.IO/KORDAMP-GRADLE-PLUGINS
FILE

STRUCTURE
@aalmiray
STANDARD (MAVEN)
.
!"" pom.xml
!"" guide
#   $"" pom.xml
!"" project1
#   $"" pom.xml
$"" project2
    $"" pom.xml
@aalmiray
STANDARD (MAVEN)
<project>
  <groupId>com.acme</groupId>
  <artifactId>parent</artifactId>
  <version>0.0.0</version>
  <modules>
    <module>guide</module>
    <module>project1</module>
    <module>project2</module>
  </modules>
</project>
<project>
  <parent>
    <groupId>com.acme</groupId>
    <artifactId>parent</
artifactId>
    <version>0.0.0</version>
  </parent>
</project>
@aalmiray
TWO-LEVEL (MAVEN)
.
!"" pom.xml
!"" docs
#   $"" guide
#       $"" pom.xml
$"" subprojects
    !"" project1
    #   $"" pom.xml
    $"" project2
        $"" pom.xml
@aalmiray
TWO-LEVEL (MAVEN)
<project>
  <groupId>com.acme</groupId>
  <artifactId>parent</artifactId>
  <version>0.0.0</version>
  <modules>
    <module>docs/guide</module>
    <module>subprojects/project2</module>
    <module>subprojects/project3</module>
  </modules>
</project>
<project>
  <parent>
    <groupId>com.acme</groupId>
    <artifactId>parent</
artifactId>
    <version>0.0.0</version>
<path>../../pom.xml</path>
  </parent>
</project>
@aalmiray
MULTI-LEVEL (MAVEN)
.
!"" pom.xml
!"" guide
#   $"" pom.xml
$"" subprojects
    !"" project1
    #   $"" pom.xml
    $"" project2
        $"" pom.xml
@aalmiray
MULTI-LEVEL (MAVEN)
<project>
  <groupId>com.acme</groupId>
  <artifactId>parent</artifactId>
  <version>0.0.0</version>
  <modules>
    <module>project1</module>
    <module>subprojects/project2</module>
    <module>subprojects/project3</module>
  </modules>
</project>
<project>
  <parent>
    <groupId>com.acme</groupId>
    <artifactId>parent</artifactId>
    <version>0.0.0</version>
  </parent>
</project>
<project>
  <parent>
    <groupId>com.acme</groupId>
    <artifactId>parent</artifactId>
    <version>0.0.0</version>
<path>../../pom.xml</path>
  </parent>
</project>
@aalmiray
STANDARD (GRADLE)
.
!"" build.gradle
!"" guide
#   $"" build.gradle
!"" project1
#   $"" build.gradle
!"" project2
#   $"" build.gradle
$"" settings.gradle
.
!"" build.gradle
!"" guide
#   $"" guide.gradle
!"" project1
#   $"" project1.gradle
!"" project2
#   $"" project2.gradle
$"" settings.gradle
@aalmiray
STANDARD (GRADLE)
$ cat settings.gradle
include 'guide'
include 'project1'
include 'project2'
$ cat settings.gradle
include 'guide'
include 'project1'
include 'project2’
project(':guide').buildFileName =
'guide.gradle'
project(':project1').buildFileName
=
'project1.gradle'
project(':project2').buildFileName
=
'project2.gradle'
@aalmiray
STANDARD (GRADLE)
$ cat settings.gradle
buildscript {

repositories {

gradlePluginPortal()

}

dependencies {

classpath ‘org.kordamp.gradle:settings-gradle-plugin:0.27.0

}

}


apply plugin: 'org.kordamp.gradle.settings'



projects {

layout = 'standard'

}
@aalmiray
TWO-LEVEL (GRADLE)
.
!"" build.gradle
!"" docs
#   $"" guide
#       $"" build.gradle
$"" subprojects
    !"" project1
    #   $"" build.gradle
    $"" project2
        $"" build.gradle
.
!"" build.gradle
!"" docs
#   $"" guide
#       $"" guide.gradle
$"" subprojects
    !"" project1
    #   $"" project1.gradle
    $"" project2
        $"" project2.gradle
@aalmiray
TWO-LEVEL (GRADLE)
$ cat settings.gradle
include 'guide'
include 'project1'
include 'project2'
project(':guide').projectDir =
new File(“$settingsDir/docs/guide”)
project(':project1').projectDir =
new File(“$settingsDir/subprojects/project1”)
project(':project2').projectDir =
new File(“$settingsDir/subprojects/project2”)
@aalmiray
TWO-LEVEL (GRADLE)
$ cat settings.gradle
buildscript {

repositories {

gradlePluginPortal()

}

dependencies {

classpath ‘org.kordamp.gradle:settings-gradle-plugin:0.27.0

}

}


apply plugin: 'org.kordamp.gradle.settings'



projects {

layout = 'two-level'
directories = ['docs', 'subprojects']

}
@aalmiray
MULTI-LEVEL (GRADLE)
.
!"" build.gradle
!"" guide
#   $"" build.gradle
$"" subprojects
    !"" project1
    #   $"" build.gradle
    $"" project2
        $"" build.gradle
.
!"" build.gradle
!"" guide
#   $"" guide.gradle
$"" subprojects
    !"" project1
    #   $"" project1.gradle
    $"" project2
        $"" project2.gradle
@aalmiray
MULTI-LEVEL (GRADLE)
$ cat settings.gradle
buildscript {

repositories {

gradlePluginPortal()

}

dependencies {

classpath ‘org.kordamp.gradle:settings-gradle-plugin:0.27.0

}

}


apply plugin: 'org.kordamp.gradle.settings'



projects {

layout = 'multi-level'

directories = [

'guide',

'subprojects/project1',

'subprojects/project2'

]

}
LAB 01



01-PROJECT-LAYOUT


PROJECT
DSL
@aalmiray
THE PROJECT PLUGIN
plugins {

id 'org.kordamp.gradle.project' version ‘0.27.0’
}



config {

release = (rootProject.findProperty('release') ?: false).toBoolean()



info {

name = 'Sample'

vendor = 'Acme'

description = 'Sample project'



links {

website = 'https://github.com/joecool/sample'

issueTracker = 'https://github.com/joecool/sample/issues'

scm = 'https://github.com/joecool/sample.git'

}



people {

person {

id = 'joecool'

name = 'Joe Cool'

roles = ['developer']

}

}

}
…
}
@aalmiray
PROVIDED BEHAVIOR
• The project plugin applies the following plugins
• org.kordamp.gradle.base
• org.kordamp.gradle.build-info
• org.kordamp.gradle.minpom
• org.kordamp.gradle.jar
• org.kordamp.gradle.source-jar
• org.kordamp.gradle.javadoc
• org.kordamp.gradle.license
• org.kordamp.gradle.jacoco
• org.kordamp.gradle.publishing
• org.kordamp.gradle.testing
• org.kordamp.gradle.apidoc
• org.kordamp.gradle.source-stats
• org.kordamp.gradle.source-html
• org.kordamp.gradle.bintray
LAB 02



02-PROJECT-INSIGHT
@aalmiray
ADDITIONAL PLUGINS
• The following plugins can be applied explicitly
• org.kordamp.gradle.kotlindoc
• org.kordamp.gradle.scaladoc
• org.kordamp.gradle.source-xref
• org.kordamp.gradle.bom
• org.kordamp.gradle.clirr
• org.kordamp.gradle.guide
• org.kordamp.gradle.integration-test
• org.kordamp.gradle.functional-test
LAB 03



03-PROJECT-TESTING
SUPER POM
@aalmiray
THE MAVEN SUPER POM
• POMs are hierarchical.
• The chain resolves all the way to the top where you find the
Maven Super POM.
• Super POM configures lots of default & useful behavior.
@aalmiray
THE GRADLE SUPER POM
• Gradle does not offer this behavior out of the box.
• But it can be “faked” using a custom plugin.
• The plugin applies the default behavior that consuming projects
require.
LAB 04



04-PARENT-POM
@aalmiray
@aalmiray
HTTP://ANDRESALMIRAY.COM/NEWSLETTER





HTTP://ANDRESALMIRAY.COM/EDITORIAL
@aalmiray
THANK YOU!
ANDRES ALMIRAY
@AALMIRAY

Más contenido relacionado

La actualidad más candente

Laravel introduction
Laravel introductionLaravel introduction
Laravel introductionSimon Funk
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBob Paulin
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$Joe Ferguson
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Dilouar Hossain
 
Introduction in the play framework
Introduction in the play frameworkIntroduction in the play framework
Introduction in the play frameworkAlexander Reelsen
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Saeed Zarinfam
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The BasicsPhilip Langer
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play FrameworkWarren Zhou
 
CollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesCollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesJesse Gallagher
 
Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsSam Dias
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingRami Sayar
 
Play Framework workshop: full stack java web app
Play Framework workshop: full stack java web appPlay Framework workshop: full stack java web app
Play Framework workshop: full stack java web appAndrew Skiba
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemRami Sayar
 

La actualidad más candente (20)

Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Maven
Maven Maven
Maven
 
Coding Your Way to Java 12
Coding Your Way to Java 12Coding Your Way to Java 12
Coding Your Way to Java 12
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
Maven
MavenMaven
Maven
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Introduction in the play framework
Introduction in the play frameworkIntroduction in the play framework
Introduction in the play framework
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
 
Apache Maven In 10 Slides
Apache Maven In 10 SlidesApache Maven In 10 Slides
Apache Maven In 10 Slides
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play Framework
 
Maven tutorial for beginners
Maven tutorial for beginnersMaven tutorial for beginners
Maven tutorial for beginners
 
CollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesCollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPages
 
Laravel
LaravelLaravel
Laravel
 
Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 Projects
 
Intro to Laravel
Intro to LaravelIntro to Laravel
Intro to Laravel
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript Debugging
 
Play Framework workshop: full stack java web app
Play Framework workshop: full stack java web appPlay Framework workshop: full stack java web app
Play Framework workshop: full stack java web app
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
 

Similar a Creating Better Builds with Gradle

Andres Almiray - Gradle Ex Machina - Codemotion Rome 2019
Andres Almiray - Gradle Ex Machina - Codemotion Rome 2019Andres Almiray - Gradle Ex Machina - Codemotion Rome 2019
Andres Almiray - Gradle Ex Machina - Codemotion Rome 2019Codemotion
 
Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Andres Almiray
 
Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Andres Almiray
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forCorneil du Plessis
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolvedBhagwat Kumar
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.Fabio Milano
 
Gigigo Workshop - Create an iOS Framework, document it and not die trying
Gigigo Workshop - Create an iOS Framework, document it and not die tryingGigigo Workshop - Create an iOS Framework, document it and not die trying
Gigigo Workshop - Create an iOS Framework, document it and not die tryingAlex Rupérez
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in MuleShahid Shaik
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Corneil du Plessis
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style GuidesAdvanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style GuidesAidan Foster
 
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
 
Introduction to web components
Introduction to web componentsIntroduction to web components
Introduction to web componentsMarc Bächinger
 

Similar a Creating Better Builds with Gradle (20)

Andres Almiray - Gradle Ex Machina - Codemotion Rome 2019
Andres Almiray - Gradle Ex Machina - Codemotion Rome 2019Andres Almiray - Gradle Ex Machina - Codemotion Rome 2019
Andres Almiray - Gradle Ex Machina - Codemotion Rome 2019
 
Gradle ex-machina
Gradle ex-machinaGradle ex-machina
Gradle ex-machina
 
Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster
 
Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
 
Slim3 quick start
Slim3 quick startSlim3 quick start
Slim3 quick start
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Gigigo Workshop - Create an iOS Framework, document it and not die trying
Gigigo Workshop - Create an iOS Framework, document it and not die tryingGigigo Workshop - Create an iOS Framework, document it and not die trying
Gigigo Workshop - Create an iOS Framework, document it and not die trying
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Maven
MavenMaven
Maven
 
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style GuidesAdvanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
 
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]
 
Introduction to web components
Introduction to web componentsIntroduction to web components
Introduction to web components
 

Más de Andres Almiray

Creando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoCreando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoAndres Almiray
 
Liberando a produccion con confianza
Liberando a produccion con confianzaLiberando a produccion con confianza
Liberando a produccion con confianzaAndres Almiray
 
Liberando a produccion con confidencia
Liberando a produccion con confidenciaLiberando a produccion con confidencia
Liberando a produccion con confidenciaAndres Almiray
 
OracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersOracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersAndres Almiray
 
Softcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersSoftcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersAndres Almiray
 
Oracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersOracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersAndres Almiray
 
JReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightJReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightAndres Almiray
 
Going Reactive with g rpc
Going Reactive with g rpcGoing Reactive with g rpc
Going Reactive with g rpcAndres Almiray
 
What I wish I knew about Maven years ago
What I wish I knew about Maven years agoWhat I wish I knew about Maven years ago
What I wish I knew about Maven years agoAndres Almiray
 
The impact of sci fi in tech
The impact of sci fi in techThe impact of sci fi in tech
The impact of sci fi in techAndres Almiray
 
Interacting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleInteracting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleAndres Almiray
 
Going Reactive with gRPC
Going Reactive with gRPCGoing Reactive with gRPC
Going Reactive with gRPCAndres Almiray
 
Understanding Reactive Programming
Understanding Reactive ProgrammingUnderstanding Reactive Programming
Understanding Reactive ProgrammingAndres Almiray
 
L2C Benchmarks, or how I learned to stop worrying and love JMH
L2C Benchmarks, or how I learned to stop worrying and love JMHL2C Benchmarks, or how I learned to stop worrying and love JMH
L2C Benchmarks, or how I learned to stop worrying and love JMHAndres Almiray
 

Más de Andres Almiray (20)

Creando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoCreando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abierto
 
Liberando a produccion con confianza
Liberando a produccion con confianzaLiberando a produccion con confianza
Liberando a produccion con confianza
 
Liberando a produccion con confidencia
Liberando a produccion con confidenciaLiberando a produccion con confidencia
Liberando a produccion con confidencia
 
OracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersOracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java Developers
 
Softcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersSoftcon.ph - Maven Puzzlers
Softcon.ph - Maven Puzzlers
 
Maven Puzzlers
Maven PuzzlersMaven Puzzlers
Maven Puzzlers
 
Oracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersOracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java Developers
 
JReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightJReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of light
 
Going Reactive with g rpc
Going Reactive with g rpcGoing Reactive with g rpc
Going Reactive with g rpc
 
What I wish I knew about Maven years ago
What I wish I knew about Maven years agoWhat I wish I knew about Maven years ago
What I wish I knew about Maven years ago
 
The impact of sci fi in tech
The impact of sci fi in techThe impact of sci fi in tech
The impact of sci fi in tech
 
Interacting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleInteracting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with Gradle
 
Go Java, Go!
Go Java, Go!Go Java, Go!
Go Java, Go!
 
Going Reactive with gRPC
Going Reactive with gRPCGoing Reactive with gRPC
Going Reactive with gRPC
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
 
Understanding Reactive Programming
Understanding Reactive ProgrammingUnderstanding Reactive Programming
Understanding Reactive Programming
 
Spock's New Tricks
Spock's New TricksSpock's New Tricks
Spock's New Tricks
 
Go Java, Go!
Go Java, Go!Go Java, Go!
Go Java, Go!
 
Go Java, Go!
Go Java, Go!Go Java, Go!
Go Java, Go!
 
L2C Benchmarks, or how I learned to stop worrying and love JMH
L2C Benchmarks, or how I learned to stop worrying and love JMHL2C Benchmarks, or how I learned to stop worrying and love JMH
L2C Benchmarks, or how I learned to stop worrying and love JMH
 

Último

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

Creating Better Builds with Gradle

  • 5. @aalmiray POM.XML • POM stands for Project Object Model. • A POM file defines both how a project should be built and how consumers may interact with the published artifacts. • Maven delivers lots of features out of the box thanks to the hierarchical nature of the POM. • The Maven Super POM provides default configuration for common plugins such as compiler, resources, surefire, etc. • The strict nature of the structure found in the POM allows anyone to understand the configuration.
  • 7. @aalmiray BUILD.GRADLE • Gradle build files only specify how projects should be built. • The definition for consumers is delivered through a generated POM file. • Gradle builds are highly customizable, resulting in a wider range of build patterns.
  • 8. 
 CAN WE HAVE A MAVEN-LIKE STRUCTURE ON TOP OF GRADLE?
  • 11. @aalmiray STANDARD (MAVEN) . !"" pom.xml !"" guide #   $"" pom.xml !"" project1 #   $"" pom.xml $"" project2     $"" pom.xml
  • 12. @aalmiray STANDARD (MAVEN) <project>   <groupId>com.acme</groupId>   <artifactId>parent</artifactId>   <version>0.0.0</version>   <modules>     <module>guide</module>     <module>project1</module>     <module>project2</module>   </modules> </project> <project>   <parent>     <groupId>com.acme</groupId>     <artifactId>parent</ artifactId>     <version>0.0.0</version>   </parent> </project>
  • 13. @aalmiray TWO-LEVEL (MAVEN) . !"" pom.xml !"" docs #   $"" guide #       $"" pom.xml $"" subprojects     !"" project1     #   $"" pom.xml     $"" project2         $"" pom.xml
  • 14. @aalmiray TWO-LEVEL (MAVEN) <project>   <groupId>com.acme</groupId>   <artifactId>parent</artifactId>   <version>0.0.0</version>   <modules>     <module>docs/guide</module>     <module>subprojects/project2</module>     <module>subprojects/project3</module>   </modules> </project> <project>   <parent>     <groupId>com.acme</groupId>     <artifactId>parent</ artifactId>     <version>0.0.0</version> <path>../../pom.xml</path>   </parent> </project>
  • 15. @aalmiray MULTI-LEVEL (MAVEN) . !"" pom.xml !"" guide #   $"" pom.xml $"" subprojects     !"" project1     #   $"" pom.xml     $"" project2         $"" pom.xml
  • 16. @aalmiray MULTI-LEVEL (MAVEN) <project>   <groupId>com.acme</groupId>   <artifactId>parent</artifactId>   <version>0.0.0</version>   <modules>     <module>project1</module>     <module>subprojects/project2</module>     <module>subprojects/project3</module>   </modules> </project> <project>   <parent>     <groupId>com.acme</groupId>     <artifactId>parent</artifactId>     <version>0.0.0</version>   </parent> </project> <project>   <parent>     <groupId>com.acme</groupId>     <artifactId>parent</artifactId>     <version>0.0.0</version> <path>../../pom.xml</path>   </parent> </project>
  • 17. @aalmiray STANDARD (GRADLE) . !"" build.gradle !"" guide #   $"" build.gradle !"" project1 #   $"" build.gradle !"" project2 #   $"" build.gradle $"" settings.gradle . !"" build.gradle !"" guide #   $"" guide.gradle !"" project1 #   $"" project1.gradle !"" project2 #   $"" project2.gradle $"" settings.gradle
  • 18. @aalmiray STANDARD (GRADLE) $ cat settings.gradle include 'guide' include 'project1' include 'project2' $ cat settings.gradle include 'guide' include 'project1' include 'project2’ project(':guide').buildFileName = 'guide.gradle' project(':project1').buildFileName = 'project1.gradle' project(':project2').buildFileName = 'project2.gradle'
  • 19. @aalmiray STANDARD (GRADLE) $ cat settings.gradle buildscript {
 repositories {
 gradlePluginPortal()
 }
 dependencies {
 classpath ‘org.kordamp.gradle:settings-gradle-plugin:0.27.0
 }
 } 
 apply plugin: 'org.kordamp.gradle.settings'
 
 projects {
 layout = 'standard'
 }
  • 20. @aalmiray TWO-LEVEL (GRADLE) . !"" build.gradle !"" docs #   $"" guide #       $"" build.gradle $"" subprojects     !"" project1     #   $"" build.gradle     $"" project2         $"" build.gradle . !"" build.gradle !"" docs #   $"" guide #       $"" guide.gradle $"" subprojects     !"" project1     #   $"" project1.gradle     $"" project2         $"" project2.gradle
  • 21. @aalmiray TWO-LEVEL (GRADLE) $ cat settings.gradle include 'guide' include 'project1' include 'project2' project(':guide').projectDir = new File(“$settingsDir/docs/guide”) project(':project1').projectDir = new File(“$settingsDir/subprojects/project1”) project(':project2').projectDir = new File(“$settingsDir/subprojects/project2”)
  • 22. @aalmiray TWO-LEVEL (GRADLE) $ cat settings.gradle buildscript {
 repositories {
 gradlePluginPortal()
 }
 dependencies {
 classpath ‘org.kordamp.gradle:settings-gradle-plugin:0.27.0
 }
 } 
 apply plugin: 'org.kordamp.gradle.settings'
 
 projects {
 layout = 'two-level' directories = ['docs', 'subprojects']
 }
  • 23. @aalmiray MULTI-LEVEL (GRADLE) . !"" build.gradle !"" guide #   $"" build.gradle $"" subprojects     !"" project1     #   $"" build.gradle     $"" project2         $"" build.gradle . !"" build.gradle !"" guide #   $"" guide.gradle $"" subprojects     !"" project1     #   $"" project1.gradle     $"" project2         $"" project2.gradle
  • 24. @aalmiray MULTI-LEVEL (GRADLE) $ cat settings.gradle buildscript {
 repositories {
 gradlePluginPortal()
 }
 dependencies {
 classpath ‘org.kordamp.gradle:settings-gradle-plugin:0.27.0
 }
 } 
 apply plugin: 'org.kordamp.gradle.settings'
 
 projects {
 layout = 'multi-level'
 directories = [
 'guide',
 'subprojects/project1',
 'subprojects/project2'
 ]
 }
  • 27. @aalmiray THE PROJECT PLUGIN plugins {
 id 'org.kordamp.gradle.project' version ‘0.27.0’ }
 
 config {
 release = (rootProject.findProperty('release') ?: false).toBoolean()
 
 info {
 name = 'Sample'
 vendor = 'Acme'
 description = 'Sample project'
 
 links {
 website = 'https://github.com/joecool/sample'
 issueTracker = 'https://github.com/joecool/sample/issues'
 scm = 'https://github.com/joecool/sample.git'
 }
 
 people {
 person {
 id = 'joecool'
 name = 'Joe Cool'
 roles = ['developer']
 }
 }
 } … }
  • 28. @aalmiray PROVIDED BEHAVIOR • The project plugin applies the following plugins • org.kordamp.gradle.base • org.kordamp.gradle.build-info • org.kordamp.gradle.minpom • org.kordamp.gradle.jar • org.kordamp.gradle.source-jar • org.kordamp.gradle.javadoc • org.kordamp.gradle.license • org.kordamp.gradle.jacoco • org.kordamp.gradle.publishing • org.kordamp.gradle.testing • org.kordamp.gradle.apidoc • org.kordamp.gradle.source-stats • org.kordamp.gradle.source-html • org.kordamp.gradle.bintray
  • 30. @aalmiray ADDITIONAL PLUGINS • The following plugins can be applied explicitly • org.kordamp.gradle.kotlindoc • org.kordamp.gradle.scaladoc • org.kordamp.gradle.source-xref • org.kordamp.gradle.bom • org.kordamp.gradle.clirr • org.kordamp.gradle.guide • org.kordamp.gradle.integration-test • org.kordamp.gradle.functional-test
  • 33. @aalmiray THE MAVEN SUPER POM • POMs are hierarchical. • The chain resolves all the way to the top where you find the Maven Super POM. • Super POM configures lots of default & useful behavior.
  • 34. @aalmiray THE GRADLE SUPER POM • Gradle does not offer this behavior out of the box. • But it can be “faked” using a custom plugin. • The plugin applies the default behavior that consuming projects require.