{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/7045","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/7045/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/7045/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/7045/events","html_url":"https://github.com/gradle/gradle/issues/7045","id":367368184,"node_id":"MDU6SXNzdWUzNjczNjgxODQ=","number":7045,"title":"Unable to add multiple `--add-opens` args to forked Groovy compiler","user":{"login":"bigdaz","id":179734,"node_id":"MDQ6VXNlcjE3OTczNA==","avatar_url":"https://avatars3.githubusercontent.com/u/179734?v=4","gravatar_id":"","url":"https://api.github.com/users/bigdaz","html_url":"https://github.com/bigdaz","followers_url":"https://api.github.com/users/bigdaz/followers","following_url":"https://api.github.com/users/bigdaz/following{/other_user}","gists_url":"https://api.github.com/users/bigdaz/gists{/gist_id}","starred_url":"https://api.github.com/users/bigdaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigdaz/subscriptions","organizations_url":"https://api.github.com/users/bigdaz/orgs","repos_url":"https://api.github.com/users/bigdaz/repos","events_url":"https://api.github.com/users/bigdaz/events{/privacy}","received_events_url":"https://api.github.com/users/bigdaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-05T21:04:41Z","updated_at":"2018-12-13T06:49:45Z","closed_at":null,"author_association":"MEMBER","body":"Because of the `Set`s used when [merging fork options](https://github.com/gradle/gradle/blob/3ccee91ec332e3ebde5a6342f03b9480f2581b2a/subprojects/language-jvm/src/main/java/org/gradle/api/internal/tasks/compile/daemon/AbstractDaemonCompiler.java#L66-L74), any duplicate jvm-args will be removed. This makes it impossible to supply multiple `--add-opens` parameters to the JVM.\r\nFor example:\r\n```\r\ncompileTestGroovy {\r\n    options.forkOptions.jvmArgs += ['--add-opens', 'java.base/java.lang=ALL-UNNAMED']\r\n    options.forkOptions.jvmArgs += ['--add-opens', 'java.base/java.lang.invoke=ALL-UNNAMED']\r\n}\r\n```\r\n\r\nResults in a command like like `java --add-opens java.base/java.lang=ALL-UNNAMED java.base/java.lang.invoke=ALL-UNNAMED ...` and a failure like https://e.grdev.net/s/ydiasku6wfnji/console-log."},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/446861076","html_url":"https://github.com/gradle/gradle/issues/7045#issuecomment-446861076","issue_url":"https://api.github.com/repos/gradle/gradle/issues/7045","id":446861076,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Njg2MTA3Ng==","user":{"login":"baron1405","id":989635,"node_id":"MDQ6VXNlcjk4OTYzNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/989635?v=4","gravatar_id":"","url":"https://api.github.com/users/baron1405","html_url":"https://github.com/baron1405","followers_url":"https://api.github.com/users/baron1405/followers","following_url":"https://api.github.com/users/baron1405/following{/other_user}","gists_url":"https://api.github.com/users/baron1405/gists{/gist_id}","starred_url":"https://api.github.com/users/baron1405/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baron1405/subscriptions","organizations_url":"https://api.github.com/users/baron1405/orgs","repos_url":"https://api.github.com/users/baron1405/repos","events_url":"https://api.github.com/users/baron1405/events{/privacy}","received_events_url":"https://api.github.com/users/baron1405/received_events","type":"User","site_admin":false},"created_at":"2018-12-13T06:49:45Z","updated_at":"2018-12-13T06:49:45Z","author_association":"CONTRIBUTOR","body":"Hey @bigdaz, I think I am seeing this problem when IntelliJ tries to start the Gradle daemon. I load a project into IntelliJ using the Tooling API and see the following out:\r\n```\r\n...\r\n> Configure project :\r\n\r\nBUILDING gradle-core-plugins - Gradle: 5.0, Kotlin: 1.3.10, Java: 11.0.1\r\n\r\n\r\nDeprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.\r\nUse '--warning-mode all' to show the individual deprecation warnings.\r\nSee https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings\r\n\r\nCONFIGURE SUCCESSFUL in 32s\r\nUnable to start the daemon process.\r\nThis problem might be caused by incorrect configuration of the daemon.\r\nFor example, an unrecognized jvm option is used.\r\nPlease refer to the user guide chapter on the daemon at https://docs.gradle.org/5.0/userguide/gradle_daemon.html\r\nPlease read the following process output to find out more:\r\n-----------------------\r\nError: Could not find or load main class java.base.java.lang=ALL-UNNAMED\r\nCaused by: java.lang.ClassNotFoundException: java.base.java.lang=ALL-UNNAMED\r\n```\r\nLooks like the second `--add-options` is be added to the first and we end up with an invalid java command line where the second value is being mistreated as the main class.\r\n\r\nMy environment is:\r\n* Gradle 5.0\r\n* IntelliJ 2018.3.1\r\n* OpenJDK 11.0.1\r\n* CentOS 7.6\r\n* Verified that IntelliJ is using the same JDK when running Gradle as the command-line\r\n\r\nThe problem is repeatable both when loading the project or refreshing it using the Gradle tool view in IntelliJ. Note that building the project on the command-line does not have this problem."}}
{"actor":{"display_login":"baron1405"}}