You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brice Copy <br...@cern.ch> on 2004/03/10 13:00:32 UTC

Using SCP in maven.xml (on maven 1.0 RC1)

Hello,

I was wondering what's the best way to copy files (not artifacts) to a 
remote location - through SCP for instance.

Ant 1.6 includes an SCP task, which I'm trying to use :  my build is 
successful, yet the SCP task is not executed.
How does maven handle tags it does not recognize ? I have ant 1.6 in my 
path, and in the dependencies of my project too.
I have a similar ANT build file that of course works as expected - I'm 
only trying to translate it to maven.

I created the following goal in my maven.xml :

<project
  xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:ant="jelly:ant">
 
  <goal name="deployMyScripts">
    <j:set var="deployRemoteDest" 
value="scott:tiger@someremote.host:/my/remote/path"/>
   <echo>Deploying to  ${deployRemoteDest}</echo>

   <ant:scp trust="yes" todir="${deployRemoteDest}/bin">
       <ant:fileset dir="../../bin">
         <ant:include name="*"/>
       </ant:fileset>
    </ant:scp>
  </goal>
 
</project>

However, the SCP task is not run, I get this :

deployMyScripts:
    [echo] Deploying to  scott:tiger@someremote.host:/my/remote/path
BUILD SUCCESSFUL
Total time: 3 seconds
Finished at: Wed Mar 10 12:54:48 CET 2004

Any ideas what could be going on ?

Thanks

Brice


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


Re: Using SCP in maven.xml (on maven 1.0 RC1)

Posted by Brice Copy <br...@cern.ch>.
Emmanuel Venisse wrote:

>Include this in your goal, with the correct replacement:
>    <util:replace var="forwardSlashBaseDir" oldChar="\" newChar="/"
>value="${basedir}"/>
>    <j:if test="${!forwardSlashBaseDir.endsWith('/')}">
>      <j:set var="base" value="${forwardSlashBaseDir}/" />
>    </j:if>
>    <j:set
>var="relativePath">${fileToDeploy.substring(base.length())}</j:set>
>    <deploy:artifact
>      artifact="${relativePath}"
>      type="YOUR_TYPE"
>      assureDirectoryCommand="mkdir -p"
>      siteCommand="cd @deployDirectory@; chmod g+w YOUR_FILENAME; chgrp
>${maven.remote.group} YOUR_FILENAME"
>    />
>  
>

Thanks for your tip - but since Maven seamlessly integrates with Ant 
tasks, I should really be able to invoke any task I want anywhere no ?

It's not just SCP, it's invoking any Ant task within maven.xml

Cheers

Brice


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


Re: Using SCP in maven.xml (on maven 1.0 RC1)

Posted by Emmanuel Venisse <em...@venisse.net>.
Include this in your goal, with the correct replacement:


    <util:replace var="forwardSlashBaseDir" oldChar="\" newChar="/"
value="${basedir}"/>
    <j:if test="${!forwardSlashBaseDir.endsWith('/')}">
      <j:set var="base" value="${forwardSlashBaseDir}/" />
    </j:if>
    <j:set
var="relativePath">${fileToDeploy.substring(base.length())}</j:set>
    <deploy:artifact
      artifact="${relativePath}"
      type="YOUR_TYPE"
      assureDirectoryCommand="mkdir -p"
      siteCommand="cd @deployDirectory@; chmod g+w YOUR_FILENAME; chgrp
${maven.remote.group} YOUR_FILENAME"
    />

Emmanuel

----- Original Message ----- 
From: "Brice Copy" <br...@cern.ch>
To: "Maven Users List" <us...@maven.apache.org>
Sent: Wednesday, March 10, 2004 3:02 PM
Subject: Re: Using SCP in maven.xml (on maven 1.0 RC1)


> Emmanuel Venisse wrote:
>
> >In maven, we use it without ant 1.6.
> >
> >You can see in deploy plugin for jaelly tag declaration and jar:deploy
goal
> >for a sample of use.
> >
> >
> >
> I know, but in my case I was thinking of deploying extra dependencies -
> not the final JAR artifact, but shell scripts, other XML files etc...
>
> As for the deploy plugin, it seems it only deploys the POM (??) :
>
> Goal Description
> deploy:pom Deploy project.xml, a.k.a. the POM to the central repository.
>
>
>
> Thanks
>
> Brice
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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


Re: Using SCP in maven.xml (on maven 1.0 RC1)

Posted by Brice Copy <br...@cern.ch>.
Emmanuel Venisse wrote:

>In maven, we use it without ant 1.6.
>
>You can see in deploy plugin for jaelly tag declaration and jar:deploy goal
>for a sample of use.
>
>  
>
I know, but in my case I was thinking of deploying extra dependencies - 
not the final JAR artifact, but shell scripts, other XML files etc...

As for the deploy plugin, it seems it only deploys the POM (??) :

Goal 	Description
deploy:pom 	Deploy project.xml, a.k.a. the POM to the central repository.



Thanks

Brice

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


Re: Using SCP in maven.xml (on maven 1.0 RC1)

Posted by Emmanuel Venisse <em...@venisse.net>.
In maven, we use it without ant 1.6.

You can see in deploy plugin for jaelly tag declaration and jar:deploy goal
for a sample of use.

Emmanuel

----- Original Message ----- 
From: "Brice Copy" <br...@cern.ch>
To: "Maven Users List" <us...@maven.apache.org>
Sent: Wednesday, March 10, 2004 1:00 PM
Subject: Using SCP in maven.xml (on maven 1.0 RC1)


> Hello,
>
> I was wondering what's the best way to copy files (not artifacts) to a
> remote location - through SCP for instance.
>
> Ant 1.6 includes an SCP task, which I'm trying to use :  my build is
> successful, yet the SCP task is not executed.
> How does maven handle tags it does not recognize ? I have ant 1.6 in my
> path, and in the dependencies of my project too.
> I have a similar ANT build file that of course works as expected - I'm
> only trying to translate it to maven.
>
> I created the following goal in my maven.xml :
>
> <project
>   xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:ant="jelly:ant">
>
>   <goal name="deployMyScripts">
>     <j:set var="deployRemoteDest"
> value="scott:tiger@someremote.host:/my/remote/path"/>
>    <echo>Deploying to  ${deployRemoteDest}</echo>
>
>    <ant:scp trust="yes" todir="${deployRemoteDest}/bin">
>        <ant:fileset dir="../../bin">
>          <ant:include name="*"/>
>        </ant:fileset>
>     </ant:scp>
>   </goal>
>
> </project>
>
> However, the SCP task is not run, I get this :
>
> deployMyScripts:
>     [echo] Deploying to  scott:tiger@someremote.host:/my/remote/path
> BUILD SUCCESSFUL
> Total time: 3 seconds
> Finished at: Wed Mar 10 12:54:48 CET 2004
>
> Any ideas what could be going on ?
>
> Thanks
>
> Brice
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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