archiva-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maury Hammel <>
Subject Problems with REST API getting artifacts.
Date Wed, 21 Mar 2018 20:54:26 GMT
Hello, I have just getting into Archiva and am having problems attempting to download artifacts
using the REST API.  

I have the standalone distribution of Archiva 2.2.3 installed on CentOS 7 and have started
it with the "archiva console" command.

As noted in the Quick Start guide, I can download an artifact using the following URL from
the command line on the same machine:

% wget "http://localhost:8080/repository/internal/junit/junit/3.8.1/junit-3.8.1.jar"

My first attempt to down load the same artifact using the REST API generated a "403 Forbidden"

% wget "http://localhost:8080/restServices/archivaServices/searchService/artifact?g=junit&a=junit&v=3.8.1"
-O junit-3.8.1.jar

After some reading, I went into conf/archiva.xml, changed rest.csrffilter.enabled to "false"
and restarted Archiva.

Now when attempting the above command, I no longer get the "403 Forbidden" error, I get a
"204 No Content" error and an empty file (see wget output below).

Is there something else (or something different) that I need to change in the Archiva configuration,
or is my request formatted incorrectly?

Thanks in advance.....

--2018-03-21 14:53:33--  http://localhost:8080/restServices/archivaServices/searchService/artifact?g=junit&a=junit&v=3.8.1
Resolving localhost (localhost)... ::1,
Connecting to localhost (localhost)|::1|:8080... connected.
HTTP request sent, awaiting response... 204 No Content
Length: 0
Saving to: 'junit-3.8.1.jar'

    [ <=>                                                                          
          ] 0           --.-K/s   in 0s

2018-03-21 14:53:33 (0.00 B/s) - 'junit-3.8.1.jar' saved [0/0]

View raw message