4. @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.
6. @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.
7. CAN WE HAVE A
MAVEN-LIKE
STRUCTURE ON TOP
OF GRADLE?
17. @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'
20. @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”)
34. @aalmiray
BUILD-INFO
• The build-info plugin calculates build data such as
• Build date
• Build time
• Build creator
• SCM revision (git commit hash)
• Build JDK
• This information is used to enrich JAR manifests
41. @aalmiray
SOURCE-JAR
• Generates a JAR file with project sources.
• Adds the following tasks
• sourceJar
• artifact is automatically added for publication
• aggregateSourceJar
49. @aalmiray
LICENSE
• Configures license reports and file header formatting with
com.github.hierynomus.license
• Adds the following tasks
• aggregateLicenseReport
61. @aalmiray
PUBLISHING
• Configures publication of main artifact, including source,
javadoc, groovydoc, kotlindoc, scaladoc.
• Configures POM based on data from base & license plugins
• Artifacts may be optionally signed.
• Publication can be deployed to Maven compatible repositories.
63. @aalmiray
BINTRAY
• Configures publication to Bintray based on data provided by
base, license, and bintray DSL blocks.
• Can push automatically to Maven Central.
• Publishes all artifacts registered by publishing plugin.
64. @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
66. @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.
67. @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.
70. @aalmiray
X-RAY YOUR BUILDS
• Capture build data on the go.
• Analyze problems on the spot.
• Deep linking enables better sharing.
• Works for both Maven and Gradle.