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

Issues with 5.0.0 wrapper #22

Open
codeconsole opened this issue Sep 16, 2024 · 11 comments
Open

Issues with 5.0.0 wrapper #22

codeconsole opened this issue Sep 16, 2024 · 11 comments
Assignees

Comments

@codeconsole
Copy link

codeconsole commented Sep 16, 2024

Using https://github.com/grails/grails-wrapper/releases/tag/v5.0.0

Issues with Line Separator

% ./grailsw
env: bash\r: No such file or directory

this happens because the Line Separator used is different from the one in sdkman

It uses CRLF and should just be LF

Issues Resolving Test Dependencies

if I take grailsw from sdkman 5.3.6

% ./grailsw
| Resolving Dependencies. Please wait...

CONFIGURE SUCCESSFUL in 945ms
| Error Could not resolve all artifacts for configuration ':testRuntimeClasspath'. Type 'gradle dependencies' for more information

if I comment out all the test dependencies it works.

stop-app doesn't appear to work

grails> stop-app
2024-09-15T23:02:08.687-04:00  WARN 40822 --- [nio-8081-exec-2] o.s.web.servlet.PageNotFound             : No mapping for POST /actuator/shutdown
2024-09-15T23:02:08.688-04:00  WARN 40822 --- [nio-8081-exec-2] o.s.web.servlet.PageNotFound             : No endpoint POST /actuator/shutdown.
| Error Application not running. (Use --stacktrace to see the full trace)
@codeconsole
Copy link
Author

codeconsole commented Sep 16, 2024

Adding the following to application.yml resolves stop-app but results in new unwanted behavior is Java 21

grails> stop-app
2024-09-15T23:08:38.955-04:00  INFO 41394 --- [      Thread-12] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2024-09-15T23:08:38.956-04:00  INFO 41394 --- [      Thread-12] o.a.c.c.C.[Tomcat].[localhost].[/]       : Destroying Spring FrameworkServlet 'dispatcherServletRegistration'
<=======<===========--> 85% EXECUTING [9s]
> :bootRun
grails> Error opening zip file or JAR manifest missing: ~/.sdkman/candidates/java/21.0.4-graal/lib/management-agent.jar

FAILURE: Build failed with an exception.
 % java -version
java version "21.0.4" 2024-07-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.4+8.1 (build 21.0.4+8-LTS-jvmci-23.1-b41)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.4+8.1 (build 21.0.4+8-LTS-jvmci-23.1-b41, mixed mode, sharing)

I don't think management-agent.jar has existed since Java 8. I think this is related to a bug with stop-app because if I run quit instead of stop-app it seems to shutdown using the same mechanism (the actuator), but shuts down fine.

==========--> 85% EXECUTING [12s]
grails> quit
| Application shutdown.

@jamesfredley
Copy link
Contributor

@codeconsole Please verify that grailsw now has the correct line endings on https://github.com/grails/grails-wrapper/releases/tag/v5.0.0

@codeconsole
Copy link
Author

@jamesfredley the wrapper now works and has the correct line endings. What caused it to be generated the previous way that did not work?

@jamesfredley
Copy link
Contributor

jamesfredley commented Sep 16, 2024

It was copied from a Windows machine and my guess is that the line endings were changes during git clone. Those files have not changed since 2017: https://github.com/grails/grails-wrapper/tree/5.0.x/shell

@jamesfredley
Copy link
Contributor

@codeconsole Did you have mavenCentral() in repositories{} and profile ("org.grails.profiles:web") in dependencies{} when the error occurred? If you run gradle assemble do you get the same error?

Error Could not resolve all artifacts for configuration ':testRuntimeClasspath'. Type 'gradle dependencies' for more information

@codeconsole
Copy link
Author

@jamesfredley yes. I have those things. if I run gradle assemble, I get

Execution failed for task ':distTar'.
> Entry website-0.1/lib/jaxb-core-4.0.5.jar is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/8.10.1/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.

I figured out which test dependency is causing the failure. It is just one that causes the failure:

testImplementation("org.grails.plugins:geb")

@codeconsole
Copy link
Author

Looks like the stop-app issue has already been reported

grails-profiles/base#31

@jamesfredley
Copy link
Contributor

@codeconsole the Error Could not resolve all artifacts for configuration ':testRuntimeClasspath'. Type 'gradle dependencies' for more information issue can be resolved with the following. grails-wrapper can only load on a project that will assemble. I suspect you will also have to do this for distZip, at a minimum.

    distTar {
        duplicatesStrategy = DuplicatesStrategy.INCLUDE
    }

Bigger picture, if that issue is going to occur on all projects, then it should be addressed globally. Possibly in:

https://github.com/grails/grails-core/blob/7.0.x/gradle/assemble.gradle#L85-L89

For stop-app, how do you want to approach it and do you want to take a swing at it? Having it call quit looks like a potentially quick path, although it would exit grailsw, if it is running in interactive mode.

@jamesfredley
Copy link
Contributor

grails/grails-core#13648 - a WIP for duplicatesStrategy at a higher level

@codeconsole
Copy link
Author

@jamesfredley how is testImplementation("org.grails.plugins:geb") causing this in the first place? and how would adding a duplicatesStrategy do a distribution affect/fix something specific to the test environment?

@jamesfredley
Copy link
Contributor

I do not know why, but with Gradle 8 this is occurring more often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants