Repository: quarkusio/quarkus
Issue: Gradle quarkusIntTest and testNative tasks should not depend on check

### Describe the bug

The `quarkusIntTest` and `testNative` gradle tasks add a dependency on `check`. I believe this dependency is backwards - `check` should instead depend on the `Test` tasks.

This causes a circular dependency issue with our build because we run a `jacocoCoverageVerification` task after all test tasks and `jacocoCoverageVerification` is set as a dependency of `check`.

Relevant gradle configuration snippet
```
tasks.register('jacocoCoverageVerification') {
  ...
}
check.dependsOn(jacocoCoverageVerification)
tasks.withType(Test) { task ->
  jacocoCoverageVerification.dependsOn(task)
}
```

Error output
```
Circular dependency between the following tasks:
:check
\\--- :jacocoCoverageVerification
     +--- :quarkusIntTest
     |    \\--- :check (*)
     \\--- :testNative
          \\--- :check (*)
```


### Expected behavior

`check` should depend on the registered `Test` tasks

### Actual behavior

`Test` tasks depend on `check`

### How to Reproduce?

_No response_

### Output of `uname -a` or `ver`

Darwin Kernel Version 21.3.0

### Output of `java -version`

openjdk version "11.0.11"

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.8.0.CR1

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

Gradle 7.4.2

### Additional information

_No response_

Changed files:
devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java
integration-tests/gradle/src/test/java/io/quarkus/gradle/IntegrationTestBuildTest.java

diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java
index cef5d097ac7..c3d56ef8604 100644
--- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java
+++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java
@@ -20,7 +20,6 @@
 import org.gradle.api.artifacts.ConfigurationContainer;
 import org.gradle.api.artifacts.ProjectDependency;
 import org.gradle.api.plugins.BasePlugin;
-import org.gradle.api.plugins.JavaBasePlugin;
 import org.gradle.api.plugins.JavaPlugin;
 import org.gradle.api.plugins.JavaPluginConvention;
 import org.gradle.api.tasks.SourceSet;
@@ -263,7 +262,7 @@ public void execute(Task test) {
                     tasks.register(INTEGRATION_TEST_TASK_NAME, Test.class, intTestTask -> {
                         intTestTask.setGroup("verification");
                         intTestTask.setDescription("Runs Quarkus integration tests");
-                        intTestTask.dependsOn(quarkusBuild, tasks.named(JavaBasePlugin.CHECK_TASK_NAME));
+                        intTestTask.dependsOn(quarkusBuild, tasks.named(JavaPlugin.TEST_TASK_NAME));
                         intTestTask.setClasspath(intTestSourceSet.getRuntimeClasspath());
                         intTestTask.setTestClassesDirs(intTestSourceSet.getOutput().getClassesDirs());
                     });
@@ -283,7 +282,7 @@ public void execute(Task test) {
                     tasks.register(TEST_NATIVE_TASK_NAME, Test.class, testNative -> {
                         testNative.setDescription("Runs native image tests");
                         testNative.setGroup("verification");
-                        testNative.dependsOn(quarkusBuild, tasks.named(JavaBasePlugin.CHECK_TASK_NAME));
+                        testNative.dependsOn(quarkusBuild, tasks.named(JavaPlugin.TEST_TASK_NAME));
 
                         testNative.setTestClassesDirs(project.files(nativeTestSourceSet.getOutput().getClassesDirs(),
                                 intTestSourceSet.getOutput().getClassesDirs()));
diff --git a/integration-tests/gradle/src/test/java/io/quarkus/gradle/IntegrationTestBuildTest.java b/integration-tests/gradle/src/test/java/io/quarkus/gradle/IntegrationTestBuildTest.java
index c1745dba95a..1145c1a07f1 100644
--- a/integration-tests/gradle/src/test/java/io/quarkus/gradle/IntegrationTestBuildTest.java
+++ b/integration-tests/gradle/src/test/java/io/quarkus/gradle/IntegrationTestBuildTest.java
@@ -15,7 +15,6 @@ public void shouldRunIntegrationTestAsPartOfBuild() throws Exception {
         BuildResult buildResult = runGradleWrapper(projectDir, "clean", "quarkusIntTest");
 
         assertThat(buildResult.getTasks().get(":test")).isEqualTo(BuildResult.SUCCESS_OUTCOME);
-        assertThat(buildResult.getTasks().get(":check")).isEqualTo(BuildResult.SUCCESS_OUTCOME);
         assertThat(buildResult.getTasks().get(":quarkusIntTest")).isEqualTo(BuildResult.SUCCESS_OUTCOME);
     }