On Tue, Oct 28, 2008 at 11:21 AM, Jeremy Monnet <[EMAIL PROTECTED]> wrote:
>
> I am just a little confused about all of this (I am here only from
> last week), so I'm asking for your help :-)
>
> Is there a way to remote deploy using sftp on maven 1.0.2 ? using any
> other (a bit secured) method ?
Finally I managed to it, using the scripting stuff, which if I believe
the documentation is not recommended at all.

What I did is creation of a maven.xml file, which contains :
<project xmlns:ant="jelly:ant" xmlns:j="jelly:core">

        <preGoal name="hello:hello">
                <echo>Pre-Goaling</echo>
                <j:set var="hello.dst.file"
value="<USER>@<REMOTE_HOSTNAME>:<PATH>" />
                <j:set var="hello.src.file"
value="/tmp/aleajactaest.txt /tmp/mementomori.txt /tmp/carpediem.txt"
/>
                <j:set var="hello.dst.file2"
value="<USER>@<REMOTE_HOSTNAME>:<PATH>" />
        </preGoal>

        <postGoal name="hello:hello">
                <echo>Post-Goaling</echo>
        </postGoal>

        <goal name="hello:hello" description="Say Hello" prereqs="war:war">
                <ant:echo>var : ${hello.dst.file}</ant:echo>
                <ant:exec executable="/usr/bin/scp">
                        <ant:arg line="${hello.src.file} ${hello.dst.file}" />
                        <echo>Command Executed for  ${hello.src.file}</echo>
                </ant:exec>
                <ant:exec executable="/usr/bin/scp">
                        <ant:arg
line="${maven.war.build.dir}/${maven.war.final.name}
${hello.dst.file2}" />
                        <echo>Command Executed for
${maven.war.build.dir}/${maven.war.final.name}</echo>
                </ant:exec>
        </goal>

</project>

I started with this thread
http://mail-archives.apache.org/mod_mbox/maven-users/200506.mbox/[EMAIL 
PROTECTED]
to achieve this. And of course I exchanged my ssh keys, for the
process to be automated.

Jérémy

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

Reply via email to