-
Notifications
You must be signed in to change notification settings - Fork 115
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
surefire.forkNumber undefined variable #1884
Comments
Have you tried my suggestion to define a corresponding variable in Window -> Preferences -> Run/Debug -> String Substitutions. That definitely will solve the problem. |
the problem isn't working around it, the problem is a regression in functionality. I believe I can also work around it by adding -DDEV to the jvm run parameters. |
Have you looked at the launch configuration itself? I expect it will contain the |
yes, in the run configuration -> arguments -> vm arguments it is populated with
and yes, if I manually remove that, it will run again. The easier work around is for me to just set the forking to 1 and hard code the fork count instead of using the forkNumber right now. The reason being - that vm argument is auto generated /added by eclipse every time you run a junit test for the first time. So effectively every time some one runs a junit test, instead of just right clicking -> run as junit, they would have to right-click -> run junit, watch it fail, right-click -> run configuration -> remove argument -> run. Thanks for the concern about this blocking me. I'm not blocked, I've just hard coded it to 1 thread and the number 1, and it works for all our developers with out any additional effort for any of them. (the performance difference for forking v.s. non-forking was not significant for us anyways.) I just wanted to lodge this issue as it seems like no one else had run into it yet (and it took us quite a while to narrow it down to this, we though we broke it with something we did). It also means that anyone else using any surefire variables (or possibly any other plugins with any other variables) will also no longer work for the same reason. So while my problem was trivial to work around, it may be more significant for other people. |
surefire.forkNumber generates an error when junit test is run from with in eclipse.
Basically in a pom.xml surefire plugin section, you can configure to fork. This works on the command line using mvn directly, this also worked in prior versions of eclipse. I'm unsure when it broke but I think it was with in the last month or so.
Reverting back to a much earlier version of eclipse (the only one I had was 2024-03) shows it worked back then.
The reason I didn't notice it the day it happened was because you must right click the project -> maven -> update project, before it breaks (or after you install a new eclipse), if your system was working with an older version it would continue working until you had to do an update-project.
attached as a simple project showing this.
project zipped : temp.zip
To un-break it, you have to downgrade to an older version of eclipse and delete the working directories .metadata directory or it will continue to appear broken even on older versions.
We also tested jdk 17,21,23 and it happens on all versions. It happened on multiple fedora 40 machines. It happened with both the eclipse-installer with bundled jdk and binary untar-gz versions with separately downloaded openjdks.
the download was tagged eclipse-jee-2024-09-R-linux-gtk-x86_64.tar.gz
the relavant part of the pom (it's in the zip file) is as follows :
The text was updated successfully, but these errors were encountered: