-
Notifications
You must be signed in to change notification settings - Fork 36
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
unexpected arguments in main #65
Comments
I have related problems in combination with the cli library "picocli" and java modules. The problem are the standard start script generators templates of gradle see "unixStartScript" and "windowsStartScript". At the very end of the templates there is the substitution of the variables. If you use the classpath the cmd should be something like this |
Thanks for explaining the cause @mirko-lelansky, that will be helpful for fixing this issue. |
The current version (1.5.0) still appears to be affected. I'm facing the same issue, also using Picocli. |
Does anyone know if there is any way to work around this issue until it's fixed? |
This issue has been reported in the Gradle forums: EDIT: also confirmed still an issue as of version |
This should be fixed in the 1.6.0 release that went out on September 2nd. Please re-open if there are still issues. |
There are many things at work here - I'll try to get them in some order. Reports
Tests introduced by SerbanTests introduced in #105 by @siordache cover startscripts only, i.e. they cover gradle-modules-plugin/src/test/java/org/javamodularity/moduleplugin/ModulePluginSmokeTest.java Lines 145 to 164 in 49b9db8
There are no similar tests for direct gradle-modules-plugin/src/test/java/org/javamodularity/moduleplugin/ModulePluginSmokeTest.java Lines 37 to 52 in 49b9db8
nor for gradle-modules-plugin/src/test/java/org/javamodularity/moduleplugin/ModulePluginSmokeTest.java Lines 130 to 143 in 49b9db8
What we can doWe could start by extending Serban's tests to all those run tasks (both unmodular I think Finally, I think only when we understand the problem fully, we can start thinking about potential solutions. Related issues
|
See my edit in the comment above, the issue is still present as of
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 Since these flags will also come after the tasks.named<JavaExec>("run") {
inputs.property("moduleName", moduleName)
val jvmArgsList = mutableListOf(
"--module-path", getClasspath().getAsPath(),
"--module", "$moduleName/$mainClassName"
)
// FIXME: dirty workaround for --debug-jvm being broken. run with:
// ./gradlew -PdebugWorkaround run
if(project.hasProperty("debugWorkaround")){
jvmArgsList.add(0, "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
}
doFirst {
jvmArgs(jvmArgsList)
setClasspath(files())
}
} Not sure how the plugin could do something similar, but I hope this helps. |
…le 6.6, making v1.7.0 fail
Hello,
plugin version - "1.4.0",
git - "gradle-modules-plugin-example",
project - "greater.runner'.
If we add to Runner.main(String[] args)
for (String arg: args) {
System.out.println(arg);
}
and run application, than we will find in output:
-Dfile.encoding=UTF-8
-Duser.country=US
-Duser.language=en
-Duser.variant
greeter.runner/examples.Runner
Hello and welcome!
It seems these arguments should not be.
The text was updated successfully, but these errors were encountered: