OK, I solved this. I've seen others on the web who complained of similar
issues -- and the JIRA tickets may be related -- but here's the answer for
posterity:

The <filters>/<filter> tags need to be in the <configuration> of the
maven-war-plugin and NOT your <build>. The former is for your web
resources; the latter for your normal resources. That's not obvious if your
glancing through many examples but that's how you solve this.

Example:
<build>
   <plugins>
     <plugin>
       <artifactId>maven-war-plugin</artifactId>
       <configuration>
         <filters>
           <filter>src/main/filters/dev.properties</filter>
        </filters>
        <webResources>
          <resource>
            <directory>src/main/webapp/WEB-INF</directory>
            <filtering>true</filtering>
            <include>jboss-web.xml</include>
            <targetPath>WEB-INF</targetPath>
          </resource>
.....
</build>

Cheers,
Paul


On Thu, Apr 24, 2014 at 2:17 PM, Paul Benedict <[email protected]> wrote:

> I think my problem is regarding these open issues:
>
> http://jira.codehaus.org/browse/MWAR-301
> http://jira.codehaus.org/browse/MWAR-305
>
> I did a "debug dump" of my build and noticed that my filters are
> definitely not being included in the list of available properties.
>
> Unless someone else can give advice on how to make this work (does anyone
> else here filter web resources?), I'll simply have to use the normal
> <resources> tag and target the output at WEB-INF.
>
> Paul
>
>
>
> On Thu, Apr 24, 2014 at 1:37 PM, Paul Benedict <[email protected]>wrote:
>
>> I am trying to filter my jboss-web.xml but am having problems. For sure,
>> the file is getting processed because ${project.version} is substituted
>> just fine, but any of my custom properties are not. It doesn't seem that
>> the war plugin is paying attention to my list of filters.
>>
>> <build>
>>   <filters>
>>     <filter>src/main/filters/dev.properties</filter>
>>    </filters>
>>    <plugins>
>>      <plugin>
>>        <artifactId>maven-war-plugin</artifactId>
>>        <configuration>
>>         <webResources>
>>           <resource>
>>             <directory>src/main/webapp/WEB-INF</directory>
>>             <filtering>true</filtering>
>>             <include>jboss-web.xml</include>
>>             <targetPath>WEB-INF</targetPath>
>>           </resource>
>> .....
>> </build>
>>
>> What's missing/wrong in my config?
>>
>> --
>> Cheers,
>> Paul
>>
>
>
>
> --
> Cheers,
> Paul
>



-- 
Cheers,
Paul

Reply via email to