I thought about using "Extract *.zip/*.tar.gz instead, and pointing it to a 
custom Gradle distribution at an inhouse URL.

However the gradle distribution is unpackaged into a second subdirectory:
    /jenkins/tools/hudson.plugins.gradle.GradleInstallation/gradle-5.6/
gradle-5.6.1
While the tool gives me the directory:
    /jenkins/tools/hudson.plugins.gradle.GradleInstallation/gradle-5.6
And I expect gradle executable should be:
    ${gradleTool}/bin/gradle

Unpacking 
https://nexus.company.no:8443/repository/gradle-distributions/gradle-5.6.1-bin.zip
 
<https://nexus.spacetec.no:8443/repository/gradle-distributions/gradle-5.6.1-bin.zip>
 to 
/home/build/jenkins/tools/hudson.plugins.gradle.GradleInstallation/gradle-5.6 
on sles12.3-x86_64_4


+ 
/home/build/jenkins/tools/hudson.plugins.gradle.GradleInstallation/gradle-5.6/bin/gradle
 -version
/home/build/jenkins/workspace/pipeline-tests/pipeline-gradle-tools@tmp/durable-81b2542a/script.sh:
 line 1: 
/home/build/jenkins/tools/hudson.plugins.gradle.GradleInstallation/gradle-5.6/bin/gradle:
 No such file or directory



I have been trying to use a "Shell command" instead, but am having 
difficulty scripting a quick no-op if the tool is already installed. 
Getting none of the Bash magic for checking empty directory to work.


onsdag 25. september 2019 11.38.23 UTC+2 skrev Sverre Moe følgende:
>
> There is no Exception thrown when running that in script console.
>
> Result: PK 
> A 
> gradle-5.6.2/ PK 
> AĘ|����H !gradle-5.6.2/getting-start
>
> Same for Maven
> hudson.ProxyConfiguration.getInputStream(new URL("
> https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip";)).text.substring(0,
>  
> 100)
>
> Result: PK  
>  B� O apache-maven-3.6.2/PK  
>  =� O apache-maven-3.6.2/li
>
>
>
> onsdag 25. september 2019 11.13.13 UTC+2 skrev Daniel Beck følgende:
>>
>> Run the following in the Jenkins script console:
>>
>> hudson.ProxyConfiguration.getInputStream(new URL("
>> https://services.gradle.org/distributions/gradle-5.6.2-bin.zip";)).text.substring(0,
>>  
>> 100)
>>
>> Note that this loads the entire downloaded file, if successful, into 
>> memory, so not quite production quality code ;-)
>>
>> Replace the URL as needed to try whatever URLs are listed as being 
>> downloaded with the different installers. The expectation for zip files is 
>> that the output starts with "PK". If the same exception gets thrown for 
>> Groovy/Gradle, while Maven works, it's SSL after all. (Gradle Wrapper would 
>> run probably on a different machine, with different JRE, so that doesn't 
>> tell you much.)
>>
>>
>> On Wed, Sep 25, 2019 at 10:59 AM Sverre Moe <[email protected]> wrote:
>>
>>> Both the MavenInstaller and GradleInstaller are very similar
>>>
>>> public static class MavenInstaller extends DownloadFromUrlInstaller {
>>> public class GradleInstaller extends DownloadFromUrlInstaller {
>>>
>>> I thought perhaps they used different implementation, and that was the 
>>> reason for why GradleInstaller had problems.
>>>
>>> https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/Maven.java
>>>
>>> https://github.com/jenkinsci/gradle-plugin/blob/master/src/main/java/hudson/plugins/gradle/GradleInstaller.java
>>>
>>>
>>> Both Jenkins Server and Build agents are behind a firewall. The Jenkins 
>>> has proxy configured, but the build agents do not have any proxy configured.
>>> I have same problem using Gradle wrapper, but as mentioned earlier here 
>>> gradle wrapper works if I configure proxy properties.
>>>
>>>
>>> onsdag 25. september 2019 10.41.32 UTC+2 skrev Sverre Moe følgende:
>>>>
>>>> Which projects has the source code for the Maven, Gradle and Groovy 
>>>> Tool installers? I want to have a check to see if there is something to be 
>>>> done on the Gradle and Groovy tool installers.
>>>>
>>>> onsdag 25. september 2019 10.30.17 UTC+2 skrev Sverre Moe følgende:
>>>>>
>>>>> The Gradle tool installer is not the only tool having this problem. I 
>>>>> am getting the same SSL problem with Groovy tool installers.
>>>>>
>>>>> Makes me wonder, what does the maven tool installer do different than 
>>>>> the Gradle and Groovy tool installers.
>>>>>
>>>>> mandag 23. september 2019 22.26.10 UTC+2 skrev Sverre Moe følgende:
>>>>>>
>>>>>> I have gotten this problem both for Jenkins running Java 8u221 and 
>>>>>> Java 11.0.4+11. The latest for both 8 and 11.
>>>>>>
>>>>>> Maven tool download works just fine, using the same JDK, so why would 
>>>>>> the gradle installer have a problem?
>>>>>>
>>>>>> I do not like to check in the gradle wrapper files into version 
>>>>>> control, but considering it might ease new developers I am beginning to 
>>>>>> lean into it.
>>>>>>
>>>>>> mandag 23. september 2019 18.25.04 UTC+2 skrev Jan Monterrubio 
>>>>>> følgende:
>>>>>>>
>>>>>>> I’ve always relied on projects supplying the gradle wrapper 
>>>>>>> instead... that might be a good alternative if you can’t upgrade the JRE
>>>>>>>
>>>>>>> On Mon, Sep 23, 2019 at 05:37 Daniel Beck <[email protected]> 
>>>>>>> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Sep 23, 2019 at 2:28 PM Sverre Moe <[email protected]> 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> ERROR: Failed to download 
>>>>>>>>> https://services.gradle.org/distributions/gradle-5.6.2-bin.zip from 
>>>>>>>>> agent; will retry from master
>>>>>>>>>
>>>>>>>>> sun.security.provider.certpath.SunCertPathBuilderException: unable to 
>>>>>>>>> find valid certification path to requested target
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Which makes me believe that the Gradle tool does not use Jenkins 
>>>>>>>>> Proxy settings, while Maven tools does use it.
>>>>>>>>>
>>>>>>>>
>>>>>>>> The error means it's an SSL issue. If you're on an old JRE, update 
>>>>>>>> it. 
>>>>>>>>
>>>>>>>> -- 
>>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>>> Groups "Jenkins Users" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>>> send an email to [email protected].
>>>>>>>> To view this discussion on the web visit 
>>>>>>>> https://groups.google.com/d/msgid/jenkinsci-users/CAMo7PtLJW%2BeMQ-509sB%2Bv%2BdAtz_%3DDudWMsiE-eCdZYfduAPcyA%40mail.gmail.com
>>>>>>>>  
>>>>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CAMo7PtLJW%2BeMQ-509sB%2Bv%2BdAtz_%3DDudWMsiE-eCdZYfduAPcyA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/a8ae71dc-3515-499c-a038-26a80eebc3a0%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/a8ae71dc-3515-499c-a038-26a80eebc3a0%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>>
>> Daniel Beck
>> Senior Software Engineer
>> CloudBees, Inc.
>>
>> [image: CloudBees-Logo.png]
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b189d1ce-3924-4490-89b6-6516e1b2e5f9%40googlegroups.com.

Reply via email to