I have custom taks for uploading an artifact to private repository via REST API using https and jersey-client library. The code is using HttpsProperties to configure Jersey Client, when SSL truststore is loaded to initiate TrustManagerFactory. If I run this code as regular Java Application is works OK, the strange thing happens when I run the exact same code as custom Gradle task - then the https communication cannot be established and I get “PKIX path building failed: … unable to find valid certification path to requested target” error. The custom task extends DefaultTask and task action is annotated with @TaskAction.
The https communication part is Java code, the custom task is Groovy code.
Is there something special about custom Gradle tasks regarding to loading trustores/keystores? Or handling keystores in general?
Thanks