0

I have a multi module maven project ('assembler'), and I would like to add a FindBugs phase.

The problem is that some of the projects are not able to build stand alone since have dependencies on other projects... however when I invoke mvn package from the 'assembler' project - it works fine and all inner dependencies are resolved.

The problem is that when mvn findbugs:findbugs command is executed, those inner dependencies are not resolved, and maven complains.

Searching Google, I found a way to make it work, using mvn install, but I do not like this approach since eventually this should be used in CI with Jenkins and I do not want to rely on local maven repo on the build server.

Will appreciate hearing your ideas.

Thanks.

Marat Strelets
  • 525
  • 1
  • 5
  • 10

1 Answers1

1

Don't be afraid of mvn install, it is your friend. What you need is to set up a centralized Maven repository (such as Nexus or Artifactory) or rent one (such as Bintray) to which you deploy your Maven artifacts to.

Jenkins or any other decent CI engine can do the actual deploying for you, either natively or through Maven. Once deployed, other users - Jenkins included - will be able to resolve their dependencies and you will be able to run FindBugs, PMD, JaCoco, host Javadoc or pretty much anything you want.

Side-note: Don't get confused by the term deploy as most people new to Maven usually get. In context of Maven, it has absolutely nothing to with your target environment. It simply means that an artifact is pushed out to a remote repository and nothing else.

Daniel
  • 4,033
  • 4
  • 24
  • 33
  • This is not exactly what I needed, but eventually I found out that Jenkins has it's own temporary repository for every build so I will use `mvn install` indeed. Thanks anyway. – Marat Strelets Jan 27 '16 at 12:43