2

I have silly problem when running my application inside docker container or using jar file. When application is started locally migration library which is using reflections:

new Reflections("package").getTypesAnnotatedWith(SomeClass.class)

Is able to find classes with this annotation. But when it's executed inside docker container or from *.jar file - reflections is not finding any classes. Jar file which is used is built by maven.

Update: If we'll change packaging to war - everything id working correctly. But it would be better to have just jar file.

Tomasz
  • 21
  • 3
  • When you're talking about JAR, are you talking about a single fat/Uber JAR? Or do you have a directory with plenty of JARs? Or a single non Uber JAR? – Gaël J Dec 27 '21 at 09:47
  • Single jar generated by spring-boot-maven-plugin – Tomasz Dec 28 '21 at 10:15
  • This issue has been answered in this question: https://stackoverflow.com/a/70726642/1139514. There is a workaround. – Marco7757 Mar 30 '22 at 14:19

1 Answers1

0

It looks like it's related with reflections on version 0.10.2 I don't know the difference between *.war and *jar and why it's working correctly only on the *.war

Anyone know the difference ?

Tomasz
  • 21
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 23 '21 at 18:38