Maven 2 & 3

Improve error message when dependency with classifier is missing version

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.0.11, 2.2.0, 3.0-alpha-3
  • Component/s: Errors
  • Labels:
    None
  • Complexity:
    Intermediate
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

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.

Activity

Hide
Paul Gier added a comment - - edited

Attaching patch for 2.0.x that uses the dependencyManagementKey (groupId:artifactId:type:classifier), instead of just the artifactId and groupId in the error message.

The new error message looks like this:

Validation Messages:

    [0]  'dependencies.dependency.version' is missing for org.apache.maven:myartifact1:jar:test
Show
Paul Gier added a comment - - edited Attaching patch for 2.0.x that uses the dependencyManagementKey (groupId:artifactId:type:classifier), instead of just the artifactId and groupId in the error message. The new error message looks like this:
Validation Messages:

    [0]  'dependencies.dependency.version' is missing for org.apache.maven:myartifact1:jar:test
Hide
Paul Gier added a comment -

This is fixed.

Show
Paul Gier added a comment - This is fixed.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: