SlideShare a Scribd company logo
Hacking Maven
how to add steroids on Maven
di Massimiliano Dessì
InseHacking Maven
2
Abstract
30 minutes to illustrate from 30000 ft
the ideas applied to turn Maven from a “static” producer
to a “rich” compiler enabled to reads objects
usually unacessible
InseHacking Maven
3
Speaker @desmax74
Massimiliano Dessì has more than 17 years of
experience in programming.
Manager of GDG Sardegna,
co-founder of Jug Sardegna.
Author of Spring 2.5 AOP.
He works as a Senior Software Engineer for
Red Hat in the
Business Systems and Intelligence Group
(aka KIE - Knowledge Is Everything),
he lives in Cagliari, Sardinia, Italy.
InseHacking Maven
4
https://maven.apache.org/what-is-maven.html
Starting point: Maven’s Objectives
InseHacking Maven
5
https://maven.apache.org/maven-features.html
Maven’s features
Pretty
boring
isn’t it ?
InseHacking Maven
6
Basically Maven produces artifacts on filesystem using plugins,
Jar,War, Ear, documentation, but basically is a “box” to product other files,
from Java multimodule projects.
In our group we using a plugin and a pipeline to process rules and other
projects managed by Drools/Optaplanner/JBPM to produce files ,
but are “dead” files, not a complete representation of a runtime objects.
Context
InseHacking Maven
7
Maven, the visible (and hated) part
InseHacking Maven
8
Embedding
Our first goal is to use Maven like a normal API,
Maven could be embedded in two ways using two libraries:
Maven Invoker, open a new process separated from the caller
https://maven.apache.org/plugins/maven-invoker-plugin/index.html
Maven Embedder, Works in the same process of the caller
https://maven.apache.org/ref/3.5.2/maven-embedder/index.html
this was our starting point
InseHacking Maven
9
Cloud
Openshift/Kubernetes
Containers
Fast as possible between builds
Live objects :)
Our New Requirements
InseHacking Maven
10
http://takari.io/
Let’s go to do something challenging
but first we want to optimize the time in front of Maven
enabling the incremental compiler called Takari
Every time a new project
is discovered
https://github.com/takari
InseHacking Maven
11
In our initial design we want to ask to Maven:
Result of the build
Output Log
Classloaders
Live objects
Live objects generated on the fly (no .class file)
then we will add other useful features
Request-Response behaviour
InseHacking Maven
12
Response contracts
InseHacking Maven
13
How to reach some of our goals ?
Since we want to add objects to the Maven “embedded” result
(a int to signal success or failure)
we use a pipeline of decorators to add behaviour before and after compilation
(we could add additional decorators to add behaviours)
Before to sync the project with the git origin repo because our project coming
from git and the changes are commited to be visible to other users
After to add the KieObjects readed from inside Maven, or to add the Maven
output if requested in the CompileRequest
InseHacking Maven
14
The hardest part
Maven is designed
to be extensible with plugins
for the processing
not for changes in its internals
But we are highly motivated :)
InseHacking Maven
15
Maven Internal component
Maven for its job use
Plexus/Eclipse Sisu and ClassWorlds
Plexus/Eclipse Sisu is a IoC container
Classworlds is used to manage the different
classloaders required
InseHacking Maven
16
Classloading
●
System Classloader
●
Core Classloader
●
Plugin Classloaders
●
Custom Classloaders
https://maven.apache.org/guides/mini/guide-maven-classloading.html
Classworlds is used to create this hierarchy
of classloader
InseHacking Maven
17
Classloading
This means that we need to find a way to move
the objects from an unaccessible (from outside) plugin classloader
We need a Charon/Caronte,
something able to move from one “world” to “another”
https://en.wikipedia.org/wiki/Charon_(mythology)
InseHacking Maven
18
We use a “Charon” object to enable the connection
between outside (our API) and inside Maven (the executed plugin),
in this way we are capable to read as a []bytes the live obejcts and move
from the internal classloader to our external classloader and use for our
needs.
In our implementation “Charon” works as a part of Maven
Trojans Horse https://it.wikipedia.org/wiki/Giandomenico_Tiepolo
InseHacking Maven
19
The implementation at the end is
●
Flexible
●
Extensible
●
Open to the changes
●
Could be changed on every request
●
Stateless
●
Ready for update Maven versions
the only informations retained are the links
between builders and projects associated
InseHacking Maven
20
Resources
https://github.com/desmax74
InseHacking Maven
21
Q & A
InseHacking Maven
22
Have fun !
and thanks for your attention !
Happy hacking

More Related Content

PDF
Docker and Puppet for Continuous Integration
PDF
Rise of the Machines - Automate your Development
ODP
DIY Java & Kubernetes
PDF
Elastic jenkins with mesos and dcos (2016 01-20)
PDF
Using Docker and Elastic Beanstalk in Production
PDF
OSDC 2017 - Julien Pivotto - Automating Jenkins
ODP
Setting up and open fidy dev environment
PDF
SaltStack's NetAPI at Photobucket - Denver SaltStack Meetup
Docker and Puppet for Continuous Integration
Rise of the Machines - Automate your Development
DIY Java & Kubernetes
Elastic jenkins with mesos and dcos (2016 01-20)
Using Docker and Elastic Beanstalk in Production
OSDC 2017 - Julien Pivotto - Automating Jenkins
Setting up and open fidy dev environment
SaltStack's NetAPI at Photobucket - Denver SaltStack Meetup

What's hot (20)

PDF
OpenStack Upstream Training Cisco Live!
PPT
Jenkins on Docker
PPTX
PPTX
Vagrant introduction for Developers
ODP
Apache jclouds SF Meetup, July 8, 2013
PDF
Azure workshop
ODP
Jenkins and rails app - Le Dinh Vu
PDF
Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019
PPTX
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
PPT
Jenkins Scriptler in 90mins
PPTX
Jenkins and AWS DevOps Tools
PDF
Install Concourse CI with BOSH
PPTX
Automating MySQL Deployments on Kubernetes
PDF
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
PDF
Continuous Updating with VersionEye at code.talks 2014
PDF
Server(less) Swift at SwiftCloudWorkshop 3
ZIP
Deploying Rails applications with Moonshine
PDF
Spring Boot 1.3 News #渋谷Java
PDF
Atmosphere Conference 2015: Do you think you're doing microservices?
PPTX
A taste for aether
OpenStack Upstream Training Cisco Live!
Jenkins on Docker
Vagrant introduction for Developers
Apache jclouds SF Meetup, July 8, 2013
Azure workshop
Jenkins and rails app - Le Dinh Vu
Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Jenkins Scriptler in 90mins
Jenkins and AWS DevOps Tools
Install Concourse CI with BOSH
Automating MySQL Deployments on Kubernetes
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Continuous Updating with VersionEye at code.talks 2014
Server(less) Swift at SwiftCloudWorkshop 3
Deploying Rails applications with Moonshine
Spring Boot 1.3 News #渋谷Java
Atmosphere Conference 2015: Do you think you're doing microservices?
A taste for aether

Similar to Hacking Maven Linux day 2017 (20)

PDF
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
PPTX
S/W Design and Modularity using Maven
PPTX
An Introduction to Maven
PDF
Introducing Maven 1st Edition Balaji Varanasi Sudha Belida Auth
PDF
Intelligent Projects with Maven - DevFest Istanbul
PPTX
Introduction to Maven
PDF
BMO - Intelligent Projects with Maven
PPTX
Introduction to Maven for beginners and DevOps
PPTX
Introduction to maven
PDF
Java Builds with Maven and Ant
PPTX
Java build tools
PPT
Introduction tomaven
PPTX
Ci jenkins maven svn
PPTX
Maven ppt
PDF
Lorraine JUG (1st June, 2010) - Maven
PPTX
Apache Maven
PDF
Apache Maven - eXo TN presentation
PDF
Apache Maven In 10 Slides
PDF
Introduction to project industrialization with Maven 2
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
S/W Design and Modularity using Maven
An Introduction to Maven
Introducing Maven 1st Edition Balaji Varanasi Sudha Belida Auth
Intelligent Projects with Maven - DevFest Istanbul
Introduction to Maven
BMO - Intelligent Projects with Maven
Introduction to Maven for beginners and DevOps
Introduction to maven
Java Builds with Maven and Ant
Java build tools
Introduction tomaven
Ci jenkins maven svn
Maven ppt
Lorraine JUG (1st June, 2010) - Maven
Apache Maven
Apache Maven - eXo TN presentation
Apache Maven In 10 Slides
Introduction to project industrialization with Maven 2

More from Massimiliano Dessì (20)

PDF
Code One 2018 maven
PDF
Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome
PDF
Dessi docker kubernetes paas cloud
PDF
Docker dDessi november 2015
PDF
Docker linuxday 2015
PDF
Openshift linuxday 2014
PDF
Web Marketing Training 2014 Community Online
PDF
Vert.X like Node.js but polyglot and reactive on JVM
PDF
Reactive applications Linux Day 2013
PDF
Scala Italy 2013 extended Scalatra vs Spring MVC
PDF
Codemotion 2013 scalatra_play_spray
ODP
Why we cannot ignore functional programming
PDF
Scala linux day 2012
PDF
Three languages in thirty minutes
PDF
MongoDB dessi-codemotion
PDF
MongoDB Webtech conference 2010
PDF
PDF
Spring Roo Internals Javaday IV
PDF
Spring Roo JaxItalia09
PDF
Jaxitalia09 Spring Best Practices
Code One 2018 maven
Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome
Dessi docker kubernetes paas cloud
Docker dDessi november 2015
Docker linuxday 2015
Openshift linuxday 2014
Web Marketing Training 2014 Community Online
Vert.X like Node.js but polyglot and reactive on JVM
Reactive applications Linux Day 2013
Scala Italy 2013 extended Scalatra vs Spring MVC
Codemotion 2013 scalatra_play_spray
Why we cannot ignore functional programming
Scala linux day 2012
Three languages in thirty minutes
MongoDB dessi-codemotion
MongoDB Webtech conference 2010
Spring Roo Internals Javaday IV
Spring Roo JaxItalia09
Jaxitalia09 Spring Best Practices

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
KodekX | Application Modernization Development
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Electronic commerce courselecture one. Pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25 Week I
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MIND Revenue Release Quarter 2 2025 Press Release
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
KodekX | Application Modernization Development
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Electronic commerce courselecture one. Pdf
Understanding_Digital_Forensics_Presentation.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
Programs and apps: productivity, graphics, security and other tools
Building Integrated photovoltaic BIPV_UPV.pdf

Hacking Maven Linux day 2017