You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2009/10/05 13:19:23 UTC

[jira] Commented: (MNG-3991) POM validator allows optional but it is not valid.

    [ http://jira.codehaus.org/browse/MNG-3991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=193439#action_193439 ] 

Benjamin Bentmann commented on MNG-3991:
----------------------------------------

Had to relax the validation to only produce warnings in [r821758|http://svn.apache.org/viewvc?view=rev&revision=821758]. This is a compromise to keep backward-compat with extensions like Flex Mojos that use [custom dependency scopes|https://docs.sonatype.org/display/FLEXMOJOS/Adding+libraries+to+compilation].

> POM validator allows <scope>optional</scope> but it is not valid.
> -----------------------------------------------------------------
>
>                 Key: MNG-3991
>                 URL: http://jira.codehaus.org/browse/MNG-3991
>             Project: Maven 2
>          Issue Type: Bug
>          Components: POM
>    Affects Versions: 2.0.10, 2.1.0, 2.2.0
>            Reporter: Julien HENRY
>            Assignee: Benjamin Bentmann
>            Priority: Minor
>             Fix For: 3.0-alpha-3
>
>
> In my project I did a mistake and I wrote
> {code}
> <dependency>
> 	<groupId>org.slf4j</groupId>
> 	<artifactId>slf4j-log4j12</artifactId>
> 	<version>1.5.0</version>
> 	<scope>optional</scope>
> </dependency>
> {code}
> but in fact I intended to write
> {code}
> <dependency>
> 	<groupId>org.slf4j</groupId>
> 	<artifactId>slf4j-log4j12</artifactId>
> 	<version>1.5.0</version>
> 	<optional>true</optional>
> </dependency>
> {code}
> I'm very surprised that Maven doesn't detect such a mistake during the validate phase. Could it be possible to add a check to allow only valid scopes.
> Thanks

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira