- This topic has 5 replies, 2 voices, and was last updated 19 years, 12 months ago by
Riyad Kalla.
-
AuthorPosts
-
Pedro RozoMemberHi
I am getting this message during the validation phase of all my maven projects:
cvc-elt.1: Cannot find the declaration of element ‘project’. maven.xml
I found a similar message in your 3.8.1 bugs forums, but I didn’t find the final solution there.
Currently I am running eclipse 3.0.1, myeclipse 3.8.4 and maven 1.0.2
Do I need to add any specific XML namespace declaration within myeclipse xml configuration ?
Pedro Rozo
vancouver, BC
Canada
Riyad KallaMemberDo I need to add any specific XML namespace declaration within myeclipse xml configuration ?
Possibly, can you paste the contents of your XML file so we can try and duplicate what is happening over here?
Pedro RozoMemberOk, Here my XML file: maven.xml.
<?xml version=”1.0″ encoding=”UTF-8″?>
<project xmlns:j=”jelly:core” xmlns:ant=”jelly:ant” xmlns:maven=”jelly:maven” default=”copylib”><j:set var=”project.ear.dep.includes” value=””/>
<j:set var=”project.ear.dep.names” value=””/>
<j:forEach var=”dep” items=”${pom.dependencies}”>
<j:set var=”project.ear.dep.includes” value=”${dep.getArtifactId()}/project.xml,${project.ear.dep.includes}”/>
<j:set var=”project.ear.dep.names” value=”${dep.getArtifactId()}-${dep.getVersion()}.*,${project.ear.dep.names}”/>
</j:forEach>
<echo>Dependent project POMs: ${project.ear.dep.includes}</echo><goal name=”copylib” description=”Copy project libraries”>
<j:forEach var=”lib” items=”${pom.artifacts}”>
<j:set var=”dep” value=”${lib.dependency}”/>
<j:if test=”${dep.getProperty(‘ear.bundle’)==’true’ || dep.getProperty(‘ear.module’)==’true’}”>
<j:set var=”bundleDir” value=”${dep.getProperty(‘ear.bundle.dir’)}”/>
<j:if test=”${!empty(bundleDir)}”>
<j:set var=”bundleName” value=”${dep.getProperty(‘ear.bundle.name’)}”/>
<j:if test=”${empty(bundleName)}”>
<j:set var=”bundleName” value=”${lib.name}”/>
</j:if>
<j:set var=”bundlePath” value=”${bundleDir}/${bundleName}”/><echo>Copying ${lib.file.name} as ${bundlePath}</echo>
<ant:copy file=”${lib.file.parent}/${lib.file.name}” tofile=”${bundlePath}”/>
</j:if>
</j:if>
</j:forEach>
</goal><preGoal name=”ear:ear”>
<ant:move file=”${basedir}/META-INF/application.xml” tofile=”${basedir}/application.xml.orig”/>
<ant:move file=”${basedir}/META-INF/maven-application.xml” tofile=”${basedir}/META-INF/application.xml”/>
</preGoal><postGoal name=”ear:ear”>
<ant:move file=”${basedir}/META-INF/application.xml” tofile=”${basedir}/META-INF/maven-application.xml”/>
<ant:move file=”${basedir}/application.xml.orig” tofile=”${basedir}/META-INF/application.xml”/>
</postGoal><goal name=”build”>
<attainGoal name=”ear:install”/>
</goal><goal name=”project:build”>
<maven:reactor
basedir=”..”
banner=”Build project dependencies”
includes=”${project.ear.dep.includes}”
excludes=”${pom.artifactId}/project.xml”
postProcessing=”true”
goals=”build”
ignoreFailures=”true”
/>
<attainGoal name=”ear:install”/>
</goal><goal name=”cleanlib”>
<ant:delete>
<ant:fileset dir=”APP-INF/lib” includes=”**”/>
</ant:delete>
</goal><postGoal name=”eclipse”>
<attainGoal name=”copylib”/>
</postGoal></project>
Riyad KallaMemberYes the problem is you are missing a doctype or schema reference for this file.
Pedro RozoMemberI am not completely familiar with the maven XML schemas so Could you send me an example of a validated maven.xml file in Myeclipse to compare and see ho can I fix this topic?
Riyad KallaMemberI am not completely familiar with the maven XML schemas so Could you send me an example of a validated maven.xml
Hmmm I’ve never used Maven, and as far as MyEclipse all it is doing to validate your files is run the Xerces XML parser against it. So while your file can still be parsed, it is not valid according to XML specification.
The first place I would look is download samples from Maven’s site of other projects and see what the XSD definition looks like for those maven.xml files. If none of the files have a defined schema in them, then you can actually turn OFF validation on this particular file from MyEclipse by opening the file properties, and selecting “Derived”, then right clicking on your project go to MyEclipse and “Remove all Error Markers”. Now this file will still be edited as it was, but you will no longer get validation errors.
People have to do this too with XDoclet files because even though they have .xml endings, they are not valid XML.
-
AuthorPosts