#How to do a bindgen if the java jar uses a 3rd party dependency which is not in maven central

1 messages · Page 1 of 1 (latest)

wild lotus
#

I've created a java bundle locally as DNSBasedPodIPResolver-0.0.1-SNAPSHOT.jar and it's available in my local maven repo.

Inside this project i am using org.xbill.DNS dependency which is not in maven central but in another maven repo(https://www.jabylon.org/maven/).

Therefore, when i run following bindgen command,
bal bindgen -mvn org.wso2.apk:DNSBasedPodIPResolver:0.0.1-SNAPSHOT org.wso2.apk.kubernetes.resolver.DNSBasedPodIPResolver

it gives following error,
Ballerina package detected at: /Users/admin/Documents/repos/feature/apk/devportal/devportal-domain-service/ballerina

Resolving maven dependencies...

Failed to generate the Ballerina bindings.
error: unable to resolve the maven dependency: Could not find artifact org.xbill:dns:2.0.8 in central (https://repo.maven.apache.org/maven2/)

How to give ballerina to check that other repository(https://www.jabylon.org/maven/) for this dependency and proceed with bindgen

north plover
#

@wild lotus currently the bindgen tool doesn't support resolving artifacts from custom maven repositories. We already have this in our roadmap (https://github.com/ballerina-platform/ballerina-lang/issues/38994) and we'll update the ETA for this in the issue itself.
in the meantime, will it be a feasible option for you to download the jar manually and, provide to the bindgen tool via classpaths (as a workaround until we get the support)?
(i.e. bal bindgen -cp <path-to-jar> <class-name>)

GitHub

Description When bindgen ava code which contains dependencies from custom maven repository. it's not retrieve from there due to hardcoded repositories. https://github.com/ballerina-platform...