简体   繁体   中英

Maven―Dependencies, static content from remote repository

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM