I have Java Gradle project and I am using third party library in my project which requires license.
I added license_.cxl on following path.
src/main/resources/license_.cxl
Before using any third party lib function I need to setLicense(String licenseFilePath). When I test the code using IntelliJ IDEA its working fine.
But when I create jar file and try to execute the same function, its giving me error - "Unable to set License, License file not found: src/main/resources/license_.cxl"
Then I added license_.cxl on custom folder(outside project directory) and hardcoded that path in my code then its working fine when I execute code by running jar file.
So I started checking third party code. I saw their code is trying to create new license file using provided path. I tried may stackoverflow solution to provide resources folder license_.cxl file path but nothing works for me other than keeping file on custom directory to run code using jar file.
Looks like issue is third party code is not able to create a new license file from the path where license_.cxl file is packaged inside my jar file.
How I can resolve the issue so that I can test the code by running jar file without keeping license_.cxl to custom directory.
Updated - following is the dir structure when I unzip jar file and license_.cxl file is inside BOOT-INF\classes folder.