Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8331164

createJMHBundle.sh download jars fail when url needed to be redirected

XMLWordPrintable

    • b21
    • generic
    • generic

        The curl command lack of "-L" options, cause download file fail(the size of download file is empty).take below command as example:

        > rm -rf jmh-core-1.37.jar ; curl -O --fail https://maven.aliyun.com/repository/public/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar ; ls -lh jmh-core-1.37.jar ; du -sh jmh-core-1.37.jar
          % Total % Received % Xferd Average Speed Time Time Time Current
                                         Dload Upload Total Spent Left Speed
          0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
        -rw-rw-r-- 1 yansendao yansendao 0 Apr 26 10:54 jmh-core-1.37.jar
        0 jmh-core-1.37.jar


        When add the -L option, curl download the link success, as below:

        > rm -rf jmh-core-1.37.jar ; curl -OL --fail https://maven.aliyun.com/repository/public/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar ; ls -lh jmh-core-1.37.jar ; du -sh jmh-core-1.37.jar
          % Total % Received % Xferd Average Speed Time Time Time Current
                                         Dload Upload Total Spent Left Speed
          0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
        100 540k 100 540k 0 0 1084k 0 --:--:-- --:--:-- --:--:-- 2596k
        -rw-rw-r-- 1 yansendao yansendao 541K Apr 26 10:58 jmh-core-1.37.jar
        544K jmh-core-1.37.jar

              syan Sendao Yan
              syan Sendao Yan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: