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

Fix broken distribution #13740

Merged
merged 7 commits into from
Oct 16, 2024
Merged

Fix broken distribution #13740

merged 7 commits into from
Oct 16, 2024

Conversation

matrei
Copy link
Contributor

@matrei matrei commented Oct 11, 2024

No description provided.

@matrei matrei marked this pull request as draft October 11, 2024 10:14
@matrei
Copy link
Contributor Author

matrei commented Oct 13, 2024

In Grails 6 (and earlier), which used the legacy org.gradle.api.tasks.Upload type for the installToHomeDist task, file hashes were calculated and saved together with the jars. Now that the Upload task is removed in Gradle 8, we use org.gradle.api.tasks.Copy instead. Copy does not generate these hash files automatically.

Do we want to continue generating these *.sha1, *.sha256 and *.sha512 files for the jar files in the dist folder?
Or was this just a side-effect of using the Upload task?

@matrei matrei marked this pull request as ready for review October 13, 2024 15:30
@jamesfredley
Copy link
Contributor

@jamesfredley
Copy link
Contributor

jamesfredley commented Oct 14, 2024

The distribution builds great. When run, I am seeing

Exception: java.lang.NoSuchMethodError thrown from the UncaughtExceptionHandler in thread "main"

digging down further:

> Task :grails-shell:org.grails.cli.GrailsCli.main() FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
10 actionable tasks: 1 executed, 1 from cache, 8 up-to-date
org.grails.cli.compiler.grape.DependencyResolutionFailedException: org.grails.cli.compiler.grape.DependencyResolutionFailedException: org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.grails:grails-bom:pom: (absent): Could not find artifact org.grails:grails-bom:pom: in grailsCentral (https://repo.grails.org/grails/core)
	at org.grails.cli.compiler.grape.MavenResolverGrapeEngine.resolve(MavenResolverGrapeEngine.java:284)
	at org.grails.cli.compiler.grape.MavenResolverGrapeEngine.resolve(MavenResolverGrapeEngine.java:268)
	at org.grails.cli.boot.GrailsDependencyVersions.<init>(GrailsDependencyVersions.groovy:55)
	at org.grails.cli.boot.GrailsDependencyVersions.<init>(GrailsDependencyVersions.groovy:51)
	at org.grails.cli.profile.repository.MavenProfileRepository.<init>(MavenProfileRepository.groovy:54)
	at org.grails.cli.GrailsCli.createMavenProfileRepository(GrailsCli.groovy:347)
	at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:243)
	at org.grails.cli.GrailsCli.main(GrailsCli.groovy:161)
Caused by: org.grails.cli.compiler.grape.DependencyResolutionFailedException: org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.grails:grails-bom:pom: (absent): Could not find artifact org.grails:grails-bom:pom: in grailsCentral (https://repo.grails.org/grails/core)
	at org.grails.cli.compiler.grape.MavenResolverGrapeEngine.resolve(MavenResolverGrapeEngine.java:297)
	at org.grails.cli.compiler.grape.MavenResolverGrapeEngine.resolve(MavenResolverGrapeEngine.java:276)
	... 7 more
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.grails:grails-bom:pom: (absent): Could not find artifact org.grails:grails-bom:pom: in grailsCentral (https://repo.grails.org/grails/core)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:365)
	at org.grails.cli.compiler.grape.MavenResolverGrapeEngine.resolve(MavenResolverGrapeEngine.java:292)
	... 8 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: org.grails:grails-bom:pom: (absent): Could not find artifact org.grails:grails-bom:pom: in grailsCentral (https://repo.grails.org/grails/core)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:473)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:261)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:353)
	... 9 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.grails:grails-bom:pom: in grailsCentral (https://repo.grails.org/grails/core)
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:42)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:417)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:260)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:537)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:449)
	... 11 more

Exception: java.lang.NoSuchMethodError thrown from the UncaughtExceptionHandler in thread "main"

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':grails-shell:org.grails.cli.GrailsCli.main()'.

it is this line:

this(grape, [group: "org.grails", module: "grails-bom", version: GrailsDependencyVersions.package.implementationVersion, type: "pom"])

The POM files are published on https://repo.grails.org/ui/repos/tree/PomView/libs-snapshots-local/org/grails/grails-bom/7.0.0-SNAPSHOT/grails-bom-7.0.0-20241014.150731-91.pom

This is also causing these 2 test failures:

https://github.com/search?q=repo%3Agrails%2Fgrails-core%20bom%3Apom&type=code

@matrei
Copy link
Contributor Author

matrei commented Oct 14, 2024

@jamesfredley That's interesting, I manage to run the distribution built on this branch:

mattias@mattias-xps:/mnt/c/Users/matti/Projects/github/grails-core/build/distributions$ ./grails-7.0.0-SNAPSHOT/bin/grails -version
| Grails Version: 7.0.0-SNAPSHOT
| JVM Version: 17.0.12
mattias@mattias-xps:/mnt/c/Users/matti/Projects/github/grails-core/build/distributions$ ./grails-7.0.0-SNAPSHOT/bin/grails
| Starting interactive mode...
| Enter a command name to run. Use TAB for completion:
grails>

@jamesfredley
Copy link
Contributor

I am still digging into the cause here.

GrailsDependencyVersions.package.implementationVersion being null, was causing "Could not find artifact org.grails:grails-bom:pom", at least on Windows 11.

openjdk version "17.0.12" 2024-07-16 LTS
OpenJDK Runtime Environment Corretto-17.0.12.7.1 (build 17.0.12+7-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.12.7.1 (build 17.0.12+7-LTS, mixed mode, sharing)

@matrei
Copy link
Contributor Author

matrei commented Oct 15, 2024

@jamesfredley Does building and running a distribution from the 6.2.x branch work on Windows 11?

@matrei
Copy link
Contributor Author

matrei commented Oct 15, 2024

I tested 6.2.x. It runs fine on Windows 11. With 7.0.x I also get:
Exception: java.lang.NoSuchMethodError thrown from the UncaughtExceptionHandler in thread "main"

# Conflicts:
#	gradle.properties
Copy link
Contributor

@jamesfredley jamesfredley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matrei do you want to move Exception: java.lang.NoSuchMethodError thrown from the UncaughtExceptionHandler in thread "main" over to a new issue and merge this one? If so I approve.

@matrei matrei merged commit 76fd75a into 7.0.x Oct 16, 2024
11 checks passed
@matrei matrei deleted the matrei/fix-distribution branch October 16, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grails 7: Issue generating grails-x.x.x.zip distribution with ./gradlew assemble
4 participants