You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Winsor, Daniel" <da...@etrade.com> on 2012/11/02 22:16:20 UTC

Should maven-war-plugin accept null includes?

Hi,

I ran into the use case where I'd like to have an overlay that will either
include a file or not, depending on a property.  EG
<includes>
  <include>file1</include>
  <include>file2</include>

  <include>${some.property}</include>

</includes>

Where
<properties>
  <some.property></some.property>
  <!-- OR <some.property>file3</some.property> -->
</properties>

Unfortunately this results in an exception being thrown during the build,
since the file is null ->  Failed to execute goal
org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on
project neo-widgets: Execution default-war of goal
org.apache.maven.plugins:maven-war-plugin:2.1.1:war failed.
NullPointerException

Interestingly, the packageExcludes parameter of the same plugin does
accept null.  So although I made a workaround by setting the property to
"dummy_value_cant_be_null", should this plugin be made to accept null
include parameters?



Thank you,
Daniel Winsor
Associate, IT Architecture


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


Re: Should maven-war-plugin accept null includes?

Posted by Dennis Lundberg <de...@apache.org>.
Hi Daniel,

Could you please try the latest version, 2.3,  of Maven WAR Plugin and
see if it has the same behavior?

If it work the same way, then please file an issue in JIRA at
https://jira.codehaus.org/browse/MWAR

On 2012-11-02 22:16, Winsor, Daniel wrote:
> Hi,
> 
> I ran into the use case where I'd like to have an overlay that will either
> include a file or not, depending on a property.  EG
> <includes>
>   <include>file1</include>
>   <include>file2</include>
> 
>   <include>${some.property}</include>
> 
> </includes>
> 
> Where
> <properties>
>   <some.property></some.property>
>   <!-- OR <some.property>file3</some.property> -->
> </properties>
> 
> Unfortunately this results in an exception being thrown during the build,
> since the file is null ->  Failed to execute goal
> org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on
> project neo-widgets: Execution default-war of goal
> org.apache.maven.plugins:maven-war-plugin:2.1.1:war failed.
> NullPointerException
> 
> Interestingly, the packageExcludes parameter of the same plugin does
> accept null.  So although I made a workaround by setting the property to
> "dummy_value_cant_be_null", should this plugin be made to accept null
> include parameters?
> 
> 
> 
> Thank you,
> Daniel Winsor
> Associate, IT Architecture
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


-- 
Dennis Lundberg

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