Run the flyway migrate task with gradle in debug mode - gradle

I would like to get the same debug output for the flyway migrate command executed via gradle
gradle flywayMigrate, that I get when running the flyway cli version:
flyway -X migrate.
Running the gradle command in debug mode, i.e. gradle -d flywayMigrate, does produce debug messages, but not the debug messages from the flyway plugin that I would expect (as with flyway cli). Thanks for the support!

Related

How to skip test task when running sonarqube task?

When I execute sonarqube task, by default test task runs. How can I configure Gradle to not run tests when I specifically run sonarqube.
I want to configure this build.gradle.kts.
When I run
./gradlew sonarqube -x test
then tests are not executed.
I want to achieve the same by configuring in the build.gradle.kts file.

Revert last migration using flyway

flyway has a task called ['Undo']1 that's supposed to revert last migration.
But the flyway jar (flyway-core-4.2.0 sources.jar!\org\flywaydb\core\Flyway.java)doesn't have that method so when I run gradlew flywayUndo , I get following error . But when I run gradlew flywayInfo it works fine as the info method exists in the jar. How to undo last mighration using flyway gradle jar ?
Task 'flywayUndo' not found in project ':applications/XXXXXX'. Some candidates are: 'flywayInfo'.
flywayUndo task is only available in paid versions of Flyway. You can see this here. Undo is available only for pro and enterprise versions of framework.

How to debug my Grails application in IntelliJ?

I am using this specific command to run my Grails application clean bootRun -Dgrails.env=test.
I would like run my application (with the same configuration) in debug mode from IntelliJ.
What Run/Debug configurations should be used to run the app in debug mode with the same options as in the command above?

Create database in flyway with Gradle

I'm very new to Gradle. I have a command ./gradlew clean build generateLocalProperties loadProperties flywayMigrate and after it's executed, database was created from flyway.
I have another gradle command to execute cucumber tests.
It is ./gradlew cAAT, I want to create database from ./gradlew cAAT command without executing a separate Gradle command.
For that, I updated below Gradle task copyAndDeployJobs.
task copyAndDeployJobs {
dependsOn loadProperties, copyConfigsToTalend, setupLocalJobDirectory, copyJobsToTalend, deployTalendJobs, **generateLocalProperties, loadProperties, flywayMigrate**
}
And I have added bolded part (generateLocalProperties, loadProperties, flywayMigrate) newly to the method. Now ./gradlew cAAT is being executed successfully, but still, there is no database created after that.
Could you please someone help me to sort out this issue?
Thanks,

Does gradle continuous build support SpringBoot?

When I try to run build with gradle with the -t flag:
./gradlew clean build -x test -t
I get prompt line:
Waiting for changes to input files of tasks... (ctrl-d to exit)
but when I try it with bootRun command it doesn't work/appear:
./gradlew clean bootRun -t
Does it work with Spring Boot? (I know about Spring dev tools plugin - 1.3 is not released yet)
andy-wilkinson is correct in his answer : gradle bootRun never completes because some applications run indefinitely. Its well documented in this issue in the grails project.
I've found a way to force bootRun to live reload the application from the command line. The key items here are the gradle daemon and the spring-boot-devtools package.
To get it to live reload you need to have 2 terminals open.
gradle build --continuous
build --continuous will keep satisfying the initial build request until stopped
gradle build --continuous --quiet & 2>1 >/dev/null runs in the background, but you would miss the important build warnings/errors. gradle --stop to stop watching.
gradle bootRun
Bootrun starts with spring-boot-devtools on classpath, which will detect changes and restart application.
It depends on the nature of your Spring Boot application. If you app typically runs and then exits then continuous build will work. However if your app typically stays alive indefinitely, for example because it's a web app that handles HTTP requests, then it won't work. In the latter case the bootRun task never completes so Gradle doesn't know that it's time to start watching for changes.

Resources