Just put your resources files in src/main/resources/appcontext and
everything will work fine. No need to copy.
On 7/3/06, jerome lacoste <[EMAIL PROTECTED]> wrote:
On 7/3/06, Jeff Mutonho <[EMAIL PROTECTED]> wrote:
> 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?
By defining them again as POM properties, maybe in a profile ?
It seems to me that you are encountering problems because you are
trying to use maven the same way you use ant. Maybe you are just in
the middle of a migration from ant to maven ?
So you are perhaps trying to find a solution to the wrong problem.
Do you really need to make ant.common.eportal.services.dir a property
? Can't you hardcode it until your conversion is done ?
Can't you keep your xml files in each of your sub module jars
(services, messaging...) and extract them from there (that way you
don't need to remember where they are stored locally) ?
BTW don't copy your files under your source directory, better copy
them to your target resource directory.
Cheers,
Jerome
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]