title: Odd file naming using wget with Nexus Rest API
body: <p>I have a script that pulls .war artifacts from our nexus repository using wget to pull the artifacts via the Nexus Rest API.</p>
  
  <p>The url that I hit with wget is similar to this:</p>
  
  <p><a href="http://our.nexus.net:8081/nexus/service/local/artifact/maven/redirect?g=com.somecompany&amp;a=SomeArtifact&amp;v=1.0.0&amp;r=releases&amp;p=war" rel="nofollow">http://our.nexus.net:8081/nexus/service/local/artifact/maven/redirect?g=com.somecompany&amp;a=SomeArtifact&amp;v=1.0.0&amp;r=releases&amp;p=war</a></p>
  
  <p>It works fine in our dev environment, and pulls an artifact with the name <code>SomeArtifact-1.0.0.war</code>.</p>
  
  <p>However, in our test environment, it pulls the artifact correctly, but gives it the name:</p>
  
  <p><code>redirect?g=com.somecompany&amp;a=SomeArtifact&amp;v=1.0.0&amp;r=releases&amp;p=war</code></p>
  
  <p>Any ideas as to why it is not renaming it correctly?</p>
  
  <p>Here is an example output from wget when it names it wrong.</p>
  
  <pre><code>--2015-05-11 11:22:12-- http://our.nexus.net:8081/nexus/service/local/artifact/maven/redirect?g=com.somecompany&amp;a=SomeArtifact&amp;v=1.0.0&amp;r=releases&amp;p=war
  Resolving our.nexus.net... (IP)
  Connecting to our.nexus.net|(IP)|:8081... connected.
  HTTP request sent, awaiting response... 307 Temporary Redirect
  Location: http://our.nexus.net:8081/nexus/service/local/repositories/releases/content/com/somecompany/SomeArtifact/1.0.0/SomeArtifact-1.0.0.war [following]
  --2015-05-11 11:22:12-- http://our.nexus.net:8081/nexus/service/local/repositories/releases/content/com/somecompany/SomeArtifact/1.0.0/SomeArtifact-1.0.0.war
  Reusing existing connection to our.nexus.net:8081.
  HTTP request sent, awaiting response... 200 OK
  Length: 22046212 (21M) [application/java-archive]
  Saving to: "/tmp/deploy/redirect?g=com.somecompany&amp;a=SomeArtifact&amp;v=1.0.0&amp;r=releases&amp;p=war"
  
  100%[======================================================&gt;] 22,046,212 56.7M/s in 0.4s
  
  2015-05-11 11:22:12 (56.7 MB/s) - "/tmp/deploy/redirect?g=com.somecompany&amp;a=SomeArtifact&amp;v=1.0.0&amp;r=releases&amp;p=war" saved [22046212/22046212]
  </code></pre>
  
  <p>And when it does the naming correctly:</p>
  
  <pre><code>--2015-05-11 11:22:12-- http://our.nexus.net:8081/nexus/service/local/artifact/maven/redirect?g=com.somecompany&amp;a=SomeArtifact&amp;v=1.0.0&amp;r=releases&amp;p=war
  Resolving our.nexus.net... (IP)
  Connecting to our.nexus.net|(IP)|:8081... connected.
  HTTP request sent, awaiting response... 307 Temporary Redirect
  Location: http://our.nexus.net:8081/nexus/service/local/repositories/releases/content/com/somecompany/SomeArtifact/1.0.0/SomeArtifact-1.0.0.war [following]
  --2015-05-11 11:22:12-- http://our.nexus.net:8081/nexus/service/local/repositories/releases/content/com/somecompany/SomeArtifact/1.0.0/SomeArtifact-1.0.0.war
  Reusing existing connection to our.nexus.net:8081.
  HTTP request sent, awaiting response... 200 OK
  Length: 22046212 (21M) [application/java-archive]
  Saving to: "/tmp/deploy/SomeArtifact-1.0.0.war"
  
  100%[======================================================&gt;] 22,046,212 56.7M/s in 0.4s
  
  2015-05-11 11:22:12 (56.7 MB/s) - "/tmp/deploy/SomeArtifact.1.0.0.war" saved [22046212/22046212]
  </code></pre>
  
  <p>EDIT: some additional information below.</p>
  
  <p>Both the dev and test environment have wget version 1.12.</p>
  
  <p>The dev server, where it works is running RedHat Enterprise Linux OS version 6.4.
  The test server, where it does not work is version 6.6.</p>