maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Jensen <jeffjen...@nospam.visi.com>
Subject Maven schema minOccurs setting on <version> in <dependency>
Date Tue, 10 May 2005 18:05:05 GMT
In maven-project-n.xsd (both 3 and 4), <version> is a required element of
<dependency>.  This requirement seems to conflict with the purpose of <jar>. 
Do I understand things correctly?

This setting causes our project.xml file to fail validation because some of the
jars we depend on do not follow the version naming scheme, therefore we must
use the <jar> tag and not <version>.

If so, should a change request be to make them mutually exclusive?

If so again ;-), I suggest this simple change to the schema for <dependency>:

>From this:

  <!-- /dependencies/dependency element -->
  <xs:element name="dependency">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="id" minOccurs="0" />
        <xs:element ref="groupId" minOccurs="0" />
        <xs:element ref="artifactId" minOccurs="0" />
        <xs:element name="version" type="xs:string" />
        <xs:element ref="jar" minOccurs="0"/>
        <xs:element ref="type" minOccurs="0"/>
        <xs:element ref="url" minOccurs="0"/>
        <xs:element ref="properties" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

To this:

<!-- /dependencies/dependency element -->
<xs:element name="dependency">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="id" minOccurs="0"/>
      <xs:element ref="groupId" minOccurs="0"/>
      <xs:element ref="artifactId" minOccurs="0"/>
      <xs:choice>
        <xs:element name="version" type="xs:string"/>
        <xs:element ref="jar"/>
      </xs:choice>
      <xs:element ref="type" minOccurs="0"/>
      <xs:element ref="url" minOccurs="0"/>
      <xs:element ref="properties" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>


This change will require nothing except either <version> or <jar>, which seems
to be the original intent(?).

Should any more of them be required too?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message