1

I'm building a project with Maven. This project has multiple modules. Most of them are located in the same repository (github) but others are located in different repositories (github and bitbucket).

I want my project to be built at once.

This is my schema:

ParentProject (pom.xml) <--- located at bitbucket

_module1

_module2

...

External project (opensource tool for my project at github)

External project (internal tool for my project at bitbucket)

I've taken a look at scm and release plugins in maven, but every one focuses on how to push or commit changes to the repo, not in download any branch from external repos.

How to achieve this?

k0pernikus
  • 60,309
  • 67
  • 216
  • 347

1 Answers1

0

The repositories at GitHub are only code repositories! If you have a local project that is dependent from the result of this project at GitHub (a jar file for instance) then you have to put this result into a Maven repository!

You can do that by cloning the GitHub project, running mvn install and this way having the jar within your local maven repository.

If you don't want to have to build the GitHub project on your local machine then it's much more complicated. You'd have to have a continuous integration server reacting on the pushes of the GitHub repository (like TravisCI). Additionally you have to setup your mvn to deploy (not only install!) the jar file to a repository, that can be reached from everywhere but you cannot directly deploy to maven central! If you really want to do this, then you've to ask again about this problem.

Niklas P
  • 3,427
  • 2
  • 15
  • 19
  • I have no problem in building the project from Github. In fact, that's the way we wanted to do it. Is there a way to include a maven task to do this (download a tag from a github repo and then, execute the package goal) any examples? Thank you! – Paco Alías Sep 07 '15 at 09:43
  • Within the following link you find a way to execute a shell script - this way, you can `git clone` such a repository and than execute the `mvn install` within this project. http://stackoverflow.com/questions/3491937/i-want-to-execute-shell-commands-from-mavens-pom-xml – Niklas P Sep 08 '15 at 10:29