You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Lars Rosenberg Nielsen (JIRA)" <ji...@codehaus.org> on 2006/02/15 23:04:19 UTC

[jira] Created: (MNG-2076) classcastexception when filtering a test resource with a ${basedir} defined

classcastexception when filtering a test resource with a ${basedir} defined
---------------------------------------------------------------------------

         Key: MNG-2076
         URL: http://jira.codehaus.org/browse/MNG-2076
     Project: Maven 2
        Type: Bug

    Reporter: Lars Rosenberg Nielsen


I got a classcastexception when trying to filter a test resource with a ${basedir} defined.


mvn -e test

[INFO] Trace
java.lang.ClassCastException: java.io.File
        at org.codehaus.plexus.util.InterpolationFilterReader.read(Interpolation
FilterReader.java:269)
        at org.codehaus.plexus.util.InterpolationFilterReader.read(Interpolation
FilterReader.java:162)
        at java.io.Reader.read(Reader.java:100)
        at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
        at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:200)
        at org.apache.maven.plugin.resources.ResourcesMojo.copyFile(ResourcesMoj
o.java:249)
        at org.apache.maven.plugin.resources.ResourcesMojo.copyResources(Resourc
esMojo.java:172)
        at org.apache.maven.plugin.resources.TestResourcesMojo.execute(TestResou
rcesMojo.java:53)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:415)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:531)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:472)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:303)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:270)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:139)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        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(DelegatingMethodAcces
sorImpl.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)
[INFO] -------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (MNG-2076) classcastexception when filtering a test resource with a ${basedir} defined

Posted by "Lars Rosenberg Nielsen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2076?page=comments#action_58750 ] 

Lars Rosenberg Nielsen commented on MNG-2076:
---------------------------------------------

it is actually more general than reported. If I reference ${basedir} or ${pom.basedir} in a filtered resource or in the filter properties file then I get the classcastexception as described.


> classcastexception when filtering a test resource with a ${basedir} defined
> ---------------------------------------------------------------------------
>
>          Key: MNG-2076
>          URL: http://jira.codehaus.org/browse/MNG-2076
>      Project: Maven 2
>         Type: Bug

>     Reporter: Lars Rosenberg Nielsen

>
>
> I got a classcastexception when trying to filter a test resource with a ${basedir} defined.
> mvn -e test
> [INFO] Trace
> java.lang.ClassCastException: java.io.File
>         at org.codehaus.plexus.util.InterpolationFilterReader.read(Interpolation
> FilterReader.java:269)
>         at org.codehaus.plexus.util.InterpolationFilterReader.read(Interpolation
> FilterReader.java:162)
>         at java.io.Reader.read(Reader.java:100)
>         at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
>         at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:200)
>         at org.apache.maven.plugin.resources.ResourcesMojo.copyFile(ResourcesMoj
> o.java:249)
>         at org.apache.maven.plugin.resources.ResourcesMojo.copyResources(Resourc
> esMojo.java:172)
>         at org.apache.maven.plugin.resources.TestResourcesMojo.execute(TestResou
> rcesMojo.java:53)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:415)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:531)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:472)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:451)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:303)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:270)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:139)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>         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(DelegatingMethodAcces
> sorImpl.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)
> [INFO] -------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (MNG-2076) classcastexception when filtering a test resource with a ${basedir} defined

Posted by "Kees de Kooter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2076?page=comments#action_59119 ] 

Kees de Kooter commented on MNG-2076:
-------------------------------------

I am getting the same exception. In my case there is a property I defined myself (${spring.contextconfiglocation} to be exact) that is causing the exception.

> classcastexception when filtering a test resource with a ${basedir} defined
> ---------------------------------------------------------------------------
>
>          Key: MNG-2076
>          URL: http://jira.codehaus.org/browse/MNG-2076
>      Project: Maven 2
>         Type: Bug

>     Reporter: Lars Rosenberg Nielsen

>
>
> I got a classcastexception when trying to filter a test resource with a ${basedir} defined.
> mvn -e test
> [INFO] Trace
> java.lang.ClassCastException: java.io.File
>         at org.codehaus.plexus.util.InterpolationFilterReader.read(Interpolation
> FilterReader.java:269)
>         at org.codehaus.plexus.util.InterpolationFilterReader.read(Interpolation
> FilterReader.java:162)
>         at java.io.Reader.read(Reader.java:100)
>         at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
>         at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:200)
>         at org.apache.maven.plugin.resources.ResourcesMojo.copyFile(ResourcesMoj
> o.java:249)
>         at org.apache.maven.plugin.resources.ResourcesMojo.copyResources(Resourc
> esMojo.java:172)
>         at org.apache.maven.plugin.resources.TestResourcesMojo.execute(TestResou
> rcesMojo.java:53)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:415)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:531)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:472)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:451)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:303)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:270)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:139)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>         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(DelegatingMethodAcces
> sorImpl.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)
> [INFO] -------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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