[
https://jira.codehaus.org/browse/MRESOURCES-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=290520#comment-290520
]
Jorg Heymans commented on MRESOURCES-158:
-----------------------------------------
There are different semantics IMO.
1) 'emptying' the parameter value as you say is this:
{code}
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<outputDirectory/>
</configuration>
</plugin>
{code}
The value was in this case specified as null so a build error will be triggered
because it is mandatory. Does mandatory then mean a not-null not-empty string
or is this up to the plugin to interpret ?
2) Not specifying the parameter at all:
{code}
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>
{code}
In this case the default value kicks in.
3) Specifying the parameter, the common case no problem there
{code}
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<outputDirectory>mydir</outputDirectory>
</configuration>
</plugin>
{code}
Is this consistent for all maven plugins ? In that case an IDE should do an
extra check in case of a mandatory parameter, i.e. not-null check on the value
if the element is specified, and let it pass if the element is not specified
and has a default value. But this would break if there are plugins out there
that specify mandatory parameters without a default value. Do these exist ? And
where is the default value kept, it's not in the plugin descriptor AFAICT.
> outputDirectory is marked as mandatory whereas it is not really mandatory
> -------------------------------------------------------------------------
>
> Key: MRESOURCES-158
> URL: https://jira.codehaus.org/browse/MRESOURCES-158
> Project: Maven 2.x Resources Plugin
> Issue Type: Bug
> Affects Versions: 2.5
> Reporter: Jorg Heymans
>
> in the documentation and plugin descriptor the outputDirectory config element
> is marked as mandatory. But since there is a default value of
> ${project.build.outputDirectory} this element is not really mandatory. Other
> configuration elements with the same default value semantics are not marked
> as mandatory so i think for outputDirectory the same semantics should be
> applied.
> this is especially troublesome for ideas that try to assist in maven
> configuration and rely on the plugin descriptor to figure out if elements are
> mandatory or not. See http://youtrack.jetbrains.net/issue/IDEA-80626
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira