Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

VSCode --add-opens run configuration setup

37 views
Skip to first unread message

Radek Antoniuk

unread,
Apr 23, 2025, 7:36:44 AMApr 23
to Jenkins Developers
Hi guys,

I'm wondering if anyone is using VSCode to develop the plugins and has a setup that can share? I'm having trouble setting up properly workspace options so that the --add-opens are passed to the Maven test runner.

I see the surefire configuration reusing by VSCode is not supported so after spending too much time trying to figure this out, I just disabled for now autobuild for java in VSCode and I run the tests from the terminal, which is very annoying.

Theoretically, the run configurations should work, but for some reason it's not working for me. Then I figured, that most probably someone already has a proper setup for this? (maybe someone has checked into git the .workspace file with the config?)

Thanks,
Radek

Michael Nazzareno Trimarchi

unread,
Apr 23, 2025, 7:47:13 AMApr 23
to jenkin...@googlegroups.com
Hi

On Wed, Apr 23, 2025 at 1:36 PM Radek Antoniuk <radek.a...@gmail.com> wrote:
Hi guys,

I'm wondering if anyone is using VSCode to develop the plugins and has a setup that can share? I'm having trouble setting up properly workspace options so that the --add-opens are passed to the Maven test runner.

I see the surefire configuration reusing by VSCode is not supported so after spending too much time trying to figure this out, I just disabled for now autobuild for java in VSCode and I run the tests from the terminal, which is very annoying.


I followed some instruction in jenkins

This is my configuration of one of the plugins. It's trivial but it's ok most of the time

MIchael
 
Theoretically, the run configurations should work, but for some reason it's not working for me. Then I figured, that most probably someone already has a proper setup for this? (maybe someone has checked into git the .workspace file with the config?)

Thanks,
Radek

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jenkinsci-dev/fa7cc383-3078-4f33-a235-64af2deb3d26n%40googlegroups.com.


--
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
mic...@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
in...@amarulasolutions.com
www.amarulasolutions.com
vscode.tgz

Radek Antoniuk

unread,
Apr 23, 2025, 9:07:45 AMApr 23
to Jenkins Developers
Hi Michael,

Thanks! 

However, I don't see anything related to the --add-opens setup in your config. 
I tried your setup, but there is was difference in running the tests via VSCode (screenshot), they were still failing with 
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @22c8bf6c
which is because the flags I mentioned earlier are not passed to the test runner.

I then tried again with my previous run configuration approach and I made some progress with the following settings.json:

{
"java.test.defaultConfig": "conf",
"java.test.config":
{
"name": "conf",
"workingDirectory": "${workspaceFolder}",
"vmArgs": [
"-Xms768M","-Xmx768M","-XX:+HeapDumpOnOutOfMemoryError","-XX:+TieredCompilation","-XX:TieredStopAtLevel=1",
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/java.util.concurrent.locks=ALL-UNNAMED"
],
},
}


That made the tests that failed because of the add-opens param missing now succeed, but I still see a bunch of other tests failing (screenshot 2) with some weird errors like:

Caused by: io.jenkins.plugins.casc.UnknownAttributesException: unclassified: Invalid configuration elements for type: class jenkins.model.GlobalConfigurationCategory$Unclassified : jiraglobalconfiguration.
Available attributes : administrativeMonitorsConfiguration, artifactManager, buildDiscarders, builtInNode, casCGlobalConfig, computerRetentionCheckInterval, defaultDisplayUrlProvider, defaultFolderConfiguration, defaultView, envVarsFilter, fingerprints, globalDefaultFlowDurabilityLevel, junitTestResultStorage, location, mailer, myView, nodeProperties, perforce, plugin, pollSCM, projectNamingStrategy, proxyConfigurationManager, quietPeriod, resourceRoot, scmRetryCount, shell, usageStatistics, viewsTabBar
 
I guess this is related to the hudson classFilters mentioned here: https://github.com/jenkinsci/jira-plugin/blob/master/pom.xml#L406-L410 but I don't see how to set this in settings.
Screenshot 2025-04-23 at 14.05.30.png
Screenshot 2025-04-23 at 15.05.48.png

Jesse Glick

unread,
Apr 23, 2025, 1:23:21 PMApr 23
to jenkin...@googlegroups.com
If you use https://marketplace.visualstudio.com/items/?itemName=Oracle.oracle-java the test button from the editor will just run Maven and everything should work out of the box.

Ivan Fernandez Calvo

unread,
Apr 24, 2025, 4:00:11 AMApr 24
to Jenkins Developers
I use the extension pack for Java, which includes various extensions for managing Java projects, debugging, autocomplete, and more. I do not have any issues I do not have with other IDEs. Sometimes, you have to clean your target and work folders, or run `mvn compile -DskipTests` to generate the Messages class and other resources, so that you do not have missing classes in the IDE.

Reply all
Reply to author
Forward
0 new messages