I am using spring boot maven plugin that creates a jar for me with dependencies in it. The problem is, I need to start as a Windows service and WinSW needs a start class. Thing is all dependecies are hidden in BOOT-INF/lib
and classes in BOOT-INF/classes
.
my-boot.jar
\
\BOOT-INF
\BOOT-INF\lib (jar dependencies)
\BOOT-INF\classes (compiled output)
\org\springframework... (Spring boot loader)
\com\mejmo\ServiceHelper.class <- here should be my class
I need some way to add my class at the classpath level (in root of jar, along with org.springframework.loader.*
which is the boot sequence + class loader for Spring Boot application). The service cannot call spring boot loader directly, but with help of my class which is processing start/stop commands.
I am using https://github.com/snicoll-scratches/spring-boot-daemon but it copies all dependencies to lib/
so that Windows service can load the jars including the custom class. The problem is when all dependecies are in jar.
Is there any way how to package my custom class at the level of the boot sequence in jar? I would like to do it solely with maven, without any manual copying, build should be automatically created in CI.
Can custom layout parameter in spring boot maven plugin be helpful?
UPDATE: I found out that I need org.springframework.boot.*
for my ServiceHelper class too! So this makes it even more complicated :(