I have an application that extracts from data from a database.
It is always the same columns in the same tables. But some time database is DB2 other times it is Oracle.
This means that the database drivers may differ from customer to customer.
I use the Application plugin to make a distribution of my application.
The plan is that the customer get my application and copies there driver jars into the lib folder. (or some other folder)
I can’t figure out how to make a wildcard in the classpath in the execution scripts.
This is the classpath part of the .bat file created.
set CLASSPATH=%APP_HOME%\lib\EncyclopediaDumper.jar;%APP_HOME%\lib\db2jcc4.jar;%APP_HOME%\lib\db2jcc_license_cu.jar
I would like something like:
set CLASSPATH=%APP_HOME%\lib\EncyclopediaDumper.jar;%APP_HOME%\db-lib\*
You should be able to modify the classpath of the task type CreateStartScripts via the property classpath. Keep in mind that Java does not support a wildcard-based classpath definition as indicated by db-lib*. You will need to determine the concrete paths dynamically in your code.
A problem occurred evaluating root project 'EncyclopediaDumper'.
Could not normalize path for file 'C:\Users\kec\workspace_neon\XcodeCon3\EncyclopediaDumper\db-lib\*'.
I’m not sure that I’m explaining myself well enough.
The folder “db-lib” in my application is empty and shall be empty.
Customer receives my application.zip unzip it and copy his/hers driver jars into the folder “db-lib”.
So I need the classpath to be something like: “CLASSPATH=%APP_HOME%\lib\EncyclopediaDumper.jar;%APP_HOME%\db-lib\*”
I need this: “db-lib\*” because the drivers can be named anything.
The property classpath only accepts file paths that can be normalized. So a wildcard definition won’t work. I suggest that you provide your own script template that already adds it to the CLASSPATH environment variable.