You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Craig Ryan <cr...@puca.com> on 2007/08/30 18:12:13 UTC

ant tasks webdav authentication

Here is an Ant build.xml snippet using maven tasks:

    <artifact:remoteRepository id="my.repo" 
url="dav:http://fred:secret@maven.mycompany.ie" layout="default"/>
    <artifact:install-provider artifactId="wagon-webdav" 
version="1.0-beta-2"/>
    <artifact:deploy file="my.jar">
        <remoteRepository refid="my.repo" />
        <pom refid="my.pom"/>
    </artifact:deploy>

the above works fine, and does a PUT of my jar into my company maven2 
repo. The following however does not
work. Note: this time I don't specify username:password in the 
repository URL, instead I use an <authentication> tag.

    <artifact:remoteRepository id="my.repo" 
url="dav:http://maven.mycompany.ie" layout="default">
        <authentication username="fred" password="secret" />
    </artifact:remoteRepository>
    <artifact:install-provider artifactId="wagon-webdav" 
version="1.0-beta-2"/>
    <artifact:deploy file="my.jar">
        <remoteRepository refid="my.repo" />
        <pom refid="my.pom"/>
    </artifact:deploy>

The authentication tag seems to be ignored this time, no auth headers 
are sent and the PUT fails with a 401.
Can someone please explain why this doesn't work?

The above example is highly simplified, in my build system I'd prefer to 
user authentication tags instead of embedding
auth data in the repository url if possible, and also I'm basically 
curious ;-)

thanks,
craig.


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


Re: ant tasks webdav authentication

Posted by Hervé BOUTEMY <he...@free.fr>.
Le jeudi 30 août 2007, Craig Ryan a écrit :
> Here is an Ant build.xml snippet using maven tasks:
>
>     <artifact:remoteRepository id="my.repo"
> url="dav:http://fred:secret@maven.mycompany.ie" layout="default"/>
>     <artifact:install-provider artifactId="wagon-webdav"
> version="1.0-beta-2"/>
>     <artifact:deploy file="my.jar">
>         <remoteRepository refid="my.repo" />
>         <pom refid="my.pom"/>
>     </artifact:deploy>
>
> the above works fine, and does a PUT of my jar into my company maven2
> repo. The following however does not
> work. Note: this time I don't specify username:password in the
> repository URL, instead I use an <authentication> tag.
>
>     <artifact:remoteRepository id="my.repo"
> url="dav:http://maven.mycompany.ie" layout="default">
>         <authentication username="fred" password="secret" />
>     </artifact:remoteRepository>
>     <artifact:install-provider artifactId="wagon-webdav"
> version="1.0-beta-2"/>
>     <artifact:deploy file="my.jar">
>         <remoteRepository refid="my.repo" />
>         <pom refid="my.pom"/>
>     </artifact:deploy>
>
> The authentication tag seems to be ignored this time, no auth headers
> are sent and the PUT fails with a 401.
> Can someone please explain why this doesn't work?
Did you try not to use a repository reference but directly declare the 
repository in the deploy task?
    <artifact:install-provider artifactId="wagon-webdav" 
version="1.0-beta-2"/>
    <artifact:deploy file="my.jar">
      <remoteRepository id="my.repo" url="dav:http://maven.mycompany.ie" 
layout="default">
        <authentication username="fred" password="secret" />
      <remoteRepository>
        <pom refid="my.pom"/>
    </artifact:deploy>

Hervé
>
> The above example is highly simplified, in my build system I'd prefer to
> user authentication tags instead of embedding
> auth data in the repository url if possible, and also I'm basically
> curious ;-)
>
> thanks,
> craig.
>
>
> ---------------------------------------------------------------------
> 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