Open rainbow702 opened 7 years ago
I found an explanation from guide-configuring-plugins:
Note:
Configurations inside the <executions> tag differ from those that are outside <executions> in that they cannot be used from a direct command line invocation.
Instead they are only applied when the lifecycle phase they are bound to are invoked.
Alternatively, if you move a configuration section outside of the executions section,
it will apply globally to all invocations of the plugin.
But I think the command mvn clean compile
does not match the case of 'direct command line invocation'.
The following is my project structure:
The content of BugController.java is:
The pom.xml is like the following at the beginning:
Then, I ran the command:
Obviously, the findbugs failed, and it printed out the reason:
Then, I wanted to ignore this bug. After reading the Filter File Doc, I just wrote the following exclude-file (named excludeFilter.xml, showed in the project structure):
And I added a configuration to the plugin execution as following:
Then I ran the command again:
I thought the bug should be ignored, but unfortunately, it was still there.
And then I ran the command again with -X option to see the detail:
The following is a snippet from the output of the above command:
We can see that the check execution goal got the configuration excludeFilterFile, but it still printed out the bug:
And at last, I tried to move the configuration to be outside of the execution node, as following:
And the plugin worked fine, and the bug was ignored.
So, my question is: Is the way of configuration I tried a bug? Or, I misconfigured something? Or, I misunderstood the configuration of maven plugin?