Issue Details (XML | Word | Printable)

Key: MNG-1404
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: John Casey
Reporter: Barry Kaplan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 2

Provide informative messages when POM is invalid

Created: 02/Nov/05 05:41 PM   Updated: 01/Feb/06 02:44 PM
Component/s: None
Affects Version/s: 2.0
Fix Version/s: 2.0.1

Time Tracking:
Not Specified

File Attachments: 1. Text File MNG-1404.patch (2 kB)


Complexity: Intermediate


 Description  « Hide
When a pom is invalid the error message should identify the problem. For example, in the POM below the closing "dependencies" element is misspelled, yet the error messages is only:

[WARNING] POM for: 'springframework:spring:pom:1.2.6' does not appear to
> be valid. Its will be ignored for artifact resolution.
> Reason: Parse error reading POM
> [DEBUG] springframework:spring:jar:1.2.6 (selected for compile)


<project>
> <modelVersion>4.0.0</modelVersion>
> <groupId>springframework</groupId>
> <artifactId>spring</artifactId>
> <!-- Really 1.2.6-SNAPSHOT -->
> <version>1.2.6</version>
>
> <dependencies>
> <dependency>
> <groupId>commons-logging</groupId>
> <artifactId>commons-logging</artifactId>
> <version>1.0.4</version>
> <scope>compile</scope>
> </dependency>
> </depenencies>
>
> </project>



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
David Jackman added a comment - 03/Nov/05 09:28 AM
The current version of maven-project does output the validation errors in debug mode (using the -X parameter). However, XML parsing problems (such as the one I reported on the jMock POM (which has since been fixed)) aren't included in the validation errors. I'm attaching a patch that addresses this problem. This patch also fixes the spelling error in the current error message ("it" instead of "its").

John Casey added a comment - 16/Nov/05 02:30 PM
Did not apply patch; typo fix was already committed for MavenMetadataSource, and xpp3 error should not be wrapped in a ModelValidationResult (it's not part of the model validation), so I appended it to the message of the exception that is thrown.