Fork me on GitHub
#leiningen
<
2024-04-02
>
Takis_15:04:05

i made a spring boot webflux hello world, lein run works fine, but when i do lein uberjar and the java -jar my-standalone.jar doesn't work

Takis_15:04:09

can leiningen make uberjars for spring-boot? i should do something extra to make it work?

Takis_15:04:53

java -jar demo-lein-0.1.0-SNAPSHOT-standalone.jar 

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.3)

18:54:19.529 [main] INFO com.example.demo.DemoApplication -- Starting DemoApplication using Java 17.0.10 with PID 24345 (/home/white/IdeaProjects/java-spring/java-spring-uberjar/demo-lein/demo-lein-0.1.0-SNAPSHOT-standalone.jar started by white in /home/white/IdeaProjects/java-spring/java-spring-uberjar/demo-lein)
18:54:19.534 [main] INFO com.example.demo.DemoApplication -- No active profile set, falling back to 1 default profile: "default"
18:54:20.866 [main] INFO com.example.demo.DemoApplication -- Started DemoApplication in 1.552 seconds (process running for 1.879)

and then terminates, looks like Netty doesn't start at all

Takis_15:04:06

lein run
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.3)

2024-04-02T18:55:28.314+03:00  INFO 24408 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication using Java 17.0.10 with PID 24408 (/home/white/IdeaProjects/java-spring/java-spring-uberjar/demo-lein/target/classes started by white in /home/white/IdeaProjects/java-spring/java-spring-uberjar/demo-lein)
2024-04-02T18:55:28.317+03:00  INFO 24408 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to 1 default profile: "default"
2024-04-02T18:55:29.629+03:00  INFO 24408 --- [           main] o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port 8080
2024-04-02T18:55:29.644+03:00  INFO 24408 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 1.729 seconds (process running for 2.811)

this is ok, server listens on 8080

seancorfield16:04:08

Oh, except that's empty...

seancorfield16:04:41

@U68Q5G1BJ Maybe you didn't push the code, or the repo is private?

Takis_16:04:09

no i am sorry https://github.com/tkaryadis/demo-lein , i forgot to make it public

Takis_16:04:13

now its ok, i will be back in 30 min i have to do something, thank you for trying to help me, first time i tried uberjar with spring-webflux

seancorfield17:04:29

I had a look and I don't know why it works with lein run but fails to start Netty when bundled as a JAR...

Takis_17:04:46

thank you for trying to help me. maybe someone will know, also i wonder leiningen and spring can be used? or i have to use something like clojurephant and gradle? i use webflux and HTMX development with lein it was very easy, only the uberjar problem