Maven Questions - illyfrancis/scribble GitHub Wiki

Given that,

There are three lifecycle phases:

  • clean
  • default
  • site

And within each lifecylcle, there are multiple phases.

  • clean
    • pre-clean, clean, post-clean
  • default
    • validate, initialize, ... , compile, ... , test-compile, ... , test, ...
    • package ...
    • integration-test ...
    • verify
    • install
    • deploy

Questions

  1. when invoking a goal, can it be skipped? E.g. can test be called without it invoking compile?
  2. for multi module projects, how does it manage dependencies between modules? does it install sub modules first?
  3. how does maven manage SNAPSHOT etc versioning? what's the best practise?
  4. not clear on built-in lifecycle bindings, refer to this
  5. What is WAR overlays? When to use it?
  6. how to publish source
  7. where to generate javadoc and produce artifacts
  8. Where to define remote repository and best practise?
  9. how to structure jenkins with maven for pipeline views
  10. usage of mvn release plugin, haven't had much use before
  • see below
  1. can classifier in coordinates be used to produce two builds of the same? refer to book 'definitive guide to maven' chapter 9.5.1

Questions for multi module projects

  1. Should build happen on the root project only?
  2. what about install and deploy?
  • doesn't make sense to install EAR and also its JAR and WAR project?
  1. What about release process?
  2. how to manage application version number? is it different from <version>?
  3. how to keep the version number in sync when working in multi module projects?
  4. how about structure of the projects in VCS?
  • aggeregate project belongin to trunk/branch/tags? or trunk/branch/tags then each projects underneath?

Q's relating to CI

Given the lifecycle phases,

... -> compile -> test compile -> test -> package -> it -> verify -> install -> deploy
  • How should we define the jobs in jenkins? compile ... test?
  • Where should the static analysis jobs go? in between or a parallel jobs after compile?
  • how does the user's name map to actual email address? via ldap? (active dir?)
  • assuming a multi module projects, it would only make sense to build the top level project. But how to drive/trigger the top level build based on sub-module changes. Also does it make sense to have a separate job just for the sub modules?
    • for example, if there's TOP, EAR, JAR and WAR and something in JAR changes. Should it trigger the build on TOP, EAR and WAR as well as it's own JAR project?

maven release plugin

jenkins release plugin

version plugin (useful?)

⚠️ **GitHub.com Fallback** ⚠️