On 7/3/06, Jeff Mutonho <[EMAIL PROTECTED]> wrote:
On 7/3/06, jerome lacoste <[EMAIL PROTECTED]> wrote:
> On 7/3/06, Jeff Mutonho <[EMAIL PROTECTED]> wrote:
> > Is there an equivalence of doing a file copy from one location to
> > another as one could do in M1 , as a pregoal?
>
> You can probbaly use the antrun plugin to make the copy and attach the
> plugin's execution to the phase before the one that requires your file
> to be in the correct location.
>
> Jerome
>
Thanks.Basically what I wish to do is to copy some spring xml config
files into my WEB-INF/appcontext directory, before the war file is
created.Should I put the ant task in the "process-resources"  phase?



I added the following to my pom :

<plugin>
       <artifactId>maven-antrun-plugin</artifactId>
       <executions>
         <execution>
           <phase>process-resources</phase>
           <configuration>
             <tasks>
                   <copy todir="WebContent/WEB-INF/appcontext">
                     <fileset
dir="${ant.common.eportal.services.dir}/src/spring/context"
includes="**/*.xml" />
                     <fileset
dir="${ant.common.eportal.messaging.dir}/src/spring/context"
includes="**/*.xml" />
                     <fileset
dir="${ant.common.eportal.webservices.dir}/src/spring/context"
includes="**/*.xml" />
                   </copy>
             </tasks>
              </configuration>
               <goals>
                <goal>run</goal>
               </goals>
         </execution>
       </executions>
     </plugin>


and then have the resource defined af :
       <resource>
         <filtering>true</filtering>
         <directory>../eportal-support/ant</directory>
       </resource>
where my ant-property.properties file is located and the varibles

ant.common.eportal.services.dir ,
ant.common.eportal.messaging.dir ,
ant.common.eportal.webservices.dir

are defined in that property file.Running "mvn install" fails with the message :

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: D:\M2-WORK\${ant.common.eportal.services.dir}\src\spring\context
not found.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch


i.e ${ant.common.eportal.services.dir} is not being evaluated.How can
i get these variables to be evaluated before they start being used?


--


Jeff  Mutonho

GoogleTalk : ejbengine
Skype        : ejbengine
Registered Linux user number 366042

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to