Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redeploy Spring Boot jars #529

Closed
wants to merge 1 commit into from

Conversation

ericglau
Copy link
Contributor

@ericglau ericglau commented Sep 2, 2020

After recompiling a source change, if it is a Spring Boot project, call deploy so that any Spring Boot jars are redeployed.

@ericglau
Copy link
Contributor Author

ericglau commented Sep 2, 2020

A minor issue that is more obvious as a result of this is the following: currently a recompile occurs after dev mode first starts up. Even if there are no actual code changes (and the compile task is simply up to date), this triggers the deploy task to still run, resulting in the following output (notice the Spring Boot app starts twice). But this is caused by a known issue OpenLiberty/ci.maven#699.

Example output with Spring Boot app:

Working Directory: /Users/eric/git/demo-1
Gradle user home: /Users/eric/.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 5.6.4
Java Home: /Library/Java/JavaVirtualMachines/adoptopenjdk-11-openj9.jdk/Contents/Home
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: libertyDev

> Task :installLiberty UP-TO-DATE
> Task :libertyCreate UP-TO-DATE

> Task :installFeature


BUILD SUCCESSFUL in 5s
3 actionable tasks: 1 executed, 2 up-to-date
> Task :installLiberty UP-TO-DATE
> Task :libertyCreate UP-TO-DATE

> Task :installFeature


BUILD SUCCESSFUL in 1s
3 actionable tasks: 1 executed, 2 up-to-date
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :bootJar UP-TO-DATE
> Task :installLiberty UP-TO-DATE
> Task :libertyCreate UP-TO-DATE

> Task :installFeature


> Task :deploy

BUILD SUCCESSFUL in 3s
7 actionable tasks: 2 executed, 5 up-to-date
CWWKM2001I: Invoke command is [/Users/eric/git/demo-1/build/wlp/bin/server, debug, defaultServer].

Listening for transport dt_socket at address: 7777
Launching defaultServer (Open Liberty 20.0.0.3/wlp-1.0.38.cl200320200305-1433) on Eclipse OpenJ9 VM, version 11.0.5+10 (en_US)
[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.

> Task :libertyDev
CWWKM2010I: Searching for CWWKF0011I: in /Users/eric/git/demo-1/build/wlp/usr/servers/defaultServer/logs/messages.log. This search will timeout after 90 seconds.

[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.1.RELEASE)
2020-09-02 14:37:12.913  INFO 63279 --- [ecutor-thread-7] com.example.demo2.Demo1Application       : Starting Demo1Application on Erics-MacBook-Pro.local with PID 63279 (/Users/eric/git/demo-1/build/wlp/usr/servers/defaultServer/dropins/spring/thin-demo-1.jar started by eric in /Users/eric/git/demo-1/build/wlp/usr/servers/defaultServer)
2020-09-02 14:37:12.921  INFO 63279 --- [ecutor-thread-7] com.example.demo2.Demo1Application       : No active profile set, falling back to default profiles: default
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9080/
2020-09-02 14:37:15.425  INFO 63279 --- [cutor-thread-28] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2368 ms
2020-09-02 14:37:15.957  INFO 63279 --- [ecutor-thread-7] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-09-02 14:37:16.308  INFO 63279 --- [ecutor-thread-7] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-09-02 14:37:16.428  INFO 63279 --- [ecutor-thread-7] com.example.demo2.Demo1Application       : Started Demo1Application in 4.584 seconds (JVM running for 12.319)
 THIS IS Spring Boot Applciation Message.
[AUDIT   ] CWWKZ0001I: Application thin-demo-1 started in 5.540 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [localConnector-1.0, servlet-3.1, springBoot-2.0].
[AUDIT   ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 12.226 seconds.

> Task :libertyDev
CWWKM2015I: Match number: 1 is [9/2/20, 14:37:16:458 EDT] 00000038 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 12.226 seconds..
Press the Enter key to run tests on demand. To stop the server and quit dev mode, use Ctrl-C or type 'q' and press the Enter key.

> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE

BUILD SUCCESSFUL in 375ms
2 actionable tasks: 2 up-to-date
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :bootJar UP-TO-DATE
> Task :installLiberty UP-TO-DATE
> Task :libertyCreate UP-TO-DATE

> Task :installFeature


> Task :deploy
CWWKM2010I: Searching for CWWKZ0001I.*thin-demo-1 in /Users/eric/git/demo-1/build/wlp/usr/servers/defaultServer/logs/messages.log. This search will timeout after 30 seconds.
CWWKM2015I: Match number: 1 is [9/2/20, 14:37:16:436 EDT] 00000041 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application thin-demo-1 started in 5.540 seconds..

BUILD SUCCESSFUL in 2s
7 actionable tasks: 2 executed, 5 up-to-date

> Task :libertyDev
Source compilation was successful.

> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :compileTestJava UP-TO-DATE
> Task :processTestResources NO-SOURCE

BUILD SUCCESSFUL in 267ms
3 actionable tasks: 3 up-to-date
2020-09-02 14:37:21.071  INFO 63279 --- [ecutor-thread-5] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
[AUDIT   ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/
[AUDIT   ] CWWKZ0009I: The application thin-demo-1 has stopped successfully.
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.1.RELEASE)

> Task :libertyDev
Tests compilation was successful.

2020-09-02 14:37:26.896  WARN 63279 --- [cutor-thread-12] o.s.boot.StartupInfoLogger               : InetAddress.getLocalHost().getHostName() took 5006 milliseconds to respond. Please verify your network configuration (macOS machines may need to add entries to /etc/hosts).
2020-09-02 14:37:26.901  INFO 63279 --- [cutor-thread-12] com.example.demo2.Demo1Application       : Starting Demo1Application on Erics-MacBook-Pro.local with PID 63279 (/Users/eric/git/demo-1/build/wlp/usr/servers/defaultServer/dropins/spring/thin-demo-1.jar started by eric in /Users/eric/git/demo-1/build/wlp/usr/servers/defaultServer)
2020-09-02 14:37:26.903  INFO 63279 --- [cutor-thread-12] com.example.demo2.Demo1Application       : No active profile set, falling back to default profiles: default
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9080/
2020-09-02 14:37:28.575  INFO 63279 --- [cutor-thread-36] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1623 ms
2020-09-02 14:37:28.992  INFO 63279 --- [cutor-thread-12] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-09-02 14:37:29.253  INFO 63279 --- [cutor-thread-12] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-09-02 14:37:29.325  INFO 63279 --- [cutor-thread-12] com.example.demo2.Demo1Application       : Started Demo1Application in 7.92 seconds (JVM running for 25.216)
 THIS IS Spring Boot Applciation Message.
[AUDIT   ] CWWKZ0003I: The application thin-demo-1 updated in 8.246 seconds.

@ericglau
Copy link
Contributor Author

ericglau commented Sep 2, 2020

Cancelling. Replaced by this fix instead: #530

@ericglau ericglau closed this Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant