SlideShare une entreprise Scribd logo
1  sur  45
BROKEN BUILDTOOLS
AND BAD HABITS
THE MAVEN STORIES
Robert Scholte ( @rfscholte )
Comair Flight 3272
Date January 9, 1997
Location 18 miles (29 km) southwest of Detroit
Metropolitan Wayne County Airport
Fatalities 26 passengers + 3 crewmembers
Summary Atmospheric icing and pilot error
leading to loss of control.
Probable Cause
“…This was because the Comair Flight manual
recommendation was in contravention of the
manufacturers due to a concern over "bridging",
a concern held-over from older planes that was
no longer valid on newer generation planes like
the Embraer 120.”
Probable Cause
“…This was because the Comair Flight manual
recommendation was in contravention of the
manufacturers due to a concern over "bridging",
a concern held-over from older planes that was
no longer valid on newer generation planes
like the Embraer 120.”
WE FACE
SIMILAR
ISSUES...
When
learning
new
things…
Analysis
Google /
Stackoverflow
Colleagues
When
things
start to
fail…
Analysis
Google / Stackoverflow
Colleagues
Fix or workaround (but for
how long…)
But do
we keep
up?
WORKAROUND
STURN INTO
PATTERNS
PATTERNS
CONTROL
PEOPLES
SYSTEM
Broken build or
broken tools?
“… but it works on my machine”
CI server is your neutral judge
Builds of Maven subprojects at ASF
JDK 7 JDK 8 JDK 11 JDK 12 JDK 13-ea
V V V V V
JDK 7 JDK 8 JDK 11 JDK 12 JDK 13-ea
Maven 3.0.5 V
Maven 3.2.5 V
Maven 3.3.9 V
Maven 3.5.2 V
Maven 3.6.1 V V V V V
Frameworks /Libraries
Plugins / Extensions
Operation Systems: Ubuntu + Windows
“Works on my machine”
Differences in:
- (local code changes)
- OS
- JDK
- Maven
- Files (Regular/Directories)
- Properties (System/Environment)
Analysis
Options Description
-v,--version Display version information
-V,--show-version Display version information WITHOUT
stopping build
-e,--errors Produce execution error messages
-X,--debug Produce execution debug output
“Works on my machine”
Differences in:
- OS
- JDK
- Maven
- Files (Regular/Directories)
- Properties (System/Environment)
Local Repository
Dependency cache
without time-to-live (TTL)
${user.home}/.m2/repository
Local Repository “Broken”(1)
 Maven 2: dumb cache
 Maven 3: cached artifacts verified for existence with
_remote.repositories
Options Description
-llr,--legacy-local-
repository
Use Maven 2 Legacy Local Repository behavior, i.e. no
use of _remote.repositories.
Can also be activated by using
-Dmaven.legacyLocalRepo=true
Local Repository “Broken”(2)
■ Maven was written for single user
■ CI server can be considered multi user
– Corrupt files due to concurrent writes/reads
■ Solution:
– Takari Concurrent Local Repository
Local Repository “Broken”(3)
■ Checksums are NOT verified by default, repository managers (should) do
■ Set checksumPolicy per repository
■ Future solutions:
– Enable by default
Options Description
-C,--strict-checksums Fail the build if checksums don't match
-c,--lax-checksums Warn if checksums don't match
Local Repository “Broken”(4)
■ Maven 2+3: single directory
– Difficult to maintain
■ Future solutions:
– separate SNAPSHOT directory?
– directory per remote repository?
Local
Repository
Pollution
“Environmental pollution
is caused by …”
“Man must understand its
actions”
MVN INSTALL
Dependency
Resolution “Broken”
Maven 2:
- Not aware of ‘reactor’
- Dependencies had to exist in
local repo.
Maven 3:
- ‘reactor’ aware
- No need for ‘install’ anymore
Verifying lib with app
app-1.0-SNAPSHOT
lib-2.1-SNAPSHOT
• Classic solution
1. Lib > mvn install
2. App > mvn verify
• Aggregator solution
1. pom.xml with lib + app as modules > mvn verify
Preferred flow
■ LOCAL:
– mvn verify
– Commit / Push
■ CI Server :
– mvn deploy ( without install(?) )
■ All can have same SNAPSHOTs as served
by the repository manager
Lifecycle “Broken”
■ mvn <phase> on multimodule project:
– phase1 .. <phase> on module1
– phase1 .. <phase> on module2
– phase1 .. <phase> on module3
– ...
– phase1 .. <phase> on moduleN
How about calling ‘mvn deploy’ and module3 is broken...
1 2 3 4 5 6 7
validate
compile
test-compile
test
package
install
deploy
DISTRIBUTION
PREBUIL
D
Phases
■ Ideally Maven executes like this:
– Validation on all modules
– Build phases on all modules
– Distribution on all modules
■ Maven Install Plugin has experimental
feature: installAtEnd
■ Maven Deploy Plugin has experimental
feature: deployAtEnd
I/O is s-l-o-w
Network Logging Files
“Maven downloads the
internet”
■ Maven downloads all required files as
defined by your projects:
– Dependencies / parents
– plugins
– extensions
Logging
■ Aim for a clean Maven output
– Never write to System.out / System.err
– Don’t log during testing (loglevel=off)
– In the extreme, run Maven with -q or --quiet
Files
Delete and re-place
(same) files is waste
of resources
Most maven-plugins
are aware if they
must execute their
task
Avoid “clean”
AVOID CLEAN,
AVOID
INSTALL
Introducing the Maven CI Extension
“Works on my machine”
Differences in:
- OS
- JDK
- Maven
- Files (Regular/Directories)
- Properties (System/Environment)
Property resolution
■ Pom.xml ( <properties/>)
■ Settings.xml (<profile><properties/></profile>)
■ System properties
■ User properties ( -Dkey=value )
Properties “Broken”
■ ‘mvn deploy -Djava.version=12’
■ ‘mvn deploy -Dspring.version=1.0’
■ DON’T EVER DOTHIS
■ REALLY, DON’T EVER DOTHIS
■ Maven should provide the “updated” pom
Version is “Broken” (1)
■ Avoid conflict with branch merging
■ Isolating user stories at runtime: make version unique ( 3.1.0-JIRA101-
SNAPSHOT )
■ Maven 3.5.0 comes with special CI-Friendly placeholders:
– revision
– sha1
– changelist
■ Multimodules require a hack to rewrite pom
Version is “Broken” (2)
<parent>
<groupId/>
<artifactId/>
<version/>
<relativePath/>
</parent>
■ Build:
Or <RelativePath>
Or <GroupId> +
<ArtifactId> +
<Version>
■ Dependency (consume)
<GroupId> +
<ArtifactId> +
<Version>
maven.experimental.buildconsumer
■ Should land in Maven 3.7.0
■ Will push JDK requirement to Java 8
CHANGE
ISTHE
ONLY
CONSTAN
T
TREATYOUR
POM AS
PRODUCTION
CODE
Remove dead “code”:
- Unused dependencies
- Unused plugins
- Unused properties
- Unused reports
Keep
refactoring
Keep
improvin
g
Locate and optimize
time consuming
processes
Automate,
automate, automate
Keep having fun
Be like a responsible pilot
UNDERSTAND
EVERY PLUGIN
STAYCURIOUS, KEEP
INFORMED
QUESTION
OUTDATED
ANSWERS
IMPROVE
INFORMATIONAT
THE SOURCE
Up-For-Grabs
■ ~60-80% of Java Project/Developers use Maven
■ The Apache Maven Project holds ~95 (sub)projects
■ Maintained by ~5-10 active volunteers (No Company!)
■ Let’s restore the balance!
■ https://s.apache.org/up-for-grabs_maven
■ https://maven.apache.org/guides/development/guide-committer-school.html
THANKYOU FOR CHOOSING
‘BROKEN BUILDTOOLS
AND BAD HABITS’
Enjoy your future flights!

Contenu connexe

Similaire à Broken Buildtools and Bad Habits (Oracle Code One 2019)

Container Mythbusters
Container MythbustersContainer Mythbusters
Container Mythbusters
inside-BigData.com
 
Attack-driven defense
Attack-driven defenseAttack-driven defense
Attack-driven defense
Zane Lackey
 

Similaire à Broken Buildtools and Bad Habits (Oracle Code One 2019) (20)

CvmFS Workshop
CvmFS WorkshopCvmFS Workshop
CvmFS Workshop
 
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
 
Linux Container Primitives and Runtimes - AWS Summit Sydney
Linux Container Primitives and Runtimes - AWS Summit SydneyLinux Container Primitives and Runtimes - AWS Summit Sydney
Linux Container Primitives and Runtimes - AWS Summit Sydney
 
Running your Java EE 6 applications in the Cloud (FISL 12)
Running your Java EE 6 applications in the Cloud (FISL 12)Running your Java EE 6 applications in the Cloud (FISL 12)
Running your Java EE 6 applications in the Cloud (FISL 12)
 
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
 
maven-for-maine-jug-090226091601-phpapp02.ppt
maven-for-maine-jug-090226091601-phpapp02.pptmaven-for-maine-jug-090226091601-phpapp02.ppt
maven-for-maine-jug-090226091601-phpapp02.ppt
 
Running your Java EE 6 Apps in the Cloud - JavaOne India 2011
Running your Java EE 6 Apps in the Cloud - JavaOne India 2011Running your Java EE 6 Apps in the Cloud - JavaOne India 2011
Running your Java EE 6 Apps in the Cloud - JavaOne India 2011
 
JavaOne India 2011 - Running your Java EE 6 Apps in the Cloud
JavaOne India 2011 - Running your Java EE 6 Apps in the CloudJavaOne India 2011 - Running your Java EE 6 Apps in the Cloud
JavaOne India 2011 - Running your Java EE 6 Apps in the Cloud
 
Running your Java EE 6 Applications in the Cloud
Running your Java EE 6 Applications in the CloudRunning your Java EE 6 Applications in the Cloud
Running your Java EE 6 Applications in the Cloud
 
Running your Java EE 6 applications in the cloud
Running your Java EE 6 applications in the cloudRunning your Java EE 6 applications in the cloud
Running your Java EE 6 applications in the cloud
 
Javaee6 Jazoon 2010 100603081147 Phpapp01
Javaee6 Jazoon 2010 100603081147 Phpapp01Javaee6 Jazoon 2010 100603081147 Phpapp01
Javaee6 Jazoon 2010 100603081147 Phpapp01
 
JFokus 2011 - Running your Java EE 6 apps in the Cloud
JFokus 2011 - Running your Java EE 6 apps in the CloudJFokus 2011 - Running your Java EE 6 apps in the Cloud
JFokus 2011 - Running your Java EE 6 apps in the Cloud
 
Container Mythbusters
Container MythbustersContainer Mythbusters
Container Mythbusters
 
Running your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the CloudRunning your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the Cloud
 
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
 
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
 
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??![충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
 
Apache REEF - stdlib for big data
Apache REEF - stdlib for big dataApache REEF - stdlib for big data
Apache REEF - stdlib for big data
 
From monolith to microservice with containers.
From monolith to microservice with containers.From monolith to microservice with containers.
From monolith to microservice with containers.
 
Attack-driven defense
Attack-driven defenseAttack-driven defense
Attack-driven defense
 

Plus de Robert Scholte

Plus de Robert Scholte (11)

Apache Maven supports ALL Java JEEConf 2019
Apache Maven supports ALL Java JEEConf 2019Apache Maven supports ALL Java JEEConf 2019
Apache Maven supports ALL Java JEEConf 2019
 
Apache Maven supports ALL Java (Javaland 2019)
Apache Maven supports ALL Java (Javaland 2019)Apache Maven supports ALL Java (Javaland 2019)
Apache Maven supports ALL Java (Javaland 2019)
 
Apache Maven supports all Java (JokerConf 2018)
Apache Maven supports all Java (JokerConf 2018)Apache Maven supports all Java (JokerConf 2018)
Apache Maven supports all Java (JokerConf 2018)
 
Keeping up with Java made easy with Apache Maven (Devoxx 2018)
Keeping up with Java made easy with Apache Maven (Devoxx 2018)Keeping up with Java made easy with Apache Maven (Devoxx 2018)
Keeping up with Java made easy with Apache Maven (Devoxx 2018)
 
Apache Maven and Java 9 and 10 (Devoxx France 2018)
Apache Maven and Java 9 and 10 (Devoxx France 2018)Apache Maven and Java 9 and 10 (Devoxx France 2018)
Apache Maven and Java 9 and 10 (Devoxx France 2018)
 
The do's and don'ts with java 9 (Devoxx 2017)
The do's and don'ts with java 9 (Devoxx 2017)The do's and don'ts with java 9 (Devoxx 2017)
The do's and don'ts with java 9 (Devoxx 2017)
 
Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)
 
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
 
Java 9 and the impact on Maven Projects (Devoxx 2016)
Java 9 and the impact on Maven Projects (Devoxx 2016)Java 9 and the impact on Maven Projects (Devoxx 2016)
Java 9 and the impact on Maven Projects (Devoxx 2016)
 
Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)
 
Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Broken Buildtools and Bad Habits (Oracle Code One 2019)

  • 1. BROKEN BUILDTOOLS AND BAD HABITS THE MAVEN STORIES Robert Scholte ( @rfscholte )
  • 2. Comair Flight 3272 Date January 9, 1997 Location 18 miles (29 km) southwest of Detroit Metropolitan Wayne County Airport Fatalities 26 passengers + 3 crewmembers Summary Atmospheric icing and pilot error leading to loss of control.
  • 3.
  • 4. Probable Cause “…This was because the Comair Flight manual recommendation was in contravention of the manufacturers due to a concern over "bridging", a concern held-over from older planes that was no longer valid on newer generation planes like the Embraer 120.”
  • 5. Probable Cause “…This was because the Comair Flight manual recommendation was in contravention of the manufacturers due to a concern over "bridging", a concern held-over from older planes that was no longer valid on newer generation planes like the Embraer 120.”
  • 8. When things start to fail… Analysis Google / Stackoverflow Colleagues Fix or workaround (but for how long…)
  • 9. But do we keep up? WORKAROUND STURN INTO PATTERNS PATTERNS CONTROL PEOPLES SYSTEM
  • 10. Broken build or broken tools? “… but it works on my machine” CI server is your neutral judge
  • 11. Builds of Maven subprojects at ASF JDK 7 JDK 8 JDK 11 JDK 12 JDK 13-ea V V V V V JDK 7 JDK 8 JDK 11 JDK 12 JDK 13-ea Maven 3.0.5 V Maven 3.2.5 V Maven 3.3.9 V Maven 3.5.2 V Maven 3.6.1 V V V V V Frameworks /Libraries Plugins / Extensions Operation Systems: Ubuntu + Windows
  • 12. “Works on my machine” Differences in: - (local code changes) - OS - JDK - Maven - Files (Regular/Directories) - Properties (System/Environment)
  • 13. Analysis Options Description -v,--version Display version information -V,--show-version Display version information WITHOUT stopping build -e,--errors Produce execution error messages -X,--debug Produce execution debug output
  • 14. “Works on my machine” Differences in: - OS - JDK - Maven - Files (Regular/Directories) - Properties (System/Environment)
  • 15. Local Repository Dependency cache without time-to-live (TTL) ${user.home}/.m2/repository
  • 16. Local Repository “Broken”(1)  Maven 2: dumb cache  Maven 3: cached artifacts verified for existence with _remote.repositories Options Description -llr,--legacy-local- repository Use Maven 2 Legacy Local Repository behavior, i.e. no use of _remote.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true
  • 17. Local Repository “Broken”(2) ■ Maven was written for single user ■ CI server can be considered multi user – Corrupt files due to concurrent writes/reads ■ Solution: – Takari Concurrent Local Repository
  • 18. Local Repository “Broken”(3) ■ Checksums are NOT verified by default, repository managers (should) do ■ Set checksumPolicy per repository ■ Future solutions: – Enable by default Options Description -C,--strict-checksums Fail the build if checksums don't match -c,--lax-checksums Warn if checksums don't match
  • 19. Local Repository “Broken”(4) ■ Maven 2+3: single directory – Difficult to maintain ■ Future solutions: – separate SNAPSHOT directory? – directory per remote repository?
  • 20. Local Repository Pollution “Environmental pollution is caused by …” “Man must understand its actions”
  • 22. Dependency Resolution “Broken” Maven 2: - Not aware of ‘reactor’ - Dependencies had to exist in local repo. Maven 3: - ‘reactor’ aware - No need for ‘install’ anymore
  • 23. Verifying lib with app app-1.0-SNAPSHOT lib-2.1-SNAPSHOT • Classic solution 1. Lib > mvn install 2. App > mvn verify • Aggregator solution 1. pom.xml with lib + app as modules > mvn verify
  • 24. Preferred flow ■ LOCAL: – mvn verify – Commit / Push ■ CI Server : – mvn deploy ( without install(?) ) ■ All can have same SNAPSHOTs as served by the repository manager
  • 25. Lifecycle “Broken” ■ mvn <phase> on multimodule project: – phase1 .. <phase> on module1 – phase1 .. <phase> on module2 – phase1 .. <phase> on module3 – ... – phase1 .. <phase> on moduleN How about calling ‘mvn deploy’ and module3 is broken...
  • 26. 1 2 3 4 5 6 7 validate compile test-compile test package install deploy DISTRIBUTION PREBUIL D Phases
  • 27. ■ Ideally Maven executes like this: – Validation on all modules – Build phases on all modules – Distribution on all modules ■ Maven Install Plugin has experimental feature: installAtEnd ■ Maven Deploy Plugin has experimental feature: deployAtEnd
  • 28. I/O is s-l-o-w Network Logging Files
  • 29. “Maven downloads the internet” ■ Maven downloads all required files as defined by your projects: – Dependencies / parents – plugins – extensions
  • 30. Logging ■ Aim for a clean Maven output – Never write to System.out / System.err – Don’t log during testing (loglevel=off) – In the extreme, run Maven with -q or --quiet
  • 31. Files Delete and re-place (same) files is waste of resources Most maven-plugins are aware if they must execute their task Avoid “clean”
  • 33. “Works on my machine” Differences in: - OS - JDK - Maven - Files (Regular/Directories) - Properties (System/Environment)
  • 34. Property resolution ■ Pom.xml ( <properties/>) ■ Settings.xml (<profile><properties/></profile>) ■ System properties ■ User properties ( -Dkey=value )
  • 35. Properties “Broken” ■ ‘mvn deploy -Djava.version=12’ ■ ‘mvn deploy -Dspring.version=1.0’ ■ DON’T EVER DOTHIS ■ REALLY, DON’T EVER DOTHIS ■ Maven should provide the “updated” pom
  • 36. Version is “Broken” (1) ■ Avoid conflict with branch merging ■ Isolating user stories at runtime: make version unique ( 3.1.0-JIRA101- SNAPSHOT ) ■ Maven 3.5.0 comes with special CI-Friendly placeholders: – revision – sha1 – changelist ■ Multimodules require a hack to rewrite pom
  • 37. Version is “Broken” (2) <parent> <groupId/> <artifactId/> <version/> <relativePath/> </parent> ■ Build: Or <RelativePath> Or <GroupId> + <ArtifactId> + <Version> ■ Dependency (consume) <GroupId> + <ArtifactId> + <Version>
  • 38. maven.experimental.buildconsumer ■ Should land in Maven 3.7.0 ■ Will push JDK requirement to Java 8
  • 41. Remove dead “code”: - Unused dependencies - Unused plugins - Unused properties - Unused reports Keep refactoring
  • 42. Keep improvin g Locate and optimize time consuming processes Automate, automate, automate Keep having fun
  • 43. Be like a responsible pilot UNDERSTAND EVERY PLUGIN STAYCURIOUS, KEEP INFORMED QUESTION OUTDATED ANSWERS IMPROVE INFORMATIONAT THE SOURCE
  • 44. Up-For-Grabs ■ ~60-80% of Java Project/Developers use Maven ■ The Apache Maven Project holds ~95 (sub)projects ■ Maintained by ~5-10 active volunteers (No Company!) ■ Let’s restore the balance! ■ https://s.apache.org/up-for-grabs_maven ■ https://maven.apache.org/guides/development/guide-committer-school.html
  • 45. THANKYOU FOR CHOOSING ‘BROKEN BUILDTOOLS AND BAD HABITS’ Enjoy your future flights!

Notes de l'éditeur

  1. JDK: minimum + LTS + current + EA