Maven from Scratch to Production (.odp)


Published on

My presentation on Maven for the Durban Java User Group meeting, held at Thumbtribe's offices. As I'm not happy with everything as-is, my aim is to improve the presentation with an accompanying project which I need to set up in a proper environment so that it can serve as a fully functional example. To follow progress, keep an eye on the following blog post:

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Welcome note Introduce yourself Why maven as a topic?
  • Avoid conflict and flame-wars :P
  • Quick overview of the entire presentation's objective
  • Quick word on technologies used in the skeleton project which took some time to set up
  • The first steps in creating a maven project. Creating the child Modules are excluded. Child modules can be created using different project templates, war, ejb, ear, portlet etc. Steps excluded from setup: version control (subversion) ssh keys web config for project documentation
  • Just covering the most parts needed for enabling the project to a production environment
  • The standalone option is the easiest Setup in Glassfish requires JNDI resources being set up mail database logging config (working though) Depending on the project the default build flow is sufficient (for using the root POM and produce artifacts)
  • SCM support : CVS, Subversion, Clearcase, Perforce, Starteam, Visual Source Safe, CM Synergy, Bazaar, Mercurial
  • Release preparation sees to it that most of the build issues are sorted out before a release. (issues not discovered in a normal build) Once preparation succeeds the build is ready for release. After the release build all the documentation and relevant information will be available in a web format which can be published, using the site plugin. The site plugin enhances the developer experience in that for example, a new developer joins the team, he/she can be pointed to the project site which has all the required documentation.
  • Maven from Scratch to Production (.odp)

    1. 1. by: Johan Mynhardt | Durban JUG Meeting | 12 May 2011| <ul>Maven From Scratch to Production </ul>
    2. 2. <ul><li>Ripe ground for flame-war
    3. 3. Argumenting that: </li></ul><ul><ul><li>X is better than Y.
    4. 4. Y is better than X.
    5. 5. I can do this with X by making use of Z. </li></ul></ul><ul><li>A session to convince you </li></ul><ul>What this is *not* </ul>
    6. 6. <ul><li>Set up a Maven project
    7. 7. Set up the CI environment with Apache Continuum
    8. 8. See everything in action! </li></ul><ul>Objectives </ul>
    9. 9. <ul><li>Java EE 6 </li><ul><li>Glassfish Application Server </li></ul></ul><ul><ul><li>EJB 3.1
    10. 10. JSF 2.0 </li><ul><li>PrimeFaces </li></ul></ul></ul><ul><li>Continuous Integration and Project Management (from development perspective) </li></ul><ul><ul><li>Apache Continuum
    11. 11. Apache Maven </li></ul></ul><ul>Project Technologies </ul>
    12. 12. <ul><li>Making the build process easy
    13. 13. Providing a uniform build system
    14. 14. Providing quality project information
    15. 15. Providing guidelines for best practices development </li></ul><ul>Maven's Objectives </ul><ul> </ul>
    16. 16. <ul>Setting up the Project: HelloWorld </ul><ul><li>Create the project root by running the following: </li></ul><ul><li>Select the number for the line matching (in this case 110): </li></ul><ul><li>This will be the root of the project, containing the web, service and assemble sub-modules (multi-module project) </li></ul><ul><ul><li>You now have the chance to add project-specific documentation and parameters to the pom.xml which you can later on, share with you developers. The convenience is that you don't need to keep track of every aspect of the project in external documentation, as everything needed is already available. </li></ul></ul>~/$ cd workspace ~/workspace$ mvn archetype:generate -Dversion=1.0-SNAPSHOT -DartifactId=HelloWorld 110: remote -> maven-archetype-quickstart (An archetype which contains a sample Maven project.)
    17. 17. <ul>Configuring the Documentation </ul><ul><li>Development </li><ul><li>Source Code Management
    18. 18. Collaboration Management
    19. 19. Notification Management
    20. 20. Continuous Integration
    21. 21. Distribution Management </li></ul><li>Other Information </li><ul><li>Developers
    22. 22. Contributors
    23. 23. Reporting
    24. 24. Licenses
    25. 25. Organisation </li></ul></ul>
    26. 26. <ul>Setting up Continuous Integration </ul><ul><li>Download Apache Continuum </li><ul><ul><li> </li></ul><li>Standalone bundled with Apache Tomcat
    27. 27. WAR for deployment on an Application Server </li></ul><li>Unzip to destination
    28. 28. Start up Continuum
    29. 29. Set up project in Continuum </li><ul><li>make the root pom.xml available via web </li><ul><li>file protocol supported, but needs configuration </li></ul></ul></ul>tar zxvf apache-continuum-1.3.7-bin.tar.gz ./continuum start
    30. 30. <ul>Some Continuum Features </ul><ul><li>Tool support: </li><ul><li>Maven 1, 2 and 3
    31. 31. ANT
    32. 32. Shell Scripts </li></ul><li>Build Types: </li><ul><li>Manual
    33. 33. Scheduled
    34. 34. Push with xmlrpc </li></ul><li>Distributed Builds
    35. 35. Parallel Builds </li></ul>
    36. 36. <ul>Seeing Continuum in Action </ul><ul><li>Release Stages </li><ul><li>Prepare for Release
    37. 37. Do the Release </li></ul><li>Build Result </li><ul><li>Artifacts deployed to the repository </li><ul><li>If it's public, users will have access to the POMs and the resources the POM files describe. </li></ul><li>Site with: </li><ul><li>Generated Test Results and Project JavaDoc,
    38. 38. Project information,
    39. 39. Dependency Information and many more... </li></ul><li>Resources deployed to staging and/or production environment </li><ul><li>(dependend on setup) </li></ul></ul></ul>
    40. 40. <ul><li>Apache </li></ul><ul><ul><li>Maven: |
    41. 41. Continuum: | </li></ul></ul><ul><li>Glassfish </li><ul><li>Application Server | </li></ul><li>Prime Teknoloji </li></ul><ul><ul><li>PrimeFaces: | </li></ul></ul><ul>References </ul>
    42. 42. <ul>End </ul>Thank you for attending!
    43. 43. <ul><ul><li>Junior Java Developer @ Thumbtribe Mobile Solutions </li></ul></ul><ul><ul><li>Passionate about Linux, Java and technology in general </li></ul></ul><ul><ul><li>Description in less than 3 lines: </li><ul><li>technology++ cats++ coffee++ java++ linux++ intellij++
    44. 44. eclipse-- dogs-- tea-- M$-- </li></ul></ul></ul><ul><ul><li>Follow on Twitter: </li><ul><li>@johanmynhardt </li></ul></ul></ul><ul>About the author </ul>