Import 3rd party jars into CloverDX

Discussion on developing CloverDX engine, transformation components etc.

ryang420
Posts: 2
Joined: Fri Feb 21, 2020 10:25 am

Import 3rd party jars into CloverDX

Postby ryang420 » Mon Feb 24, 2020 3:29 am

Hi all,
As we know, when you're using java related components, like CustomJavaReader, you probably need to import some 3rd party jars. Instead of adding the jar file on the classpath explicitly (in CloverDX Designer right click / Project / Java Build Path / Libraries), can we use Maven (or Gradle) to manage these Jar files? Because the jar file you imported may depend on other Jars as well.

cholastal
Posts: 137
Joined: Tue Sep 01, 2015 1:22 pm

Re: Import 3rd party jars into CloverDX

Postby cholastal » Thu Mar 19, 2020 12:42 pm

Hi,

Even though there is no native support for these tools in CloverDX software, you can use them externally to import all the dependencies. You need to have a pom.xml file which is used to download the libraries in a Maven project, containing all the needed dependencies. The idea is to use this pom.xml and a script that would use Maven CLI tool to download the libraries and their dependencies for you.

As I mentioned, you need to provide the pom.xml. Attached is a simple script that uses the Maven CLI to download the libraries. Copy the attached script file and the pom.xml into the root of your project. By running the scrip file you'll download the libraries into the lib folder of your project. The last thing to do is to add the libraries on the classpath by navigating into the Properties of your project -> Java Build Path -> Libraries -> Add JARs... and select all the jars in your lib folder.

Please note the script will only work if you have Apache Maven installed on your system. Also, if you're on Linux, you'll need to adapt the script accordingly.

Best regards.
Attachments
download_libraries.zip
(716 Bytes) Downloaded 171 times

---
Lukas Cholasta
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com

ryang420
Posts: 2
Joined: Fri Feb 21, 2020 10:25 am

Re: Import 3rd party jars into CloverDX

Postby ryang420 » Fri Mar 20, 2020 6:19 am

Hi Lukas,
Thanks for your reply. I am working on a Macbook. Could you share with me some screenshots of how to use the download_libraries script to import relative jars? Thanks in advance.

cholastal
Posts: 137
Joined: Tue Sep 01, 2015 1:22 pm

Re: Import 3rd party jars into CloverDX

Postby cholastal » Mon Apr 20, 2020 4:50 pm

Hi,

I'm not sure what screenshots I can provide to be of any help as I'm not working on a MacOS X machine so there would be great differences in the usage of the script. If you have issues with adapting the script to MacOS, as far as I know, you should be only required to add "#!/bin/sh" as the very first line of the script file and change its suffix to ".sh". Then you just run it via command line. Other details on the usage are in my previous response. Unfortunately, this workaround goes beyond the CloverDX software itself and as such it is not officially supported. However, if you have any issues using it, we will try to be as helpful as possible. If you have any technical issues with the Maven software, please refer to the Maven documentation.

Best regards.

---
Lukas Cholasta
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com


cron