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?
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'
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”)
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.