We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose license in Maven project

What is the recommended approach for loading the license file to a maven project. I am defining the following resource in the maven build section of the pom.xml file





src/main/resources/aspose/licenses

licenses



Aspose.Total.Java.lic







Within my java class static method I am reading it as follows:



InputStream stream=AsposeLicense.class.getClassLoader().getResourceAsStream(“licenses/Aspose.Total.Java.lic");



stream is always null.



I have verified that my war file includes the license file.



WEB-INF/classes/licenses/

WEB-INF/classes/licenses/Aspose.Total.Java.lic

Hi Mike,

We are working on your query and will update you soon.

Best Regards,

I have resolved this issue using the following. Please note that I am still interested in your recommendations.



pom.xml defined the following resource

directory - src/main/resources/licenses

targetPath - licenses

include - Aspose.Total.Java.lic



From java I read it as an input stream.

InputStream stream=AsposeLicense.class.getClassLoader().getResourceAsStream(“licenses/Aspose.Total.Java.lic”);

Hi Mike,

Yes, your solution is correct. Defining a resource in porn.xml and loading license from that path is a better option.

Best Regards,