hi all
i m experiencing some errors with Maven2 war plugin
situationis like this

i am trying to use maven2 with an existing project (developed in RAD)
heres' the project structure

webProject
 |---- JavaSource
    |--------com ...
    |--------mw
         |___resources
            |____ appresources.properties
         |___configurations
            |____ myPopulator.xml
 |___ WebContent
    |__ WEB-INF
    ...misc jsp files

now, my problem is that , in the mw directory,  the   'resources' directory
files should go under  WEB-INF\classes and the
     configurations/myPopulator.xml should go under WEB-INF
i m tyring to use maven2 filtering, i want to avoid use ant tasks..
here's the excerpt

<plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <configuration>
       <warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
       <webResources>
          <resource>
                <directory>${basedir}/JavaSource/ngenmw</directory>
                <excludes>
                   <exclude>**/dataSourcePopulator.xml</exclude>
                </excludes>
          </resource>
          <resource>

<directory>${basedir}/JavaSource/ngenmw/configurations</directory>
                <targetPath>WEB-INF</targetPath>
                <filtering>true</filtering>
          </resource>
       </webResources>
         </configuration>
 </plugin>

according ot docs of maven war plugin, i can do the above... but when i
launch mvn it results in the following exception

[INFO] Executed tasks
[INFO] [war:war]
[INFO] Exploding webapp...
[INFO] Copy webapp webResources to
D:\Sw\step-by-step\middleware\ngenMiddlewareW
eb\target\ngenMiddlewareWeb-1.0-SNAPSHOT
[INFO] Copy webapp webResources to
D:\Sw\step-by-step\middleware\ngenMiddlewareW
eb\target\ngenMiddlewareWeb-1.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
(Interpolation
FilterReader.java:269)
       at org.codehaus.plexus.util.InterpolationFilterReader.read
(Interpolation
FilterReader.java:201)
       at org.codehaus.plexus.util.InterpolationFilterReader.read
(Interpolation
FilterReader.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
(Abstract
WarMojo.java:907)
       at org.apache.maven.plugin.war.AbstractWarMojo.copyResources
(AbstractWar
Mojo.java:442)
       at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp
(Abstr
actWarMojo.java:355)
       at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java
:161
)
       at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:127)
       at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPlugi
nManager.java:412)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(Defa
ultLifecycleExecutor.java:534)
       at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:475)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(Defau
ltLifecycleExecutor.java:454)
       at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:306)
       at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:273)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLi
fecycleExecutor.java:140)
       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:256)
       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 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]
------------------------------------------------------------------------


anyone could hlep me out?  thanks in advance and regards
marco

Reply via email to