views:

292

answers:

2

Which maven scopes are available during report generation for a maven site? Are any available.

I'm trying to share a FindBugs filter file between several modules without having it end up in any of the application jars. I was thinking of putting in a commons project, which will package it in a separate jar with a classifier of "build-tools" with any other such files we might have. Any projects that need it will import the project with the classifier.

+1  A: 

With the checkstyle plugin, the trick is to declare your separate JAR as a dependency of the plugin (this works for PMD too).

Unfortunately, that won't work for the FindBugs plugin, as it seems to look for the filters in the filesystem rather than the classpath.

What I would do is bind an execution of dependency:unpack to the pre-site phase in order to get the separate JAR from the repository and unpack it in target, then reference the filters file with a relative path in the FindBugs plugin's configuration.

Olivier
It should be noted that dependency will unpack what's in the repository. Until changes are uploaded to it, dependent projects will not receive the updated version.
sblundy
That's right, dependency:unpack will take the JAR from the repository, *even in a reactor build*.
Olivier
+1  A: 

I think the question could be better phrased as "How can i share my findbug configuration across projects?"

Stictly speaking, scopes apply only to dependency resolution. A plugin requests dependency resolution within a given scope. A phase or lifecycle by itself has no concept of scope so there technically isn't an answer to the question as phrased. ;-)

Brian Fox