You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dmitry Sklyut <dm...@dsklyut.com> on 2010/10/11 17:38:57 UTC

maven3 and issues with war plugin configuration

Hi All,

I have following configuration in war plugin:
(parent pom)
<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1</version>
                    <configuration>
                        <excludes>
                            <exclude>.gitignore</exclude>
                            <exclude>**/.gitignore</exclude>
                        </excludes>
                    </configuration>
                </plugin>
(child pom)
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
                </configuration>
            </plugin>


This is the error I am getting:

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-war-plugin:2.1:war (default-war)
  on project com.ptc.insight.runtime.theme:
  Unable to parse configuration of mojo
org.apache.maven.plugins:maven-war-plugin:2.1-beta-1:war:
  When configuring a basic element the configuration cannot contain
any child elements.
  Configuration element 'warSourceExcludes'. -> [Help 1]

I debugged through the maven-core and it looks like type converter is
picked up based on the target type of the property.

In maven-war-plugin "warSourceExcludes" is a String with an alias to "excludes"

    /**
     * The comma separated list of tokens to exclude when copying the content
     * of the warSourceDirectory.
     *
     * @parameter alias="excludes"
     */
    private String warSourceExcludes;

The question that I have is that a oversight on the part of maven core
or a issue with plugins that alias simple properties with complex
properties?

Regards,

Dmitry

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


Re: maven3 and issues with war plugin configuration

Posted by Paul Benedict <pb...@apache.org>.
Try this:
<excludes>.gitignore,**/.gitignore</excludes>

If you don't see the property as a List<String> in the source, it must
be a comma-separated or space-separated value.

Paul

On Mon, Oct 11, 2010 at 10:38 AM, Dmitry Sklyut <dm...@dsklyut.com> wrote:
> Hi All,
>
> I have following configuration in war plugin:
> (parent pom)
> <plugin>
>                     <groupId>org.apache.maven.plugins</groupId>
>                     <artifactId>maven-war-plugin</artifactId>
>                     <version>2.1</version>
>                     <configuration>
>                         <excludes>
>                             <exclude>.gitignore</exclude>
>                             <exclude>**/.gitignore</exclude>
>                         </excludes>
>                     </configuration>
>                 </plugin>
> (child pom)
> <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
>                 </configuration>
>             </plugin>
>
>
> This is the error I am getting:
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-war-plugin:2.1:war (default-war)
>  on project com.ptc.insight.runtime.theme:
>  Unable to parse configuration of mojo
> org.apache.maven.plugins:maven-war-plugin:2.1-beta-1:war:
>  When configuring a basic element the configuration cannot contain
> any child elements.
>  Configuration element 'warSourceExcludes'. -> [Help 1]
>
> I debugged through the maven-core and it looks like type converter is
> picked up based on the target type of the property.
>
> In maven-war-plugin "warSourceExcludes" is a String with an alias to "excludes"
>
>    /**
>     * The comma separated list of tokens to exclude when copying the content
>     * of the warSourceDirectory.
>     *
>     * @parameter alias="excludes"
>     */
>    private String warSourceExcludes;
>
> The question that I have is that a oversight on the part of maven core
> or a issue with plugins that alias simple properties with complex
> properties?
>
> Regards,
>
> Dmitry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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