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

Allow usage of Quarkus Gradle Plugin as a custom plugin dependency #12509

Closed
38leinaD opened this issue Oct 5, 2020 · 1 comment · Fixed by #12510
Closed

Allow usage of Quarkus Gradle Plugin as a custom plugin dependency #12509

38leinaD opened this issue Oct 5, 2020 · 1 comment · Fixed by #12510
Labels
area/gradle Gradle kind/enhancement New feature or request
Milestone

Comments

@38leinaD
Copy link
Contributor

38leinaD commented Oct 5, 2020

Description
It would be nice to hide some default configuration for our used quarkus version/dependecies/etc behind our own custom Gradle plugin. This is useful, because we have multiple quarkus apps managed by our team that are developed and released together; as such, we would like to be able to define the used quarkus version and some settings in a central place; i.e. a gradle plugin and not having to define the quarkus gradle plugin dependency in each project individually.

This custom gradle plugin should dependent on the quarkus gradle plugin in it's build-script to pull it in transitively:

implementation 'io.quarkus:io.quarkus.gradle.plugin:1.8.1.Final'

Our custom gradle plugin will now apply the quarkus gradle plugin:

  @Override
    public void apply(Project project) {
		project.apply plugin: 'io.quarkus'
                // add some default dependencies, etc....
    }

There should be NO direct dependency in the settings.gradle of the quarkus project like this (all should be hidden by our custom gradle plugin if possible):

pluginManagement {
    plugins {
      id 'io.quarkus' version "1.8.1.Final"
    }
}

Unfortunately, when applying this plugin and pulling it in just as a transitive dependency, the quarkusDev plugin will fail because it searches for the quarkus gradle plugin dependency just in the direct dependencies.
(https://github.com/quarkusio/quarkus/blob/master/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java#L489)

        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.lang.IllegalStateException: Unable to find quarkus-gradle-plugin dependency in project ':quarkus-minimal-assembly'
        at io.quarkus.gradle.tasks.QuarkusDev.addGradlePluginDeps(QuarkusDev.java:529)
        at io.quarkus.gradle.tasks.QuarkusDev.startDev(QuarkusDev.java:314)
        ... 92 more

Implementation ideas
For such use-cases, it would be good if the quarkus gradle plugin is also search in the transitive dependencies; which might be the case if it is just pulled in by some other plugin.

@38leinaD 38leinaD added the kind/enhancement New feature or request label Oct 5, 2020
@quarkusbot quarkusbot added the area/gradle Gradle label Oct 5, 2020
@quarkusbot
Copy link

/cc @quarkusio/devtools, @glefloch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants