1

Currently my deploy workflow involves manually (i.e. in a script) cd-ing into each maven project directory and running mvn install. The problem is for local resources, i.e. other in-house code that I've written and am actively developing/maintaining, I don't know how to tell maven to build those resources itself when they are missing. Ideally each time I need to re-package the top level application it will rebuild any libraries it depends on that have at least one file modified.

djechlin
  • 59,258
  • 35
  • 162
  • 290
  • Are you not using a multi module `pom` i.e. the inheritance feature of parent and child ? – mtk Dec 07 '12 at 19:57
  • Related: http://stackoverflow.com/questions/2890341/maven-module-vs-project-eclipse-m2eclipse-plugin – Brian Dec 07 '12 at 20:00

3 Answers3

3

If your (multi-module) project uses other in-house resources, what you actually need might not be to rebuild all those resources all the time, but to use a local maven repository. It can be a simple repository where resources are deployed using ssh or an HTTP transport (see the deploy plugin), or a real artifact manager such as Archiva, Artifactory or Nexus.

A repository manager does more than just hold your deployed artifacts, it can also clean the obsolete snapshots once the corresponding release has been made, and serve as a local cache for other repositories, including central.

Frank Pavageau
  • 11,477
  • 1
  • 43
  • 53
  • Also I just had micro-factored my maven projects - combining several into a Lib gave me reasonable UORs to work with. – djechlin Mar 01 '13 at 15:38
1

Have a parent POM which contains all your modules. When you build the parent, all the modules that are part of parent POM file will be build as well.

You can inherit many things from the parent as long as you have the parent in your child.

muruga
  • 1,073
  • 8
  • 16
0

Consider setting up Jenkins to automatically build your code. Jenkins has a useful feature that will rebuild projects that depend on newly built artifacts. Builds can be automatically triggered by simply committing your code.

If you're using several development machines (or working in a team) combine Jenkins with Nexus (Other options:Artifactory, Archiva) to provide a common store for shared artifacts. These tools are were designed to support Maven builds.

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185