Nadahar / external-maven-plugin

This is a fork of "Maven External Dependency Plugin", http://code.google.com/p/maven-external-dependency-plugin/. This Maven plugin allows downloading, installing, and deploying dependency artifacts that are not stored in a Maven repository.
1 stars 0 forks source link

Handle redirects transparently #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Use plugin with the following configuration
            <artifactItem>
              <groupId>com.github.voldemort</groupId>
              <artifactId>voldemort</artifactId>
              <version>0.90.1</version>
              <packaging>tar.gz</packaging>
              <downloadUrl>https//github.com/downloads/voldemort/voldemort/voldemort-0.90.1.tar.gz</downloadUrl>
              <extractFile>voldemort-0.90.1/dist/voldemort-0.90.1.jar</extractFile>
            </artifactItem>

What is the expected output? What do you see instead?
The plugin doesn't handle the HTTP status code 302 redirect and reports an 
invalid GZIP file.  It should handle the redirect transparently.

What version of the product are you using? On what operating system?
0.5

Please provide any additional information below.

Original issue reported on code.google.com by mgeorge@nmdp.org on 27 Sep 2012 at 9:19

GoogleCodeExporter commented 9 years ago
fixed as 
http://code.google.com/p/maven-external-dependency-plugin/issues/detail?id=15

try

<groupId>com.savage7.maven.plugins</groupId>
<artifactId>maven-external-dependency-plugin</artifactId>
<version>0.6-SNAPSHOT</version>

test

[INFO] --- maven-external-dependency-plugin:0.6-SNAPSHOT:resolve-external 
(resolve-install-external-dependencies) @ xss ---
[INFO] starting to resolve external dependencies
[INFO] attempting to resolve external artifact: 
com.github.voldemort:voldemort:0.90.1:tar.gz
Downloading: 
http://repository.jboss.org/maven2/com/github/voldemort/voldemort/0.90.1/voldemo
rt-0.90.1.tar.gz
[INFO] downloading artifact from URL: 
https://github.com/downloads/voldemort/voldemort/voldemort-0.90.1.tar.gz
[INFO] extracting target file from downloaded compressed file: 
voldemort-0.90.1/dist/voldemort-0.90.1.jar
[INFO] Expanding: 
/var/folders/v1/653c1tys2z97_kc_xm855nz80000gn/T/voldemort-0.90.1.tar.gz22106410
45021318846.tar.gz into 
/var/folders/v1/653c1tys2z97_kc_xm855nz80000gn/T/voldemort-0.90.1.tar.gz22106410
45021318846.tar.gz92684439.dir
[INFO] extracted target file to staging path: 
/Users/vharseko/Documents/workspace/test/ru.org.openam.xss/target/dependencies/v
oldemort-0.90.1.tar.gz
[INFO] external artifact downloaded and staged: 
com.github.voldemort:voldemort:0.90.1:tar.gz

Original comment by vharseko@openam.org.ru on 28 Sep 2012 at 8:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
My test still failed - pom and debug output attached.

Looks like an extra slash was added to URL
java.io.FileNotFoundException: 
https://github.com//downloads/voldemort/voldemort/voldemort-0.90.1.tar.gz

Original comment by mgeorge@nmdp.org on 28 Sep 2012 at 2:28

Attachments:

GoogleCodeExporter commented 9 years ago
removed extra slash: 
http://code.google.com/p/maven-external-dependency-plugin/source/detail?r=131

for following redirects, may be need add in pom.xml (don't need in m2e, 
embedded in eclipse - maven v304):
<build>
    <extensions>
        <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-http-lightweight</artifactId>
                <version>2.2</version>
            </extension>
    </extensions> 

imacvharseko:00 vharseko$ mvn -version
Apache Maven 3.0.3 (r1075438; 2011-02-28 20:31:09+0300)
Maven home: /usr/share/maven
Java version: 1.7.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.2", arch: "x86_64", family: "mac"

imacvharseko:00 vharseko$ mvn install
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building external-dependency-test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-external-dependency-plugin:0.6-SNAPSHOT:resolve-external 
(resolve-install-external-dependencies) @ external-dependency-test ---
[INFO] starting to resolve external dependencies
[INFO] attempting to resolve external artifact: 
org.immunogenomics.gl.voldemort:voldemort:0.90.1:tar.gz
[INFO] downloading artifact from URL: 
https://github.com/downloads/voldemort/voldemort/voldemort-0.90.1.tar.gz
[INFO] extracting target file from downloaded compressed file: 
voldemort-0.90.1/dist/voldemort-0.90.1.jar
[INFO] Expanding: 
/var/folders/v1/653c1tys2z97_kc_xm855nz80000gn/T/voldemort-0.90.1.tar.gz24786757
42411050056.tar.gz into 
/var/folders/v1/653c1tys2z97_kc_xm855nz80000gn/T/voldemort-0.90.1.tar.gz24786757
42411050056.tar.gz1671726750.dir

Original comment by vharseko@openam.org.ru on 28 Sep 2012 at 8:31

GoogleCodeExporter commented 9 years ago
My test now passes.
I didn't need to make any changes to pom.xml.

Original comment by mgeorge@nmdp.org on 1 Oct 2012 at 1:19

GoogleCodeExporter commented 9 years ago

Original comment by vharseko@openam.org.ru on 2 Oct 2012 at 8:07

GoogleCodeExporter commented 9 years ago
0.6-SNAPSHOT deployed to inclue this fix.

Original comment by rob...@savage7.com on 2 Oct 2012 at 1:57