Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-3991

POM validator allows <scope>optional</scope> but it is not valid.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.10, 2.1.0, 2.2.0
    • 3.0-alpha-3
    • POM
    • None

    Description

      In my project I did a mistake and I wrote

      <dependency>
      	<groupId>org.slf4j</groupId>
      	<artifactId>slf4j-log4j12</artifactId>
      	<version>1.5.0</version>
      	<scope>optional</scope>
      </dependency>
      

      but in fact I intended to write

      <dependency>
      	<groupId>org.slf4j</groupId>
      	<artifactId>slf4j-log4j12</artifactId>
      	<version>1.5.0</version>
      	<optional>true</optional>
      </dependency>
      

      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

      Attachments

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              henryju Julien HENRY
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: