Question

I am a bit new to maven, but I have some experiences with ant and the build process. I would like to do one thing that is kind of driving me nuts:

Given:

  1. A remote repository (git, svn, hg,…) that holds static content (like images),
  2. one maven project that uses/manages the mentioned repository in the same way as it does with all other dependencies (checkout on install, update whenever updates occur), in other words: the maven project depends on that repository

I finally want to be able to access the content (no *.svn or *.git) and copy it into my build, on build time*.

I want maven to store a local copy of that repository in maven`s local repository (~/.m2/repository) only once on each machine and manage it like all other dependencies.

*I am not trying to build a Java project

Thanks for help!

Was it helpful?

Solution

From what I've seen, Maven projects don't use version control repositories as external artifacts. That's a little too fine-grained for what you want, I think.

I've done something similar, when Project A wanted to use resources from Project B.

  1. Project B, as part of its build procedure, collected it's resources into a ZIP file and deployed the ZIP file into a maven repository.
  2. Project A then references the ZIP file artifact, unpacking it when building to where it needs it.

Look into the dependency plugin for maven, especially the dependency:unpack and dependency:unpack-dependencies goal.

Have fun

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top