You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stephane Nicoll (JIRA)" <ji...@codehaus.org> on 2008/02/16 08:47:29 UTC

[jira] Closed: (MWAR-109) Problem using webResources in configuration

     [ http://jira.codehaus.org/browse/MWAR-109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephane Nicoll closed MWAR-109.
--------------------------------

       Resolution: Duplicate
    Fix Version/s: 2.1-alpha-2

It really looks like the other one. Let's fix this as duplicate. David, reopen if you can still reproduce.

> Problem using webResources in configuration
> -------------------------------------------
>
>                 Key: MWAR-109
>                 URL: http://jira.codehaus.org/browse/MWAR-109
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2, 2.1-alpha-1
>            Reporter: David Castro
>             Fix For: 2.1-alpha-2
>
>
> I have been trying to get web resources into a resources directory where I can have them copied over during packaging and filtered as necessary.  With 2.0 the targetPath doesn't work.  And with 2.0.2 and 2.0.3-SNAPSHOT I can't seem to configure without it blowing up at all.  They both die at the IOUtil.copy call in AbstractWarMojo
> org.apache.maven.plugin.war.AbstractWarMojo.copyFilteredFile(AbstractWarMojo.java:921)
> ---
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-war-plugin</artifactId>
>         <version>2.0.2</version> <!-- also tried with 2.0.3-SNAPSHOT from head -->
>         <configuration>
>           <webResources>
>             <resource>
>               <targetPath>WEB-INF/spring</targetPath>
>               <filtering>true</filtering>
>               <directory>src/main/resources/WEB-INF/spring</directory>
>               <includes>
>                 <include>*.xml</include>
>                 <include>*.properties</include>
>               </includes>
>             </resource>
>           </webResources>
>         </configuration>
>       </plugin>
> ---
> [INFO] Copy webapp webResources to /home/arimus/workspace-ym/ym/ym-proj/ym-web/target/myapp
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] org.apache.maven.project.MavenProject cannot be cast to java.lang.String
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.ClassCastException: org.apache.maven.project.MavenProject cannot be cast to java.lang.String
>         at org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterReader.java:269)
>         at org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterReader.java:201)
>         at org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterReader.java:162)
>         at java.io.Reader.read(Reader.java:123)
>         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.war.AbstractWarMojo.copyFilteredFile(AbstractWarMojo.java:921)
>         at org.apache.maven.plugin.war.AbstractWarMojo.copyResources(AbstractWarMojo.java:415)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:518)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:347)
>         at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:164)
>         at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:130)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
>         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:597)
>         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)

-- 
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