Maven beyond hello_world
Upcoming SlideShare
Loading in...5
×
 

Maven beyond hello_world

on

  • 461 views

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

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

Statistics

Views

Total Views
461
Views on SlideShare
459
Embed Views
2

Actions

Likes
0
Downloads
5
Comments
0

1 Embed 2

https://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Maven beyond hello_world Maven beyond hello_world Presentation Transcript

  • Maven beyond “Hello world” by Gabriel Dogaru
  • What / why / how? ● Corporate environment ● Build large projects ● 10+ modules
  • 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
  • “Sounds like my first wife.” David Letterman
  • What do I need ? ● Stable builds ● Reproducible builds ● Reports ● Releases ● Control over source code and dependencies ● Build automation ● Easy development cycle ● What else ???
  • Do you know a ninja? ● Developers are smart ● Make builds fool proof ● Have a build team
  • Control your sources Install an maven repository manager http://maven.apache.org/repository-management.html
  • Resolving dependencies http://today.java.net/article/2010/01/04/maven-repository-managers-enterprise
  • Deploying dependencies http://today.java.net/article/2010/01/04/maven-repository-managers-enterprise
  • ~/.m2/settings.xml
  • Control dependencies ● Use a parent pom (super pom) ● maven-enforcer-plugin
  • Parent pom example http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html
  • Use dependency management
  • 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/
  • All for One one project => one artifact.
  • Respect thy MAVEN http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
  • Know your goals
  • Know who you are ● Define your own archetypes ● Define your own packaging http://maven.apache.org/guides/mini/guide-creating-archetypes.html
  • Groovy example http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven
  • 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
  • Leave your SNAPSHOT alone
  • Now we release
  • The release plugin http://maven.apache.org/maven-release/maven-release-plugin/
  • Gets along well with CI
  • Make nice reports http://maven.apache.org/plugins/maven-site-plugin/ http://mojo.codehaus.org/sonar-maven-plugin/
  • 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....
  • Thank You