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
gretty 3.0.4 doesn't work in gradle 7.0.2 #229
Comments
I believe you've hit this. You have a multi-module project? |
@ataverasp - do you mind trying to use a snapshot version from JitPack? Let us know if it fixes your problem, |
yes, we have a multi-module project and we conditionally apply the plugin depending on the profile on some of the modules. @boris-petrov I tried the snapshot version and the error went away, I didn't check any of the tasks though, I didn't get that far. But the snapshot version is working fine. Just a note it doesn't work on gradle 6.8.2 anymore |
@ataverasp - thanks for trying out the snapshot. The fact that the snapshot doesn't work on Gradle 6 is unfortunate... but I'm not sure how we can fix this. @f4lco - the problem is that JitPack builds with the Gradle wrapper version that is in the repo. If we put Gradle 7 there, the built plugin will work only on Gradle 7 as was mentioned here. But if we put Gradle 6 as a wrapper, then the CI fails because Gradle 7 tests can't be run via the Gradle 6 wrapper... any ideas? |
@boris-petrov yes, Gradle 6 can't run on Java 16, that is the root cause. I'll open a PR so we can discuss more. |
sigh, i can't get this to work with any version of gradle 7. I tried using jitpack, but actually running is failing with:
my module's
|
@madorb - did you try following these steps or perhaps this? It should work I guess. Perhaps @ataverasp can say what you've done wrong? |
When I tried from Jitpack, I was checking for errors on building the project. After checking running the appRunTask I do get the same errors as @madorb. Tried with several different versions tomcat and jetty version all error out with: Execution failed for task ':web-app:appRun'.
I did not try @boris-petrov suggestions yet, will try to post an update later in the week |
@madorb @ataverasp please see https://github.com/f4lco/gretty-jitpack for build instructions with JitPack and Gradle 6 or 7. It's my minimal reproducer project for build problems. |
after forcing the deps resolutions suggested by @f4lco, gradle was able to resolve the dependencies needed for appRun and the app came up fine; that being said, I believe that this change will resolve the issue in a multi module project. I had to add: settings.gradle pluginManagement {
plugins {
id 'org.gretty' version "gretty-3.x-SNAPSHOT" apply false
}
resolutionStrategy {
eachPlugin {
if (requested.id.toString() == "org.gretty") {
useModule("com.github.gretty-gradle-plugin.gretty:gretty:gretty-3.x-SNAPSHOT")
}
}
}
maven {
url "https://jitpack.io"
metadataSources {
artifact()
mavenPom()
}
} build.gradle buildscript {
dependencies {
classpath 'com.github.gretty-gradle-plugin:gretty:gretty-3.x-SNAPSHOT'
}
}
configurations {
all {
resolutionStrategy {
dependencySubstitution.all { dependency
->
// see https://docs.gradle.org/current/userguide/resolution_rules.html#sub:conditional_dependency_substitution
if (dependency.requested instanceof ModuleComponentSelector && dependency.
requested.
group == "org.gretty") {
dependency.
useTarget "com.github.gretty-gradle-plugin.gretty:${dependency.requested.module}:8dbea32"
}
}
}
}
}
nothing was changed on the build.gradle for the webApp module, we just need to call: |
@f4lco @boris-petrov is this good enough to publish a new version of gretty? |
@ataverasp - yes, it is, we're working on releasing a new version. |
@ataverasp, @f4lco, @ghid, @madorb - 3.0.5 is out! And on Maven Central! So please try it out and post any new issues you find. :) |
It worked. Thank you! |
Getting an afterEvaluate warning with 6.8.2 and error when running 7.0.2, below is the stack trace:
The text was updated successfully, but these errors were encountered: