You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Do...@gmx.de on 2008/03/28 16:58:46 UTC

Mvn 2 plugin to copy files?

Hi,

While tomcat is running, I would like to move some files from my source folder to my tomcat/webapps/myproject folder - in case I altered these files - by calling some plugin and or goal.

Using Maven 1, we had a custom goal for this:

 <goal name="jspdeploy">
    <copy overwrite="false" todir="${basedir}/tomcat/webapps/myproject">
      <fileset dir="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.src')}">
        <include name="**/*.jsp"/>
        <include name="**/*.inc"/>
        <include name="**/*.gif"/>
      <include name="**/*.jpg"/>
       <include name="**/*.png"/>
        <include name="**/*.js"/>
        <include name="**/*.css"/>
       <include name="**/*.pdf"/>
       <include name="**/*.html"/>
      </fileset>
    </copy>
  </goal>

Now when using Maven 2, I've read custom goals using jelly are not supported by Maven 2 - one should create a custom plugin instead. Is this really necessary in this case? I guess there must be some plugin doing just the same job without having to develop a custom plugin. I tried mvn resources:resources, but this didn't work.

Any ideas? I am helpless!!! :-(((

Thanks in advance - your help's greatly appreciated!!!

Stefanie
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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


Re: Mvn 2 plugin to copy files?

Posted by Lee Meador <le...@leemeador.com>.
Stefanie,

Google "maven antrun plugin" and select the 1st search result returned. The
title is "Maven AntRun Plugin - Introduction"

Click on "Usage" in the left menu area. This will show the XML used to
invoke the antrun plugin. Add that to the pom that generates the artifact
you want copied or add it to a pom for a project that depends on all the
poms that create all the artifacts you want to copy..

The lifecycle you use depends on your plans to use this. You could use
"package" to get it top copy the files whenever you hit the package phase
(which just preceeds 'install').

Then put ant commands to copy the files you want to copy inside the tasks
tag.

Find info on ant copy task with google by searching for "ant copy task" and
choosing the top result. The examples near the bottom of that page will
probably do whatever you want.

Thanks.

-- Lee

On Fri, Mar 28, 2008 at 11:58 AM, <Do...@gmx.de> wrote:

> >I use the antrun plugin for copying files around and such. You just put
> in
> >the ant equivalent to your xml, which shouldn't be much different from
> what
> >you have.
>
> Could you give an example of how this is done? I don't know much about
> antrun and how to use it...
>
> Thanks in advance,
>
> Stefanie
> --
> Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
> Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com

Re: Mvn 2 plugin to copy files?

Posted by Do...@gmx.de.
>I use the antrun plugin for copying files around and such. You just put in
>the ant equivalent to your xml, which shouldn't be much different from what
>you have.

Could you give an example of how this is done? I don't know much about antrun and how to use it...

Thanks in advance,

Stefanie
-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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


Re: Mvn 2 plugin to copy files?

Posted by Lee Meador <le...@leemeador.com>.
I use the antrun plugin for copying files around and such. You just put in
the ant equivalent to your xml, which shouldn't be much different from what
you have.

-- Lee

On Fri, Mar 28, 2008 at 10:58 AM, <Do...@gmx.de> wrote:

> Hi,
>
> While tomcat is running, I would like to move some files from my source
> folder to my tomcat/webapps/myproject folder - in case I altered these files
> - by calling some plugin and or goal.
>
> Using Maven 1, we had a custom goal for this:
>
>  <goal name="jspdeploy">
>    <copy overwrite="false" todir="${basedir}/tomcat/webapps/myproject">
>      <fileset dir="${pom.getPluginContext
> ('maven-war-plugin').getVariable('maven.war.src')}">
>        <include name="**/*.jsp"/>
>        <include name="**/*.inc"/>
>        <include name="**/*.gif"/>
>      <include name="**/*.jpg"/>
>       <include name="**/*.png"/>
>        <include name="**/*.js"/>
>        <include name="**/*.css"/>
>       <include name="**/*.pdf"/>
>       <include name="**/*.html"/>
>      </fileset>
>    </copy>
>  </goal>
>
> Now when using Maven 2, I've read custom goals using jelly are not
> supported by Maven 2 - one should create a custom plugin instead. Is this
> really necessary in this case? I guess there must be some plugin doing just
> the same job without having to develop a custom plugin. I tried mvn
> resources:resources, but this didn't work.
>
> Any ideas? I am helpless!!! :-(((
>
> Thanks in advance - your help's greatly appreciated!!!
>
> Stefanie
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com

Re: Mvn 2 plugin to copy files?

Posted by Tomislav Stojcevich <st...@gmail.com>.
Why don't you try the war:inplace goal instead of the war:war goal.
This copies classes/lib/etc... back from target into src/main/webapp.
Then use a context.xml file to define your webapp within tomcat.

JSP changes take without the need to copy any files.

Of course you'll have to be careful and mark the classes and lib dir
as ignored in your scm tool so they don't get checked in since they
will be in your src folder now.

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