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

Improve error message when dependency with classifier is missing version

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.11, 2.2.0, 3.0-alpha-3
    • Errors
    • None
    • Patch

    Description

      Currently, if I have two dependencies on the same groupId:artifactId, one with a classifier and one without, the missing version error message does not distinguish which dependency is missing a version. For example, the following pom is missing a version number for one of the dependencies.

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.apache.maven</groupId>
        <artifactId>missing-version-error</artifactId>
        <packaging>jar</packaging>
        <name>Missing version error</name>
        <version>1.0.0-SNAPSHOT</version>
        
        <dependencies>
          <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>myartifact1</artifactId>
            <version>1.0-SNAPSHOT</version>
          </dependency>
          <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>myartifact1</artifactId>
            <classifier>test</classifier>
          </dependency>
        </dependencies>
      </project>
      

      The error message prints the following:

      Validation Messages:
      
          [0]  'dependencies.dependency.version' is missing for org.apache.maven:myartifact1
      

      The error message should include information about the dependency's classifier.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            pgier Paul Gier
            pgier Paul Gier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment