Similar to this post, but for proprietary library.
If I want to import a java library that is not available in the normal repository, that is for example proprietary or custom, what should be the steps to follow ?
Create an artifact repository in Foundry, upload the library and reference it in Java transforms ?
Hey!
Yes, uploading to an artifacts repository and using that as backing repository to your regular code repository will allow you to use the jars pushed there.
An alternative is to connect your own Artifactory / custom repository to Foundry (if you have multiple such jars hosted in a repository) which currently is possible by opening a support ticket to Palantir.
1 Like
It seems that setting the proxy in the Windows command prompt is not working properly, so I tried a different approach.
After creating a gradle.properties
file in the C:\Users\User\.gradle
folder with the following content:
systemProp.http.proxyHost=11.111.111.111
systemProp.http.proxyPort=1111
systemProp.https.proxyHost=11.111.111.111
systemProp.https.proxyPort=1111
systemProp.gradle.internal.http.insecure=true
I saved the file and tried running gradle publish again. (It seemed like set http_proxy and set https_proxy were not being applied to Gradle…)
Now, I’m getting another error, which I think is probably a certificate error. Hmm…
2025-08-05T11:33:22.758+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2025-08-05T11:33:22.758+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2025-08-05T11:33:22.758+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2025-08-05T11:33:22.758+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':publishMavenPublicationToMavenRepository'.
2025-08-05T11:33:22.758+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to publish publication 'maven' to repository 'maven'
2025-08-05T11:33:22.758+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not write to resource 'https://****.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.5b3ec94d-7ed3-448a-bee8-62204cba2552/contents/release/maven/mysql/mysql-connector-java/8.0.33/mysql-connector-java-8.0.33.jar'.
2025-08-05T11:33:22.758+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I am currently trying to use an external library via Maven with an Artifact Repository, but I am experiencing some difficulties.
Could you please let me know if there is a solution?
Below are the steps I have taken so far, and although the error message seems to be related to a firewall issue, there are no firewall issues between my PC and the Foundry server.
Our company uses a proxy server, so before running gradle publish, I executed set http_proxy=11.11.11.11:1111
and set https_proxy=11.11.11.11:1111
in the command prompt.
-
I created an Artifact Repository in a folder where I have Owner permissions.
-
On my local PC, I created a build.gradle file and copied the instructions from the artifact repository’s publish menu (for testing purposes, I added the MySQL JDBC driver).
-
The contents of my build.gradle
file are as follows:
apply plugin: "maven-publish"
publishing {
repositories {
maven {
url = uri("https://***.palantirfoundry.com/artifacts/api/repositories/*******/contents/release/maven/")
credentials {
username ''
password auth
}
}
}
publications {
maven(MavenPublication) {
// Replace with group/id/version for package
groupId "mysql"
artifactId "mysql-connector-java"
version "8.0.33"
artifact ("mysql-connector-j-8.0.33.jar") // Replace with path to jar
}
}
}
- Since our company uses a proxy server, I ran the following commands:
set http_proxy=11.11.11.11:1111
set https_proxy=11.11.11.11:1111
gradle -d publish -P auth=xxxxxxx -P repositoryRid=yyyyyyy
- After running the above commands, I received the following error messages (I have copied only the parts that seem to be errors):
2025-08-05T10:30:40.497+0900 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Upload https://***.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.5b3ec94d-7ed3-448a-bee8-62204cba2552/contents/release/maven/mysql/mysql-connector-java/8.0.33/mysql-connector-java-8.0.33.jar'
2025-08-05T10:30:21.501+0900 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
2025-08-05T10:30:21.501+0900 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :publishMavenPublicationToMavenRepository
2025-08-05T10:30:40.497+0900 [DEBUG] [org.apache.http.aaa.conn.DefaultManagedHttpClientConnection] http-outgoing-6: Shutdown connection
2025-08-05T10:30:40.497+0900 [DEBUG] [org.apache.http.aaa.execchain.MainClientExec] Connection discarded
2025-08-05T10:30:40.497+0900 [DEBUG] [org.apache.http.aaa.conn.PoolingHttpClientConnectionManager] Connection released: [id: 6][route: {s}->https://***.palantirfoundry.com:443][total available: 0; route allocated: 0 of 20; total allocated: 0 of 20]
2025-08-05T10:30:40.497+0900 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Upload https://***.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.5b3ec94d-7ed3-448a-bee8-62204cba2552/contents/release/maven/mysql/mysql-connector-java/8.0.33/mysql-connector-java-8.0.33.jar' completed
2025-08-05T10:30:40.497+0900 [INFO] [org.gradle.api.internal.artifacts.repositories.transport.NetworkOperationBackOffAndRetry] Error in 'PUT https://***.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.5b3ec94d-7ed3-448a-bee8-62204cba2552/contents/release/maven/mysql/mysql-connector-java/8.0.33/mysql-connector-java-8.0.33.jar'. Waiting 1000ms before next retry, 2 retries left
2025-08-05T10:30:40.497+0900 [DEBUG] [org.gradle.api.internal.artifacts.repositories.transport.NetworkOperationBackOffAndRetry] Network operation failed
org.gradle.api.resources.ResourceException: Could not write to resource 'https://***.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.5b3ec94d-7ed3-448a-bee8-62204cba2552/contents/release/maven/mysql/mysql-connector-java/8.0.33/mysql-connector-java-8.0.33.jar'.
at org.gradle.internal.resource.ResourceExceptions.failure(ResourceExceptions.java:74)
at org.gradle.internal.resource.ResourceExceptions.putFailed(ResourceExceptions.java:61)