Your SlideShare is downloading. ×
Maven beyond hello_world
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Maven beyond hello_world

272
views

Published on

Maven presentation I held for Iasi - JUG ( iasi-jug.ro )

Maven presentation I held for Iasi - JUG ( iasi-jug.ro )

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
272
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Maven beyond “Hello world” by Gabriel Dogaru
  • 2. What / why / how? ● Corporate environment ● Build large projects ● 10+ modules
  • 3. Some hate maven Maven builds are an infinite cycle of despair that will slowly drag you into the deepest, darkest pits of hell (where Maven itself was forged). http://kent.spillner.org/blog/work/2009/11/14/java-build-tools.html
  • 4. “Sounds like my first wife.” David Letterman
  • 5. What do I need ? ● Stable builds ● Reproducible builds ● Reports ● Releases ● Control over source code and dependencies ● Build automation ● Easy development cycle ● What else ???
  • 6. Do you know a ninja? ● Developers are smart ● Make builds fool proof ● Have a build team
  • 7. Control your sources Install an maven repository manager http://maven.apache.org/repository-management.html
  • 8. Resolving dependencies http://today.java.net/article/2010/01/04/maven-repository-managers-enterprise
  • 9. Deploying dependencies http://today.java.net/article/2010/01/04/maven-repository-managers-enterprise
  • 10. ~/.m2/settings.xml
  • 11. Control dependencies ● Use a parent pom (super pom) ● maven-enforcer-plugin
  • 12. Parent pom example http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html
  • 13. Use dependency management
  • 14. The Bigger, The Better ● Have many modules ● Your IDE loves modules ● Try to have separate modules if that makes sense for you ● Do you really need multi module projects? http://monkeyisland.pl/2010/12/11/ide-and-patterns-for-huge-maven-project/
  • 15. All for One one project => one artifact.
  • 16. Respect thy MAVEN http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
  • 17. Know your goals
  • 18. Know who you are ● Define your own archetypes ● Define your own packaging http://maven.apache.org/guides/mini/guide-creating-archetypes.html
  • 19. Groovy example http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven
  • 20. Your build is unique http://www.sonatype.com/books/mcookbook/reference/ch02s03.html http://ronalleva.com/groovy/maven/programming/2008/01/23/using-the-groovy-maven-plugin-to-do-magic.html
  • 21. Leave your SNAPSHOT alone
  • 22. Now we release
  • 23. The release plugin http://maven.apache.org/maven-release/maven-release-plugin/
  • 24. Gets along well with CI
  • 25. Make nice reports http://maven.apache.org/plugins/maven-site-plugin/ http://mojo.codehaus.org/sonar-maven-plugin/
  • 26. Remember ● Maven is not that bad, could be pretty nice ● Customize maven to fit your need ● but respect the tool ● You are never done ● Have a master near by that knows the tool ● Have a look at Gradle....
  • 27. Thank You