Hi,

I'm having trouble using pom:validate (in beta 10) over a basic test pom.

Given a minimal pom:
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <pomVersion>3</pomVersion>
  <id>test</id>
  <name>Tests name</name>
  <currentVersion>0.1</currentVersion>
  <organization>
    <name>Test org name</name>
    <url>Test org url</url>
  </organization>
  <inceptionYear>2003</inceptionYear>
  <shortDescription>Test description.</shortDescription>
  <developers/>
  <build/>
</project>

pom:validate is successful but does include the following line:
[Error] maven-project.xsd:375:66: 
http://www.w3.org/TR/xml-schema-1#src-resolve?filtering&element declaration

Adding an empty <repository/> to the above results in:

[validate] [ERROR] cvc-complex-type.2.4.a: Invalid content starting with 
element 'repository'. The content must match 
'(("":extend){0-1},("":pomVersion),("":id),("":name),("":groupId){0-1},("":currentVersion),("":organization),("":inceptionYear),("":package){0-1},("":logo){0-1},("":gumpRepositoryId){0-1},("":description){0-1},("":shortDescription),("":url){0-1},("":issueTrackingUrl){0-1},("":siteAddress){0-1},("":siteDirectory){0-1},("":distributionDirectory){0-1},("":repository){0-1},("":versions){0-1},("":branches){0-1},("":mailingLists){0-1},("":developers),("":contributors){0-1},("":licenses){0-1},("":dependencies){0-1},("":build),("":reports){0-1},("":properties){0-1})'.
    [validate] [ERROR] cvc-complex-type.2.4.b: The content of element 
'repository' is not complete. It must match 
'(("":connection),("":developerConnection){0-1},("":url){0-1})'.

BUILD FAILED
File...... file:/home/daniel/.maven/plugins/maven-pom-plugin-1.3-SNAPSHOT/
Element... validate
Line...... 43
Column.... 42
validation error. the error message should have been provided
Total time:  2 seconds

which is fine, I expect it to fail.

Then I add <connection>bogus</connection> to the repository tag as follows:
  <repository>
    <connection>bogus</connection>
  </repository>

and I get:

[validate] [ERROR] cvc-complex-type.2.4.a: Invalid content starting with 
element 'repository'. The content must match 
'(("":extend){0-1},("":pomVersion),("":id),("":name),("":groupId){0-1},("":currentVersion),("":organization),("":inceptionYear),("":package){0-1},("":logo){0-1},("":gumpRepositoryId){0-1},("":description){0-1},("":shortDescription),("":url){0-1},("":issueTrackingUrl){0-1},("":siteAddress){0-1},("":siteDirectory){0-1},("":distributionDirectory){0-1},("":repository){0-1},("":versions){0-1},("":branches){0-1},("":mailingLists){0-1},("":developers),("":contributors){0-1},("":licenses){0-1},("":dependencies){0-1},("":build),("":reports){0-1},("":properties){0-1})'.

BUILD FAILED
File...... file:/home/daniel/.maven/plugins/maven-pom-plugin-1.3-SNAPSHOT/
Element... validate
Line...... 43
Column.... 42
validation error. the error message should have been provided
Total time:  2 seconds


Shouldn't the validation succeed over the pom incuding the repository and 
connection tags?
Is it something to do with the error line I get on the minimal pom validation 
perhaps?

Thanks
Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to