|
"1. The element project.id should be removed from the XML schema" 2. The element project.artifactId should be added to the XML schema 3. Documentation needs to be updated to reflect the above issues 1. OK, it stays in POM3. 2. To add "artifactId" and still keep "id" we should probably use a "choice" in the XML schema. See attached patch for an example of how this can be done. 3. I will start writing documentation patches for the HEAD branch, unless someone objects. Documentation patches for the HEAD branch. Changelog: Thanks - looks good. Could you possibly redo the HEAD patch without the whitespace changes? diff -wb I think. The XSD change should be applied to MAVEN-1_0-BRANCH as well on the maven-project.xsd file. Oops! An IDE that eats whitespace at the end of lines and a diff-tool with the "Ignore differences in whitespace"-checkbox checked is a dangerous combination A new version of the documentation patches is attached. Added a patch for the XSD for MAVEN-1_0-BRANCH. Does maven scm:cvs-create-patch create a correct patch file, or does that goal need changing to handle whitespace? I wouldn't know that. The patches I have made so far have been made using command-line CVS. Next time I will try to use the scm-plugin. Running: in 1.1, an XSD, documentation and java code are all generated from one source, so should be a non-issue. The new modello stuff sound neat. But don't you think that we should fix the XSD in maven-1_0-BRANCH? The current (1.0) validation features built into Maven does not work. A perfectly valid pom (that uses artifactId instead of id) does not validate when you do "maven pom:validate". This is very confusing for new users. yes, I intend to copy the same schema to the 1_0 branch Please adjust the xsd at http://maven.apache.org/xsd/ The Id is always mandatory in the xsd..... and thus in the pom plugin Actually, the id element is only mandatory in stand-alone poms, ie in pom-strict-3.xsd, which is part of the pom plugin, so I think this issue can be regarded as superceded by Let's see if I understand this correctly. If I use the latest trunk version of the pom plugin I will be able to validate a project.xml file that has groupId and artifactId but no id element. Is that correct? That's correct. If you can confirm, I think we can close this now as I also updated the docs yesterday. Here are my findings after testing this. First I nuked my maven-1.0.2 installation and ${user.home}/.maven Tried validating the project.xml for commons-logging after adding a project element (the long version) with namespace, as given on the validation page on the plugin's site. It complained that the pom was missing the id element. Installed maven-pom-plugin-1.5.1-SNAPSHOT from source BUILD FAILED
File...... C:\Documents and Settings\dlg01\.maven\cache\maven-pom-plugin-1.5\plugin.jelly
Element... assert:assertPluginAvailable
Line...... 69
Column.... 42
java.lang.NullPointerException
After a while I figured out that I needed plugin-plugin-1.7. That should be noted somewhere on the site. A better error message would be nice too... Installed maven-plugin-plugin-1.7 Using xsd file: C:\Documents and Settings\dlg01\.maven\cache\maven-pom-plugin-1.5.1-SNAPSHOT\plugin-resources/xsd/pom-strict-3.xsd
ERROR on line 20 of file project.xml,
XPath location /project:
namespace URI of tag "project" is wrong. It must be "http://maven.apache.org/POM/3.0.0"
G:\apache\jakarta\commons-logging\project.xml is NOT valid!
BUILD SUCCESSFUL
I double and tripple checked the project element and the url and they are the same as the ones that are described in the validation.xml document. I don't know if the BUILD SUCCESSFUL indicates that the validation succeded or not. The plugin-plugin-1.7 is indicated here: http://maven.apache.org/maven-1.x/plugins/pom/goals.html I missed the documentation on goals page for plugin-plugin, so that's OK. Gaaaa! it's time for me to go to bed now. I was validating in the wrong directory! Too many versions of commons-logging checked out... Validating in the correct directory produced this satisfactory output: Using xsd file: C:\Documents and Settings\dlg01\.maven\cache\maven-pom-plugin-1.5.1-SNAPSHOT\plugin-resources/xsd/pom-strict-3.xsd G:\apache\jakarta\jakarta-commons\logging\project.xml verified: OK BUILD SUCCESSFUL |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Please do not change the schema for POM-3. Please only update the documentation. Otherwise existent projects may break (my will, as I've had problems with the POM, found the schema and corrected my POMs to contain id instead of artifactId. However, there are inconsistencies I know about: ${pom.id} returns groupId:artifactId, while ${pom.artifactId} returns the id. IMO it would be better to release POM-4, so projects can be moved to this. Please provide a doc then, how to move, or - better - provide a tool/plugin for this move.