Closed shanon84 closed 7 months ago
Hej @shanon84 This has been fixed I think…
https://github.com/michael-simons/neo4j-migrations/issues/1153#issuecomment-1834495373
Which version are you using?
springboot 3.2.2 neo4j migration 2.9.0, but I tested it again with 2.9.1: same problem. The error we are getting is the following: Caused by: java.io.FileNotFoundException: JAR entry BOOT-INF/lib/backend-neo4jmigration-mylibname-0.0.1.jar!/neo4j/migrations/2023-12/V001__init_indexes_and_constraints.xml not found
Can you switch back to the classic loader?
Relevant configuration for Maven Spring Boot plugin…
<configuration>
<loaderImplementation>CLASSIC</loaderImplementation>
</configuration>
yes, as I menitioned in the first posting, this is our temporarly workaround :)
Aaah, sorry, I missed that. Edited some backticks in.
I try to see if find some time next week to investigate.
Hey @shanon84 So do I get this right: Your migrations are part of a jar which itself is part of the boot app? that is, the migrations are not direct resources of the spring boot app?
I am quite convinced I have the same setup in our IT:
See resources project:
SB integration tests depends on it https://github.com/michael-simons/neo4j-migrations/blob/5dbbe0ab5e0b5b68509729569a97b0d07bfc338c/neo4j-migrations-examples/neo4j-migrations-examples-sb/pom.xml#L60
Config pointing to it: https://github.com/michael-simons/neo4j-migrations/blob/bf4b3e13516cc5ee32cd098cb06d8d56110f8686/neo4j-migrations-examples/neo4j-migrations-examples-sb/src/main/resources/application.properties#L17
Integration tests goes a couple of miles to make sure it's running the jar https://github.com/michael-simons/neo4j-migrations/blob/bf4b3e13516cc5ee32cd098cb06d8d56110f8686/neo4j-migrations-examples/neo4j-migrations-examples-sb/src/test/java/ac/simons/neo4j/migrations/examples/sb/ApplicationIT.java#L85
Ha! Can replicate it. Thanks for involuntary rubber-ducking with me!
This is fixed in 2.9.2, which is on its way to central. Thanks for your report!
Hey, we run into a problem with springboot 3.2.x, fatjars and neo4j migration currently. With 3.2 springboot rewrote the hole technic to make and handle fat jars. Neo4j migration seems to not be able to work with this properly. Our setup: we have a kind of app shell. A maven project only beeing responsible for making an app/fat jar out of our libs. The neo4j migration is used inside one lib. If we build a fat jar and start it with java -jar ourjar.jar neo4j migration cannot open the migrationscripts itself. The folder they are in is correctly identified and read, but opening the first file leads to a FileNotFoundException.
For others: If you run into this problem, you can switch back to the classic way of springboot building and handling fat jars by adding
to your spring-boot-maven-plugin config to fix the problem for now.