Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.6
    • 2.0.7
    • None
    • None

    Description

      I have got the <install> task working to pull in the various deployment wagons

      <target name="m2-wagons" depends="m2-pom,ssh-init">
      <m2:install-provider artifactId="wagon-ssh"
      version="${wagon-ssh.version}"/>
      <m2:install-provider artifactId="wagon-ssh-external"
      version="${wagon-ssh-external.version}"/>
      <m2:install-provider artifactId="wagon-file"
      version="${wagon-file.version}"/>
      <m2:install-provider artifactId="wagon-ftp"
      version="${wagon-ftp.version}"/>
      </target>

      But when I run a deploy target and use the scp:// protocol , I get the unknown protocol error.

      <target name="m2-ssh-deploy" depends="m2-pom,ssh-init,m2-wagons">

      <property name="m2.upload.url"
      value="scp://${ssh.host}/www/repository"/>
      <m2:deploy file="${target.jar}">
      <remoteRepository url="${m2.upload.url}">
      <authentication username="${ssh.user}"
      privateKey="${ssh.keyfile}"/>
      </remoteRepository>
      <pom refid="m2.pom"/>
      </m2:deploy>
      </target>

      This is only for scp:, the others, scpexe, file: and ftp: do work. Is the url schema wrong? Is there any way to enum what protocols are currently supported?

      I would recommend that the error message "unsupported protocol" is supplemented with a listing of what protocols are supported. That way its easier to differentiate spelling error from uninstalled wagon.

      Attachments

        1. MANTTASKS-15.diff
          3 kB
          Herve Boutemy
        2. MANTTASKS-15_site_update.diff
          0.5 kB
          Herve Boutemy
        3. ant-v-logfile.txt
          21 kB
          Mykel Alvis

        Activity

          brett Brett Porter added a comment -

          can't see the error, but will make the error reporting improvements. It does work in the sample script.

          brett Brett Porter added a comment - can't see the error, but will make the error reporting improvements. It does work in the sample script.
          hboutemy Herve Boutemy added a comment -

          Here is a patch to get a complete list of supported protocols.
          When Ant is run in verbose mode ("ant -v"), the list of supported protocols is displayed after the new provider has been installed.

          hboutemy Herve Boutemy added a comment - Here is a patch to get a complete list of supported protocols. When Ant is run in verbose mode ("ant -v"), the list of supported protocols is displayed after the new provider has been installed.
          mykelalvis Mykel Alvis added a comment -

          I get this with 2.0.4 of the ant tasks, as well.
          Per the logfile I attached, the scp protocol should be available (I think).

          I tried substituting the full string instead of the property I was using for the url, but to no avail (as expected).

          mykelalvis Mykel Alvis added a comment - I get this with 2.0.4 of the ant tasks, as well. Per the logfile I attached, the scp protocol should be available (I think). I tried substituting the full string instead of the property I was using for the url, but to no avail (as expected).
          mykelalvis Mykel Alvis added a comment -

          Ant -v run for my build...

          mykelalvis Mykel Alvis added a comment - Ant -v run for my build...
          mykelalvis Mykel Alvis added a comment -

          I managed to work around this particular issue.

          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.

          So you can't do an antcall to call a task to do a deploy without re-decalaring the provider. I have a provider call setup as part of the "init" call that's a "depends" above, but the provider isn't available after the antcall.

          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;

          mykelalvis Mykel Alvis added a comment - I managed to work around this particular issue. 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. So you can't do an antcall to call a task to do a deploy without re-decalaring the provider. I have a provider call setup as part of the "init" call that's a "depends" above, but the provider isn't available after the antcall. 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;
          hboutemy Herve Boutemy added a comment -

          Mykel,

          Did you try <antcall inheritRefs="true" ...>? This should preserve "org.codehaus.plexus.PlexusContainer" reference, which contains the providers installed.
          Can you try it and confirm, please? Then I'll update the documentation.

          For your problem with wagon-ssh:1.0-beta-2, it seems you're using Maven Ant Tasks 2.0.4: this 1.0-beta-2 version is for 2.0.6, not 2.0.4. You should not have any problem when using Maven Ant Tasks 2.0.6

          hboutemy Herve Boutemy added a comment - Mykel, Did you try <antcall inheritRefs="true" ...>? This should preserve "org.codehaus.plexus.PlexusContainer" reference, which contains the providers installed. Can you try it and confirm, please? Then I'll update the documentation. For your problem with wagon-ssh:1.0-beta-2, it seems you're using Maven Ant Tasks 2.0.4: this 1.0-beta-2 version is for 2.0.6, not 2.0.4. You should not have any problem when using Maven Ant Tasks 2.0.6
          hboutemy Herve Boutemy added a comment -

          ok, I tried inheritRefs but it doesn't work: there is a ClassCastException when using PlexusContainer reference...
          I don't think we can do much about it, since it is related to Ant classloading mechanisms.

          To me, the only thing to do is to add a note in the documentation: this is the patch I'm attaching.

          hboutemy Herve Boutemy added a comment - ok, I tried inheritRefs but it doesn't work: there is a ClassCastException when using PlexusContainer reference... I don't think we can do much about it, since it is related to Ant classloading mechanisms. To me, the only thing to do is to add a note in the documentation: this is the patch I'm attaching.
          jvanzyl Jason van Zyl added a comment -

          Patches applied.

          jvanzyl Jason van Zyl added a comment - Patches applied.

          People

            Unassigned Unassigned
            steve_l Steve Loughran
            Votes:
            0 Vote for this issue
            Watchers:
            Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack