I have a following issue. My project structure is that of a typical maven Java project:
src/main/java - project .java files
src/main/resources - project resources (log4j2.xml)
src/test/java - .java files for tests
src/test/resources - testng.xml file
In the src/main/java I also have a package with JavaScript files (some scripts that I'm executing programmatically in Java code) at the following location: src/main/java/js/scripts/
Naturally I can access the *.js files inside the 'scripts' folder when I'm running tests - I'm simply using FileUtils.readFileToString(new File(pathTo_jsFile))
However after compilation of the project with maven this is no longer working.
I'm unable to compile with the files to be placed inside the existing package (/js/scripts/) - the only way I was able to add non-java files to the .jar is to add them as resources in pom.xml, but then they are getting added to the root of .jar file.
I'm unable to read anything from within the .jar file.