Any example of gradle task to startApp(spring boot app) in provider is helpfull

1,489 views
Skip to first unread message

Neeraja Potluri

unread,
Sep 14, 2016, 8:16:09 PM9/14/16
to Pact
per the example shown in pact-jvm-provider, 
// This will be called before the provider task
task('startTheApp') << {
  // start up your provider here
}

// This will be called after the provider task
task('killTheApp') << {
  // kill your provider here
}
An issue I am facing is with gradle task startApp using bootRun{} it starts the app and waits/hangs and doesn't come to pactVerify task execution.
Any help how to start spring boot app in gradle task before pactVerify and stop after is appreciated.

Thanks in advance

Ronald Holshausen

unread,
Sep 14, 2016, 9:25:20 PM9/14/16
to Neeraja Potluri, Pact
Unfortunatly, the bootRun task extends the standard Gradle JavaExec task, which is not able to run in the background. However, there are a number of ways to get it to work:

1. Use docker (if you can). The docker gradle tasks can start docker containers in the background.



--
You received this message because you are subscribed to the Google Groups "Pact" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pact-support...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Ronald Holshausen

DiUS Computing Pty Ltd

Level 10, 99 Queens Street
Melbourne, VIC 3000

Phone: +61 3 9008 5400
Mobile: +61 413 162 439

http://www.diuscomputing.com.au

Neeraja Potluri

unread,
Sep 16, 2016, 6:07:16 PM9/16/16
to Pact, neeraja...@gmail.com
 Yes, Thank you very much for the response. 
I could resolve it using plugin at  https://github.com/johnrengelman/gradle-processes.
I came to know about this https://plugins.gradle.org/plugin/com.github.kuldeepg.springbootutility from here. Will compare and give it a try if needed.

Thank you
Reply all
Reply to author
Forward
0 new messages