You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Samuel Le Berrigaud <sa...@gmail.com> on 2005/10/18 16:02:58 UTC

[m2] Pb with test resources

Hi,

I have soime test specific resources for one project. They are
specified this way in my POM:

 <build>
  <testResources>
   <resource>
    <targetPath>conf</targetPath>
    <directory>src/test/conf</directory>
    <includes>
     <include>*.properties</include>
    </includes>
   </resource>
   <resource>
    <targetPath>xml</targetPath>
    <directory>src/test/xml</directory>
    <includes>
     <include>*.xml</include>
     <include>*.xsl</include>
    </includes>
   </resource>
   <resource>
    <targetPath>expected</targetPath>
    <directory>src/test/expected</directory>
    <includes>
     <include>*.xml</include>
     <include>*.html</include>
     <include>*.pdf</include>
    </includes>
   </resource>
  </testResources>
  ...
</build>

When running the tests (or any goal) I got this error:

$ m2 install -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: unknown
POM Location: e:\SCM_LOCAL\arcam\ahpxml\pom.xml

Reason: Parse error reading POM


[INFO] ----------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Parse error reading POM
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:359)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:276)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.InvalidProjectModelException:
Parse error reading POM
        at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1097)
        at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1057)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFile(DefaultMavenProjectBuilder.java:291)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:276)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:509)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:441)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:345)
        ... 11 more
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
TEXT must be immediately followed by END_TAG and not START_TAG
(positio
n: START_TAG seen ...<resource>\r\n    <targetPath>... @91:17)
        at org.codehaus.plexus.util.xml.pull.MXParser.nextText(MXParser.java:1060)
        at org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseBuild(MavenXpp3Reader.java:646)
        at org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseModel(MavenXpp3Reader.java:2131)
        at org.apache.maven.model.io.xpp3.MavenXpp3Reader.read(MavenXpp3Reader.java:4255)
        at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1093)
        ... 17 more

The odd thing is that if I change the tag "testResources" with
"resources", it works and my tests pass sucessfully ! Am I doing
something wrong ?

Thanks,

SaM

Re: [m2] Pb with test resources

Posted by Samuel Le Berrigaud <sa...@gmail.com>.
It worked,

Thank you !

On 10/18/05, Yann Le Du <le...@yahoo.com> wrote:
>
> Hi Samuel,
>
> There is a bug in doco. In <testResources> you must use <testResource> .
>
> (In <foos> you must generally use <foo> )
>
> Regards,
> Yann
>
>
>
> --- Samuel Le Berrigaud <sa...@gmail.com> a écrit :
>
> > Hi,
> >
> > I have soime test specific resources for one project. They are
> > specified this way in my POM:
> >
> > <build>
> > <testResources>
> > <resource>
> > <targetPath>conf</targetPath>
> > <directory>src/test/conf</directory>
> > <includes>
> > <include>*.properties</include>
> > </includes>
> > </resource>
> > <resource>
> > <targetPath>xml</targetPath>
> > <directory>src/test/xml</directory>
> > <includes>
> > <include>*.xml</include>
> > <include>*.xsl</include>
> > </includes>
> > </resource>
> > <resource>
> > <targetPath>expected</targetPath>
> > <directory>src/test/expected</directory>
> > <includes>
> > <include>*.xml</include>
> > <include>*.html</include>
> > <include>*.pdf</include>
> > </includes>
> > </resource>
> > </testResources>
> > ...
> > </build>
> >
> > When running the tests (or any goal) I got this error:
> >
> > $ m2 install -e
> > + Error stacktraces are turned on.
> > [INFO] Scanning for projects...
> > [INFO]
> >
> ----------------------------------------------------------------------------
> > [ERROR] FATAL ERROR
> > [INFO]
> >
> ----------------------------------------------------------------------------
> > [INFO] Error building POM (may not be this project's POM).
> >
> >
> > Project ID: unknown
> > POM Location: e:\SCM_LOCAL\arcam\ahpxml\pom.xml
> >
> > Reason: Parse error reading POM
> >
> >
> > [INFO]
> >
> ----------------------------------------------------------------------------
> > [INFO] Trace
> > org.apache.maven.reactor.MavenExecutionException: Parse error reading
> POM
> > at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:359)
> > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:276)
> > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
> > at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> > sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:324)
> > at
> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> > at
> > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> > at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> > Caused by: org.apache.maven.project.InvalidProjectModelException:
> > Parse error reading POM
> > at
> >
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel(
> DefaultMavenProjectBuilder.java:1097)
> > at
> >
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel(
> DefaultMavenProjectBuilder.java:1057)
> > at
> >
> org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFile(
> DefaultMavenProjectBuilder.java:291)
> > at
> >
> org.apache.maven.project.DefaultMavenProjectBuilder.build(
> DefaultMavenProjectBuilder.java:276)
> > at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:509)
> > at
> > org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:441)
> > at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:345)
> > ... 11 more
> > Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
> > TEXT must be immediately followed by END_TAG and not START_TAG
> > (positio
> > n: START_TAG seen ...<resource>\r\n <targetPath>... @91:17)
> > at
> > org.codehaus.plexus.util.xml.pull.MXParser.nextText(MXParser.java:1060)
> > at
> >
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseBuild(
> MavenXpp3Reader.java:646)
> > at
> >
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseModel(
> MavenXpp3Reader.java:2131)
> > at
> >
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.read(MavenXpp3Reader.java
> :4255)
> > at
> >
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel(
> DefaultMavenProjectBuilder.java:1093)
> > ... 17 more
> >
> > The odd thing is that if I change the tag "testResources" with
> > "resources", it works and my tests pass sucessfully ! Am I doing
> > something wrong ?
> >
> > Thanks,
> >
> > SaM
> >
>
>
>
>
>
>
>
>
> ___________________________________________________________________________
> Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
> Téléchargez cette version sur http://fr.messenger.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Samuel Le Berrigaud

Re: [m2] Pb with test resources

Posted by Wendy Smoak <ws...@apache.org>.
From: "Yann Le Du" <le...@yahoo.com>

> There is a bug in doco. In <testResources> you must use <testResource> .
> (In <foos> you must generally use <foo> )

Another one like this is <activation>, where the docs still say you should 
use <activationProperty> but it's supposed to be <property>.

I've found that Google has indexed the JIRA tickets, so putting in some of 
the error message and the tag that's causing a problem will often turn up a 
hint.  And hopefully they'll publish updated docs soon.

That and JEdit will complain if you type something that doesn't conform to 
the schema:
pom.xml:49:cvc-complex-type.2.4.a: Invalid content starting with element 
'activationProperty'.

-- 
Wendy Smoak 


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


RE: [m2] Pb with test resources

Posted by Yann Le Du <le...@yahoo.com>.
Hi Samuel,

There is a bug in doco. In <testResources> you must use <testResource> .

(In <foos> you must generally use <foo> )

Regards,
Yann



--- Samuel Le Berrigaud <sa...@gmail.com> a écrit :

> Hi,
> 
> I have soime test specific resources for one project. They are
> specified this way in my POM:
> 
>  <build>
>   <testResources>
>    <resource>
>     <targetPath>conf</targetPath>
>     <directory>src/test/conf</directory>
>     <includes>
>      <include>*.properties</include>
>     </includes>
>    </resource>
>    <resource>
>     <targetPath>xml</targetPath>
>     <directory>src/test/xml</directory>
>     <includes>
>      <include>*.xml</include>
>      <include>*.xsl</include>
>     </includes>
>    </resource>
>    <resource>
>     <targetPath>expected</targetPath>
>     <directory>src/test/expected</directory>
>     <includes>
>      <include>*.xml</include>
>      <include>*.html</include>
>      <include>*.pdf</include>
>     </includes>
>    </resource>
>   </testResources>
>   ...
> </build>
> 
> When running the tests (or any goal) I got this error:
> 
> $ m2 install -e
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO]
> ----------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Error building POM (may not be this project's POM).
> 
> 
> Project ID: unknown
> POM Location: e:\SCM_LOCAL\arcam\ahpxml\pom.xml
> 
> Reason: Parse error reading POM
> 
> 
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.reactor.MavenExecutionException: Parse error reading POM
>         at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:359)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:276)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.project.InvalidProjectModelException:
> Parse error reading POM
>         at
>
org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1097)
>         at
>
org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1057)
>         at
>
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFile(DefaultMavenProjectBuilder.java:291)
>         at
>
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:276)
>         at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:509)
>         at
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:441)
>         at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:345)
>         ... 11 more
> Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
> TEXT must be immediately followed by END_TAG and not START_TAG
> (positio
> n: START_TAG seen ...<resource>\r\n    <targetPath>... @91:17)
>         at
> org.codehaus.plexus.util.xml.pull.MXParser.nextText(MXParser.java:1060)
>         at
>
org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseBuild(MavenXpp3Reader.java:646)
>         at
>
org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseModel(MavenXpp3Reader.java:2131)
>         at
>
org.apache.maven.model.io.xpp3.MavenXpp3Reader.read(MavenXpp3Reader.java:4255)
>         at
>
org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1093)
>         ... 17 more
> 
> The odd thing is that if I change the tag "testResources" with
> "resources", it works and my tests pass sucessfully ! Am I doing
> something wrong ?
> 
> Thanks,
> 
> SaM
> 



	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com

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