Sharing this so someone else might be helped later.
 
I ran into this stack trace:
 

[INFO] [war:war]
[INFO] Exploding webapp...
[INFO] Assembling webapp myapp in C:\code\myapp \target\myapp
-1.4.0-SNAPSHOT
[INFO] Copy webapp webResources to C:\code\myapp \target\myapp
-1.4.0-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] org.apache.maven.project.MavenProject
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.ClassCastException: org.apache.maven.project.MavenProject
        at
org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFil
terReader.java:269)
        at
org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFil
terReader.java:162)
        at java.io.Reader.read(Reader.java:122)
        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(AbstractWar
Mojo.java:921)
        at
org.apache.maven.plugin.war.AbstractWarMojo.copyResources(AbstractWarMoj
o.java:415)
        at
org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.
java:518)
        at
org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(Abstract
WarMojo.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(DefaultPluginMa
nager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:48
0)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:459)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.jav
a:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.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:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        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)
 
It seemed to hit this error when there was an images directory that had
filtering on.  
 
Caused the problem when it hit ${basedir}/web/images:
           <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>${basedir}/web</directory>
                            <filtering>true</filtering>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
 
Fixed the problem:
 
           <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>${basedir}/web</directory>
                            <filtering>false</filtering>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
 
Paul Sundling

Reply via email to