New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSV file for DryMode not found when executing from .jar #843
Comments
@sebasira Hi ! why do you want to make a jar with those kinds of files included ? |
I don't! I just want to make a I also try with the I'm thinking the file path could be the problem when loading the file with |
@sebasira indeed, when making a jar, the files in src/test are not taken. Can you move your csv files to src/main/resources ? |
They are already at src/main/resources. From the screenshot of the first post, you can see that the the generate jar has the CSV |
I've try to add a log entry at the point where |
@sebasira you can build and isntall cassandre release by typing: |
@sebasira can you tell me the command you used to create the jar ? Thx |
@sebasira i'm sorry. My question was, what command did you use to build your |
Oh I see! I've built my app with gradle wrapper using
|
@sebasira did you try with this https://stackoverflow.com/a/52404325 |
I manage to build this project (maven) and use the |
Well... I'm back... This entire comment is about this line After a lot and a lot and a lot of testing here's what I've found out: 1- I couldn't find (yet) a method that works for both: file in the resource folder and file outside the 2- The actual code: Scanner scanner = new Scanner(file.getFile()) only works (at least for me) when debugging the app. I mean run it from the IDE (IntelliJ) 3- Replacing it with: Scanner scanner = new Scanner(file.getInputStream()) works with the complied 4- Using this other line: Scanner scanner = new Scanner(new FileReader(file.getFilename())) Does not load the file inside the resource folder, but read the outer file, sitting next to the At this point my idea is to:
|
@sebasira don't you think the problem come from this method:
|
Release number
v5.0.6
Describe the bug
I've created a
.jar
file and when executing it likeThere's a log entry saying that the
user-trade.csv
file can not be foundI have no problem when debugging from the IDE. What's strange is that the file is present inside the
.jar
and I've also put it outside the.jar
, in the same directoyTo Reproduce
I can only reproduce it when running the external jar
Expected behavior
I would expect the file to be picked up and the fake account will be configured
Screenshots
Here you can see the CSV inside the
.jar
The text was updated successfully, but these errors were encountered: