I am trying to generate classes for a SOAP webservice through a gradle script. I am using a plugin gradle-jaxws-plugin
which is available in maven central.
My script looks like below:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "eu.schnuckelig.gradle:gradle-jaxws-plugin:1.0.2"
}
}
apply plugin: 'maven'
apply plugin: 'jaxws'
jaxws {
System.setProperty('javax.xml.accessExternalSchema', 'all')
packageName = 'com.myservice'
wsdlURL = 'https://example.org/services/users.svc?wsdl'
}
repositories {
mavenCentral()
}
If I use this script as it is, I get following error
[ant:wsimport] [ERROR] sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
One way of resolving this error, I tried is gradle build -Djavax.net.ssl.trustStore=cacerts -Djavax.net.ssl.trustStorePassword=changeit
. This worked. But I want to pass these jvm properties in build script.
I tried systemProperty.set()
, but it didn't work. I am trying with gradle.properties
, but that doesn't work either. Is there a clean way to pass these properties? Also I am wondering how I will handle this in production when I will have an automated build.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…