Running an exploded spring-boot jar from command line
Asked Answered
P

3

6

I'm looking to run an exploded spring-boot jar. Currently I'm doing

jar xf app.jar
java -cp /lib/*:/ com/domain/module/Main

which seems to begin the app startup, but invariably stops on

[restartedMain] INFO c.a.a.spring.MetricsJersey2Config - Registering InstrumentedResourceMethodApplicationListener for jersey2 with MetricRegistry: com.codahale.metrics.MetricRegistry@43fee23e

The next line I'd usually expect to see is

[restartedMain] INFO o.s.s.c.ThreadPoolTaskExecutor - Initializing ExecutorService

Running the app using

java -jar app.jar

works fine, but for reasons I need to run it exploded.

Is there anything I'm missing in trying to run a spring-boot app this way?

Peony answered 24/2, 2016 at 2:38 Comment(0)
P
5

I solved this by running:

java -cp /lib/*:/ com.domain.module.Main

Rather than:

java -cp /lib/*:/ com/domain/module/Main
Peony answered 22/3, 2016 at 0:3 Comment(0)
G
2

In July 2023, with Java 19 and SpringBoot 3.0.6.

I exploded my SringBoot jar. This command line started the app.

java -cp "BOOT-INF/lib/*:." org.springframework.boot.loader.JarLauncher `

Grilled answered 11/7, 2023 at 23:1 Comment(0)
S
0

i'm facing this problem too ! don't forget to copy your clashpath of your .class in main package and spring boot org.springframework package, for example :-cp ./com/*:./org/*

Seedman answered 21/3, 2016 at 6:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.