You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jan Torben Heuer <jt...@mail2003.dnsalias.org> on 2007/12/10 16:03:37 UTC

maven-war-plugin webResources - relative path

Hi,

I'm using the following settings to include and filter webresources:

                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-war-plugin</artifactId>
                                <version>2.0</version>
                                <configuration>
                                        <webResources>
                                                <resource>
                                                        <directory>src/main/webresources</directory>
                                                        <filtering>true</filtering>
                                                </resource>
                                        </webResources>
                                </configuration>
                                 
                        </plugin>

However, the project is a multi-module project. Thus, running it in the
submodule works, but in the parent it expects the resource to be relative
to it's own pom.xml (so module/src/main/webresources, would be correct).

Can I fix it?

Jan


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


Re: maven-war-plugin webResources - relative path

Posted by Benjamin Voigt <be...@god.de>.
Jan Torben Heuer schrieb:
> Hi,
> 
> I'm using the following settings to include and filter webresources:
> 
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>                                 <artifactId>maven-war-plugin</artifactId>
>                                 <version>2.0</version>
>                                 <configuration>
>                                         <webResources>
>                                                 <resource>
>                                                         <directory>src/main/webresources</directory>
>                                                         <filtering>true</filtering>
>                                                 </resource>
>                                         </webResources>
>                                 </configuration>
>                                  
>                         </plugin>
> 
> However, the project is a multi-module project. Thus, running it in the
> submodule works, but in the parent it expects the resource to be relative
> to it's own pom.xml (so module/src/main/webresources, would be correct).
> 
> Can I fix it?
> 
> Jan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

Hi,

I think you can put your configuration in the top-level-pom and add

<inherited>true</tag>

to it. Thus, it should filter all files.

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


Re: maven-war-plugin webResources - relative path

Posted by Jan Torben Heuer <jt...@mail2003.dnsalias.org>.
Stephane Nicoll wrote:

> Replace 2.0 by 2.0.2.
> 
> It's a bug and it has been fixed.

Thanks!

Jan


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


Re: maven-war-plugin webResources - relative path

Posted by Stephane Nicoll <st...@gmail.com>.
ah, that's the filtering issue. I don't fully get this one but it's
related to the content of your filters and the interpolation.

If you can reproduce easily file a jira issue with a sample project.

Stéphane

On Dec 11, 2007 12:07 PM, Jan Torben Heuer <jt...@mail2003.dnsalias.org> wrote:
> Stephane Nicoll wrote:
>
> > Replace 2.0 by 2.0.2.
> >
> > It's a bug and it has been fixed.
>
> Sorry, but I still cannot run mvn install from my parent pom.
>
> Additionally, when I try to run mvn install from the webapps pom I get:
>
>
> [INFO] [war:war]
> [INFO] Exploding webapp...
> [INFO] Assembling webapp sas-communication-http in ...
> [INFO] Copy webapp webResources to ...
> [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: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)
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 8 seconds
> [INFO] Finished at: Tue Dec 11 12:05:18 CET 2007
> [INFO] Final Memory: 7M/14M
> [INFO] ------------------------------------------------------------------------
>
>
> Is 2.0.2 still beta?
>
>
> Jan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


Re: maven-war-plugin webResources - relative path

Posted by Jan Torben Heuer <jt...@mail2003.dnsalias.org>.
Stephane Nicoll wrote:

> Replace 2.0 by 2.0.2.
> 
> It's a bug and it has been fixed.

Sorry, but I still cannot run mvn install from my parent pom.

Additionally, when I try to run mvn install from the webapps pom I get:


[INFO] [war:war]
[INFO] Exploding webapp...
[INFO] Assembling webapp sas-communication-http in ...
[INFO] Copy webapp webResources to ...
[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: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)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Tue Dec 11 12:05:18 CET 2007
[INFO] Final Memory: 7M/14M
[INFO] ------------------------------------------------------------------------


Is 2.0.2 still beta?

Jan


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


Re: maven-war-plugin webResources - relative path

Posted by Stephane Nicoll <st...@gmail.com>.
Replace 2.0 by 2.0.2.

It's a bug and it has been fixed.

Stéphane

On Dec 10, 2007 4:03 PM, Jan Torben Heuer <jt...@mail2003.dnsalias.org> wrote:
> Hi,
>
> I'm using the following settings to include and filter webresources:
>
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>                                 <artifactId>maven-war-plugin</artifactId>
>                                 <version>2.0</version>
>                                 <configuration>
>                                         <webResources>
>                                                 <resource>
>                                                         <directory>src/main/webresources</directory>
>                                                         <filtering>true</filtering>
>                                                 </resource>
>                                         </webResources>
>                                 </configuration>
>
>                         </plugin>
>
> However, the project is a multi-module project. Thus, running it in the
> submodule works, but in the parent it expects the resource to be relative
> to it's own pom.xml (so module/src/main/webresources, would be correct).
>
> Can I fix it?
>
> Jan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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