You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mykel Alvis <my...@weirdness.com> on 2007/05/08 21:06:19 UTC

Known Issue: SCP deploys not working with ant tasks. Seeking workaround

Per http://jira.codehaus.org/browse/MANTTASKS-15 , it seems that scp won't
work with the ant tasks.

Is there a workaround for this?  Is anyone successfully doing this?  I've
tried using every available version of wagon-ssh to no avail.


Mykel

Re: Known Issue: SCP deploys not working with ant tasks. Seeking workaround

Posted by Mykel Alvis <my...@weirdness.com>.
OK.  After 12 hours of working on this, I've answered my own question (sort
of).

I WAS doing the following:

    <target name="deploy-release" depends="install" description="Deploy
released jars to the remote m2 repo">
    <property name="repo.url" value="${remote.release.url}" />
        <antcall target="deploy-subordinate" >
            <param name="repo.url" value="${remote.release.url}" />
        </antcall>
    </target>

    <target name="deploy-subordinate" description="Sub task to perfom
deploys based on a property">
        <echo message="Deploying to ${repo.url}" />
        <echo message="using ${repository.username} and ${
repository.privatekey}" />
        <artifact:deploy file="${target.dist}/${artifactOne}">
            <remoteRepository url="${repo.url}">
                <authentication username="${repository.username}"
password="${repository.password}" />
{blahblahblah}

The thing I was failing to recognize is the nature of antcall'd tasks.
Declaring the artifact:provider in one task makes it accessible in another
task, but not if I do an "antcall" to a subtask in an effort to consolidate
certain behaviors.. Dunno why I thought it would work.  When I inheritRefs,
the pom reference I have in the artifact:deploy (not shown) has a reference
conflict.
I may be able to manage this with propertysets, but I don't know just yet.

It appears that wagon-ssh:1.0-alpha-7 is a valid scp provider, but
1.0-beta-2 gives an error:
java.lang.NoSuchMethodError:
org.apache.maven.wagon.CommandExecutor.executeCommand
(Ljava/lang/String;Z)Lorg/apache/maven/wagon/Streams;

Also, under Linux with ssh-agent running, ssh cannot open the public key
(much like regular maven).  Unlike regular maven, the lack of a setting that
is that passphrase forces me to either use the passphrase as an
authentication parameter or explicitly state the password (either way
works).

        <artifact:deploy file="${target.dist}/${artifactOne}">
            <remoteRepository url="${repo.url}">
                <authentication username="${repository.username}"
password="${repository.password}" />
            </remoteRepository>
            <pom refid="maven.artifact1" />
        </artifact:deploy>
OR
        <artifact:deploy file="${target.dist}/${artifactTwo}">
            <pom refid="maven.artifact2" />
            <remoteRepository url="${repo.url}">
                <authentication username="${repository.username}"
privateKey="${repository.privatekey}" passphrase="${privatekey.passphrase
}"/>
            </remoteRepository>

Since I have no intention of putting a password for a user (or worse, for my
private key) into SCM, I pass it as a command line attribute.  Thus, my
shell history has the password until I clean up shell history.

I'm now going to try and use just a pom and it's repos as the identifiers
for the remote repos.  Maybe my two targets, one for release and one for
snapshots, was overkill.



On 5/8/07, Mykel Alvis <my...@weirdness.com> wrote:
>
> Per http://jira.codehaus.org/browse/MANTTASKS-15 , it seems that scp won't
> work with the ant tasks.
>
> Is there a workaround for this?  Is anyone successfully doing this?  I've
> tried using every available version of wagon-ssh to no avail.
>
>
> Mykel




-- 
I'm just an unfrozen caveman software developer.  I don't understand your
strange, "modern" ways.