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

Grails 7: Gradle 8.7+: JCenter retirement breaks webdriver-binaries-gradle-plugin and/or grolifant #443

Open
jamesfredley opened this issue Oct 18, 2024 · 4 comments
Assignees

Comments

@jamesfredley
Copy link
Contributor

jamesfredley commented Oct 18, 2024

The work around is to adjust gradle/wrapper/gradle-wrapper.properties to version 8.6.

https://blog.gradle.org/portal-jcenter-impact

This does not appear to occur if you have locally cached versions before the JCenter retirement. github actions caches dependencies also, so they are OK for now.

But on a new environment or if you delete .m2 and .gradle caches you will see this issue.

Current guess is that artifacts on maven central are different than the ones that were on JCenter. Micronaut ran into a similar issue, but they used an older version of web driver and the required jars for that exist on https://repo.grails.org/ui/native/core/org/ysb33r/gradle/grolifant/

Execution failed for task ':examples-grails3-hibernate5:configureChromeDriverBinary'.
> org/gradle/wrapper/ExclusiveFileAccessManager

Caused by: java.lang.NoClassDefFoundError: org/gradle/wrapper/ExclusiveFileAccessManager
	at org.ysb33r.grolifant.api.core.ExclusiveFileAccess.$getStaticMetaClass(ExclusiveFileAccess.groovy)
	at org.ysb33r.grolifant.api.core.ExclusiveFileAccess.<init>(ExclusiveFileAccess.groovy)
	at org.ysb33r.grolifant.api.v4.downloader.ArtifactDownloader.<init>(ArtifactDownloader.groovy:166)
	at org.ysb33r.grolifant.api.v4.downloader.AbstractDistributionInstaller.getDistFromCache(AbstractDistributionInstaller.groovy:184)
	at org.ysb33r.grolifant.api.v4.downloader.AbstractDistributionInstaller.resolveDistributionLocationForVersion(AbstractDistributionInstaller.groovy:154)
	at org.ysb33r.grolifant.api.v4.downloader.AbstractDistributionInstaller$1.call(AbstractDistributionInstaller.groovy:107)
	at org.ysb33r.grolifant.api.v4.downloader.AbstractDistributionInstaller$1.call(AbstractDistributionInstaller.groovy)
	at org.gradle.api.internal.provider.DefaultProvider.calculateOwnValue(DefaultProvider.java:72)
	at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateOwnPresentValue(AbstractMinimalProvider.java:80)
	at org.gradle.api.internal.provider.AbstractMinimalProvider.get(AbstractMinimalProvider.java:100)
	at org.gradle.api.provider.Provider$get$0.call(Unknown Source)

The work around is to use Gradle 8.6, before they moved org/gradle/wrapper/ExclusiveFileAccessManager to https://github.com/gradle/gradle/blob/master/platforms/core-runtime/files/src/main/java/org/gradle/internal/file/locking/ExclusiveFileAccessManager.java

Related issues:

erdi/webdriver-binaries-gradle-plugin#43
micronaut-projects/micronaut-core#10988
micronaut-projects/micronaut-core#10990 - micronaut was using an older version of the web driver plugin and the required jars for that exist on https://repo.grails.org/ui/native/core/org/ysb33r/gradle/grolifant/

micronaut was using an older version with different id than grails:
https://plugins.gradle.org/search?term=webdriver-binaries

\--- com.github.erdi:webdriver-binaries-gradle-plugin:3.2
     +--- org.ysb33r.gradle:grolifant50:2.0.2
     |    +--- org.tukaani:xz:1.6
     |    +--- org.ysb33r.gradle:grolifant40:2.0.2
     |    |    +--- org.tukaani:xz:1.6
     |    |    +--- org.apache.commons:commons-collections4:4.4
     |    |    +--- org.ysb33r.gradle:grolifant-core:2.0.2
     |    |    |    +--- org.tukaani:xz:1.6
     |    |    |    +--- org.apache.commons:commons-collections4:4.4
     |    |    |    \--- org.ysb33r.gradle:grolifant-rawhide:2.0.2
     |    |    |         \--- org.tukaani:xz:1.6
     |    |    \--- org.ysb33r.gradle:grolifant-rawhide:2.0.2 (*)
     |    +--- org.ysb33r.gradle:grolifant-core:2.0.2 (*)
     |    \--- org.ysb33r.gradle:grolifant40-legacy-api:2.0.2
     |         +--- org.tukaani:xz:1.6
     |         +--- org.apache.commons:commons-collections4:4.4
     |         +--- org.ysb33r.gradle:grolifant-core:2.0.2 (*)
     |         \--- org.ysb33r.gradle:grolifant40:2.0.2 (*)
     \--- org.apache.maven:maven-artifact:3.8.7
          +--- org.codehaus.plexus:plexus-utils:3.3.1
          \--- org.apache.commons:commons-lang3:3.8.1
@jamesfredley
Copy link
Contributor Author

We need a new version of com.github.erdi:webdriver-binaries-gradle-plugin that uses a version of grolifant with this change

https://gitlab.com/ysb33rOrg/grolifant/-/blob/master/grolifant-core/src/main/groovy/org/ysb33r/grolifant/api/core/ExclusiveFileAccess.groovy?blame=1#L79

that does not call OperatingSystem.getExecutableName() which was removed in grolifant:3.0.1
https://ysb33rorg.gitlab.io/grolifant/3.0.1/docs/changelog.html

@codeconsole
Copy link
Contributor

codeconsole commented Oct 18, 2024

   /** Returns OS-specific decorated exe name.
     *
     * @param executablePath Name of exe
     * @return Returns an appropriately decorated exe
     * @deprecated Use{ @link #getExecutableNames(String) } instead
     */
    @Deprecated
    abstract String getExecutableName(String executablePath)

https://gitlab.com/ysb33rOrg/grolifant/-/merge_requests/130/diffs#2402bbf8216852c2f0c3e23d000b0f505d742441

https://gitlab.com/ysb33rOrg/grolifant/-/blob/RELEASE_3_0_1/grolifant-core/src/main/groovy/org/ysb33r/grolifant/api/core/OperatingSystem.groovy?ref_type=tags#L198-203

    /** Returns list of possible OS-specific decorated exe names.
     *
     * @param executablePath Name of exe
     * @return Returns a list of possible appropriately decorated exes
     */
    abstract List<String> getExecutableNames(String executablePath)

https://gitlab.com/ysb33rOrg/grolifant/-/blob/RELEASE_3_0_1/grolifant-core/src/main/groovy/org/ysb33r/grolifant/api/core/OperatingSystem.groovy?ref_type=tags#L142-163

    /** Locates the given exe in the system path.
     * @param name Name of exe to search for.
     * @return Executable location of {@code null} if not found.
     */
    File findInPath(String name) {
        for (String exeName : getExecutableNames(name)) {
            if (exeName.contains(pathSeparator)) {
                File candidate = new File(exeName)
                if (candidate.file) {
                    return candidate
                }
            } else {
                for (File dir : (path)) {
                    File candidate = new File(dir, exeName)
                    if (candidate.file) {
                        return candidate
                    }
                }
            }
        }
        null
    }

How it was used by the various operating system implementations:

https://gitlab.com/search?search=getExecutableName&nav_source=navbar&project_id=3777693&group_id=1800845&search_code=true&repository_ref=cd01e88c58aaf98819fa67611eb2eea6c6af5695

@matrei
Copy link
Contributor

matrei commented Oct 19, 2024

@jamesfredley
Copy link
Contributor Author

jamesfredley commented Oct 22, 2024

PR submitted to erdi/webdriver-binaries-gradle-plugin#44

@jamesfredley jamesfredley moved this to Todo in Grails 7 Oct 22, 2024
@jamesfredley jamesfredley moved this from Todo to In Progress in Grails 7 Oct 22, 2024
@jamesfredley jamesfredley changed the title JCenter retirement breaks webdriver-binaries-gradle-plugin and/or grolifant Grails 7: Gradle 8.7+: JCenter retirement breaks webdriver-binaries-gradle-plugin and/or grolifant Oct 22, 2024
@jamesfredley jamesfredley self-assigned this Oct 22, 2024
jamesfredley added a commit to jamesfredley/grails-website-test that referenced this issue Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

3 participants