Hello Jeff,

Sorry about the example, the correct one should be

   <configuration>
      <webResources>
         [...]
         <resource>
           <directory>configurations</directory>
           <!-- override the destination directory for this resource -->
           <targetPath>WEB-INF</targetPath>
           <!-- enable filtering -->
           <filtering>true</filtering>
           <excludes>
              <exclude>**/properties<exclude>
           </excludes>
         </resource>
      </webResources>
    </configuration>

it's webResources/resource. So far I can only assure you that the
targetPath configuration 
will only work in 2.1-SNAPSHOT. I'm not sure if the targetPath patch was
applied to the
2.0 series.

If you have the time you can get the source and built the latest war
plugin from the trunk.

---
svn co https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-war-plugin
cd maven-war-plugin
mvn install
---

btw, if you decide to use the build/resources/resource configuration
make sure you use the package phase
instead of directly invoking the war goal. Resource processing is not
covered by the war plugin.
Just do mvn package just to be sure.


hope this helps,
pete marvin
  


Denis Cabasson wrote:
> Jeff Mutonho wrote:
>   
>> On 8/8/06, Denis Cabasson <[EMAIL PROTECTED]> wrote:
>>     
>>>
>>> Jeff Mutonho wrote:
>>>       
>>>> On 8/8/06, Denis Cabasson <[EMAIL PROTECTED]> wrote:
>>>>         
>>>>>
>>>>> Jeff Mutonho wrote:
>>>>>           
>>>>>> On 8/8/06, Stefan Magnus Landrø <[EMAIL PROTECTED]>
>>>>>> wrote:
>>>>>>             
>>>>>>> Hi Jeff,
>>>>>>>
>>>>>>> properties normally go in the src\main\resources
>>>>>>>
>>>>>>> BTW, You seem to use a strange layout for your directories. Do you
>>>>>>>               
>>>>> really
>>>>>           
>>>>>>> want it to be that way?
>>>>>>> Read Better builds with maven for the recommended dir. structure
>>>>>>>
>>>>>>> "
>>>>>>>               
>>>>>> Thats just the way the project is structured and am powerless to
>>>>>> change it.
>>>>>>
>>>>>>             
>>>>> This is eclipse WTP directory layout.
>>>>>
>>>>> You should really work the other way round: take maven's directory
>>>>> structure
>>>>> (far better), and create the eclipse descriptor with:
>>>>> mvn -Dwtpversion=1.0 eclipse:eclipse
>>>>>
>>>>> See http://maven.apache.org/plugins/maven-eclipse-plugin/wtp.html for
>>>>> more
>>>>> details
>>>>>
>>>>> Denis.
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>>           
>>> http://www.nabble.com/incorrect-war-file-structure-tf2072468.html#a5708197
>>>       
>>>>> Sent from the Maven - Users forum at Nabble.com.
>>>>>
>>>>>
>>>>>           
>>>> I understand that , that would work better but I do not have the
>>>>         
>>> liberty
>>>       
>>>> to
>>>> change the directory structure now to the maven structure.The war
>>>>         
>>> plugin
>>>       
>>>> in
>>>> document (
>>>>
>>>>         
>>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>>>       
>>>> talk about specifying what it calls an external resource using the
>>>> <webResources>
>>>>     <resource>
>>>>      <directory>/path-to-external-directory</directory>
>>>>
>>>> and then  under the section "Overriding the default destination
>>>>         
>>> directory
>>>       
>>>> of
>>>> a web resource") says it should be possible to specify what it calls an
>>>> external resource and override the target directory ie the directory
>>>>         
>>> where
>>>       
>>>> you want the resources to be copied to , by specifying  <targetPath>
>>>> in my case  its <targetPath>WEB-INF/classes</targetPath>
>>>>
>>>> I just don't understand why I won't work.
>>>>
>>>> Jeff
>>>>
>>>>
>>>>         
>>> webRessources, are ressources bundled in your war archive...
>>>
>>> You should rather specify the build/ressources element in your POM to
>>> include the correct ressources, and let the maven-war-plugin include
>>> those
>>> ressources in your produced war.
>>>
>>> Something like:
>>> ...
>>> <build>
>>>   ...
>>>   <resources>
>>>     <resource>
>>>       <directory>WebContent/JavaSource</directory>
>>>       <excludes>
>>>         <exclude>**/*.java</exclude>
>>>       </excludes>
>>>     </resource>
>>>   </resources>
>>>   ...
>>> </build>
>>> ...
>>>
>>> That should work (alternatively, you can specify includes instead of
>>> excludes tags).
>>>
>>> Denis
>>> --
>>> View this message in context:
>>> http://www.nabble.com/incorrect-war-file-structure-tf2072468.html#a5708705
>>> Sent from the Maven - Users forum at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>       
>> I just noticed that the example  provided on the plugin website  has a
>>  <resource> tag nested inside another <resource> , as shown below :
>>
>>
>> Overriding the default destination directory of a web resource
>>
>> By default web resources are copied to the root of the war, as shown in
>> the
>> previous example. To override the default destination directory, specify
>> the
>> target path.
>>
>>  [...]
>>     <configuration>
>>       <webResources>
>>         <resource>
>>          [...]
>>          <resource>
>>            <directory>configurations</directory>
>>            <!-- override the destination directory for this resource -->
>>            <targetPath>WEB-INF</targetPath>
>>            <!-- enable filtering -->
>>            <filtering>true</filtering>
>>            <excludes>
>>               <exclude>**/properties<exclude>
>>            </excludes>
>>          </resource>
>>         </resource>
>>       </webResources>
>>     </configuration>
>>   [...]
>>
>>
>>
>>
>> I tried to do it the same way , the build started and then   got stumped
>> with an error message saying
>> "[INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Failed to configure plugin parameters for:
>> org.apache.maven.plugins:maven
>> -war-plugin:2.0
>>
>>
>>
>> Cause: Cannot find setter nor field in org.apache.maven.model.Resource for
>> 'resource'
>> "
>>
>> Is this a bug in the plugin?Has anyone succeded in overriding the default
>> destination directory of a web resource using this example on the website?
>>
>>
>>
>>
>>
>> Jeff  Mutonho
>>
>> GoogleTalk : ejbengine
>> Skype        : ejbengine
>> Registered Linux user number 366042
>>
>>
>>     
>
> You should really consider using the resources/resource tag in the build
> section of your POM. This is the right place to do what you want, not in the
> war plugin configuration...
>
> Denis.
>
>   

Reply via email to