How to set a sysproperty for signjar?


(Horcrux7) #1

In ant we use the follow code:

<signjar executable=".../jarsigner.exe" ...>
    <sysproperty key="https.protocols" value="TLSv1.1,TLSv1.2"/>
</signjar>

In gradle we use:

System.setProperty('https.protocols', 'TLSv1.1,TLSv1.2')
ant.signjar( 
    '.../jarsigner.exe',
    ...
)

But it look like this does not work. How can we set a sysproperty for the signjar ant task?


(Horcrux7) #2

Ok, I found it. You need to pass nested elements with a closure:

ant.signjar( 
    '.../jarsigner.exe',
    ...
) {
    sysproperty( key: 'https.protocols', value: 'TLSv1.1,TLSv1.2' )
}