Closed jiri-muller closed 11 months ago
Same behavior for v5.1.6
Same issue here. Gradle 8.3; JAVA_HOME is openjdk-17 and I am targeting JAVA 1_8 Builds. The problem occurs on diffent projects of the same structure: root project with multiple submodules.
in the root projects build.gradle I have plugins block with
id 'com.jfrog.artifactory' version '5.1.6' apply false
in the subproject I then only use
id 'com.jfrog.artifactory
I get
An exception occurred applying plugin request [id: 'com.jfrog.artifactory']
> Failed to apply plugin class 'org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin'.
> Cannot run Project.afterEvaluate(Action) when the project is already evaluated.
Using version 5.1.2 right now because this seems to be the latest version working in my projects.
Hey @jiri-muller & @TheBatOutOfHell, Appreciate you letting us know about this problem. We tried, but couldn't replicate it so far. Could you please consider making a minimal reproducer for this issue?
@yahavi Thanks for your response. For my case I can reproduce it with small example:
app-root with module app...
no other stuff, no other plugins besides war-plugin. Even only including com.jfrog.artifactory version 1.5.6... no execution blocks artifactory... etc.
doing a gradle --refresh-dependencies for me already fails with given error.
Setting version to 5.1.2 build will be successful. Versions above will fail.
Thx for looking into it. kr Rob
We experience the same issues with version 5.1.3 ...
Gradle 8.1.1 JDK 11.0.20-zulu
For us it is crucial to have at least version 5.1.3 of the plugin, because only since this version, Gradle's configuration cache is working for our build.
When importing our project into Eclipse, the above mentioned error occurs. In IntelliJ or via Gradle directly, we do not have these kinds of problems. Now we had to introduce special handling for builds in Eclipse, that set the version to 5.1.2 .
With 5.1.2 it works properly in Eclipse, but configuration cache is not usable.
In my case (root project with modules) the problems occured no matter the platform... be it within Intellij or in console. However after some tests I now seem to have a working solution which allows me to use version 5.1.6. I simply changed the apply false in the root project build.gradle to apply true, so instead of
plugins {
id 'com.jfrog.artifactory' version '5.1.6' apply false
}
I use
plugins {
id 'com.jfrog.artifactory' version '5.1.6' apply true
}
Not fully what I want though as I do not want or need to apply the plugin in the root project (following: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl).
And just to make sure: apply false worked until version 5.1.2.
I was able to work around this by applying the plugin to the root project before applying it to any child projects. Note in my case I still use the older apply plugin
mechanism since the newer plugins { }
block is still lacking in some features I need.
// root build.gradle
apply plugin: 'com.jfrog.artifactory'
subprojects { subproject ->
apply plugin: 'com.jfrog.artifactory'
. . .
}
I have now switched to conventions plugin with buildSrc; integrating artifactory plugin in conventions file yields the same error again. And again working with 5.1.2.
However using 5.1.6 I "temporarily?" fixed it by explicitly loading the plugin in the root projects build.gradle:
plugins { id 'com.jfrog.artifactory' apply true }
@MarkRx @PatriceManser @TheBatOutOfHell @jiri-muller Thanks to @TheBatOutOfHell's reproducer, we were able to replicate this problem. We've gone ahead and set up a fix for it over at https://github.com/jfrog/artifactory-gradle-plugin/pull/70. We'll make sure to keep you updated on our progress.
@MarkRx @PatriceManser @TheBatOutOfHell @jiri-muller Gradle Artifactory plugin version 5.1.9 has been released. This update incorporates a fix for a particular issue. We would be grateful for any feedback you might have on it.
Hello @yahavi From my point of view it is working again now with version 5.1.9.
Thx!
Hi @yahavi, I can confirm 5.1.9 works for me. Thank you!
Describe the bug
After upgrade from
5.1.2
to5.1.5
(5.1.3
is also affected) following error is thrown:Current behavior
Reproduction steps
I am applying artifactory plugin via convention plugin:
However I was not able to reproduce this behavior similarly configured empty project. Other plugins used in project:
org.gradle.maven-publish
org.owasp.dependencycheck
com.diffplug.spotless
Same issue mentioned on SO https://stackoverflow.com/questions/77021002/jfrog-artifactory-stopped-working-in-android-studio-apply-plugin-com-jfrog-ar
Expected behavior
Project should build successfully like when 5.1.2 is used.
Artifactory Gradle plugin version
5.1.5
Operating system type and version
Linux Ubuntu 22.04.3 LTS
JFrog Artifactory version
No response
Gradle version
8.3 - Kotlin DSL