Which scopes are present during maven site lifecycle

谁说我不能喝 提交于 2020-01-06 04:42:08

问题


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:


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.




回答2:


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. ;-)



来源:https://stackoverflow.com/questions/462151/which-scopes-are-present-during-maven-site-lifecycle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!