In IntelliJ, I "view", "tools window", "Maven project", and then I use "package" to create a *.jar-with-dependencies.jar file for my project. I specified my main class in the pom.xml. When I run it in the target/ directory, it has no problem. However, I need to copy the jar to another place to run in at command line, then I ran into a problem, it can't find the input file which resides in the data/ directory under my root directory.
I guess it's because the data/ directory isn't packaged in the jar. Why is it that? Is that because the 'data/' is specified in my .gitignore file? What I really want is to exclude the whole data/ directory to be included in the jar, but only include a subdirectory of the data/ in the jar, so that when I run my jar at command line, I don't have to modify my code to pass the input file directory as a command line argument. More specifically,
I want the "data/search" to be included in the jar, but not the data/ root. Is there a way to achieve this? Thanks.