You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marco Mistroni <mm...@gmail.com> on 2005/09/09 18:01:17 UTC
problems with Maven 1.1 -beta-1 in defining entities in project.xml
hello all,
i have following project.xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE project [
<!ENTITY xdoclet-commons SYSTEM
"file:${basedir}/xdoclet-commons.ent">
]>
<!-- $Revision: 1.6 $ $Date: 2004/04/27 00:39:55 $ -->
<project>
<name>NRFX :: EJB Unit Testing Examples</name>
<id>ejb-testing-examples</id>
<groupId>nrfx</groupId>
<currentVersion>1.0</currentVersion>
<inceptionYear>2004</inceptionYear>
<package>com.nrfx.articles.openejb</package>
<organization>
<name>NRFX Technologies LLC</name>
<url>http://www.nrfx.com/</url>
<logo>http://www.nrfx.com/images/logo01.gif</logo>
</organization>
<description>
EJB unit testing examples to accompany my OpenEJB article
</description>
<dependencies>
&xdoclet-commons;
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-j2ee</artifactId>
<version>1.4-rc1</version>
</dependency>
<dependency>
<groupId>dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector</artifactId>
<version>3.0.11</version>
</dependency>
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-j2ee</artifactId>
<version>1.4-rc1</version>
</dependency>
<dependency>
<groupId>openejb</groupId>
<artifactId>openejb-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<id>log4j</id>
<version>1.2.8</version>
<url>http://jakarta.apache.org/log4j</url>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.6.0</version>
<url>http://xml.apache.org</url>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<id>xml-apis</id>
<version>1.0.b2</version>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<id>castor</id>
<version>0.9.5.3 <http://0.9.5.3></version>
<url>http://www.castor.org</url>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<id>oro</id>
<version>2.0.8</version>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.3</version>
<url>http://jakarta.apache.org/commons/logging/</url>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<!--
required for the database connection configured in
the openejb.conf
-->
<dependency>
<groupId>axion</groupId>
<artifactId>axion</artifactId>
<version>1.0-M3-dev</version>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<!-- required by axion -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>2.1</version>
<properties>
<repository>true</repository>
</properties>
</dependency>
<dependency>
<groupId>commons-primitives</groupId>
<artifactId>commons-primitives</artifactId>
<version>1.0</version>
<properties>
<repository>true</repository>
</properties>
</dependency>
<dependency>
<groupId>regexp</groupId>
<artifactId>regexp</artifactId>
<version>1.3</version>
<properties>
<repository>true</repository>
</properties>
</dependency>
</dependencies>
<!-- =================== -->
<!-- Build Specification -->
<!-- =================== -->
<build>
<sourceDirectory>${basedir}/src/java</sourceDirectory>
<unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory>
<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>
<resources>
<resource>
<directory>${basedir}/src/conf</directory>
<includes>
<include>*.*</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</unitTest>
<resources>
<resource>
<directory>${basedir}/src/conf</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
</project>
with Maven 1.1-beta1 i am getting following exception ..
org.apache.maven.MavenException: Unknown error reading project
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:146)
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:99)
at org.apache.maven.MavenSession.initializeRootProject(MavenSession.java
:232)
at org.apache.maven.MavenSession.initialize(MavenSession.java:172)
at org.apache.maven.cli.App.doMain(App.java:498)
at org.apache.maven.cli.App.main(App.java:1258)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
--- Nested Exception ---
org.apache.maven.MavenException: Error parsing project.xml'C:\FILESTOBECOPIED\T
estEJB\project.xml'
at org.apache.maven.MavenUtils.getNonJellyProject(MavenUtils.java:189)
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:120)
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:99)
at org.apache.maven.MavenSession.initializeRootProject(MavenSession.java
:232)
at org.apache.maven.MavenSession.initialize(MavenSession.java:172)
at org.apache.maven.cli.App.doMain(App.java:498)
at org.apache.maven.cli.App.main(App.java:1258)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
--- Nested Exception ---
org.codehaus.plexus.util.xml.pull.XmlPullParserException: could not resolve
enti
ty named 'xdoclet-commons' (position: START_TAG seen
...<dependencies>\r\n\r\n
&xdoclet-commons;... @29:23)
at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl(MXParser.java:127
8)
at org.codehaus.plexus.util.xml.pull.MXParser.next(MXParser.java:1089)
at org.codehaus.plexus.util.xml.pull.MXParser.nextTag(MXParser.java:1074
)
at org.apache.maven.project.io.xpp3.MavenXpp3Reader.parseModel(MavenXpp3
Reader.java:852)
at org.apache.maven.project.io.xpp3.MavenXpp3Reader.read(MavenXpp3Reader
.java:1621)
at org.apache.maven.project.Project.<init>(Project.java:120)
at org.apache.maven.MavenUtils.getNonJellyProject(MavenUtils.java:185)
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:120)
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:99)
at org.apache.maven.MavenSession.initializeRootProject(MavenSession.java
:232)
at org.apache.maven.MavenSession.initialize(MavenSession.java:172)
at org.apache.maven.cli.App.doMain(App.java:498)
at org.apache.maven.cli.App.main(App.java:1258)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
i had it working for ages wiht maven 1.0 .. anyone could explain me how to
fix the problem?
thanx and regards
marco
Re: problems with Maven 1.1 -beta-1 in defining entities in
project.xml
Posted by Andy Glick <an...@acm.org>.
Marco,
When I executed "maven pom:validate" on your project.xml file I found 2
lines that the Modello generated parser rejected.
1) Maven 1.1 no longer supports XML entities as a means of including XML
fragments, though still supports character entities
<!-- &xdoclet-commons;-->
so commenting out this line allowed the parser to get to the next problem
if you would like to reference dependencies declared in another file, the
current Maven 1 convention is to use <extend>[pom path
spec]/project.xml</extend> and reference a project.xml file which has the
required dependencies declared within it. I've tended to do this by
creating my own project.xml files which i put in maven.local.repo - but you
can actually put the file where you want to and name the file whatever you want
because the parser recognizes ${maven.local.repo} I tend to put POMS that
I've written to aggregate dependencies in my local repository - an example
from one of my POM files would be
<extend>${maven.repo.local}/alg/poms/jakarta-commons-dependencies.pom</extend>
2) Maven 1.1 will attempt to locate a file which matches the version String
that you give it - so the following line causes a problem as Maven attempts
to locate and download a file named "castor-0.9.5.3 <http://0.9.5.3>.jar"
if you remove the embedded URL and the GT and LT
<!-- <version>0.9.5.3 <http://0.9.5.3></version> -->
<version>0.9.5.3</version>
Maven will attempt to locate and download castor-0.9.5.3.jar, which it
successfully did in my environment
I'm sorry to say that I'm not at all sure what you are trying to accomplish
with this syntax. When I attempted to process the POM file before changiong
the line, Maven did attempt to download a file with the odd name that
appears above.
Hope that this helps.
Best regards,
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org