I don't know how to properly access files from java when using maven. I know there are a lot of other questions/answers out there very similar to this but i haven't been able to get any of them to work for me.
Right now i have the code file i hope to be opening the data files with in this directory:
maven_project/src/main/java/project/package/source_file.java
in the pom.xml i'm including the resources like so:
<build>
<resources>
<resource>
<directory>src/main/resources/question_contents</directory>
<includes>
<include>*.json</include>
</includes>
</resource>
</resources>
</build>
The resource files are correctly being coppied to
maven_project/target/classes
the command i'm using to build right now is
mvn package
If it matters, i'm using linux
I am willing to change any aspect of this setup in order to open files.
I would prefer to open them as a FileInputStream
but i can work with anything.
Any help would be much appreciated.
Update
I tried the answers in the suggested duplicate question, still no luck. Something that i didn't think about before was that this is being done in a method in a abstract class, idk what impact that would have on the refrences to this
.
Also i know this worked at one point. Before moving everything to maven i had everything lumped in one folder, there were no issues.