Community
Participate
Working Groups
https://issues.sonatype.org/browse/MNGECLIPSE-1150
closing old/stale bugreports
This is still relevant IMO, even though old. Please consider reopening.
http://dev.eclipse.org/mhonarc/lists/m2e-users/msg04330.html
I created a patch for that in https://git.eclipse.org/r/57619. With this patch m2e will always create new launch configurations with the PROJECT_LOC variable expression (instead of absolute path names). That way you can move your workspaces around in your filesystem, without needing to adjust the launch configurations. Can you please reopen and afterwards apply the patch? Thanks
Reopening to consider Konrad's patch
*** Bug 481472 has been marked as a duplicate of this bug. ***
@Konrad: patch looks good to me, does the job. However could you please create a PR on https://github.com/tesla/m2e-core-tests, to add some unit test(s)?
@Fred: Thanks a lot for the review, but I guess I am not familiar enough with testing UI specific stuff in Eclipse to come up with a reasonable test here. Do you have any pointers on how to do the testing there? I was having something like this in mind: 1. Create a new project 2. Trigger a new Build... Action (which will open the launch dialog) 3. Click on launch (should work with the default config) 4. Move project to another location 5. Trigger a new build (leveraging the old launch config) At least the part where variables get replaced with real values during the execution of a launch config is already covered in org.eclipse.m2e.tests.launch.MavenLaunchDelegateTest.testGetVMArgumentsSubstituteMultiModuleDir()
UI Testing is pretty limited in m2e unfortunately. There were some SWTBot tests in the past but they were removed, because too unreliable[1]. If you can refactor ExecutePomAction to make the LaunchConfig generation testable, that'd be great (get an IProject in, test Launch config paremeters out). But I could easily settle for simple UT of LaunchingUtils#generateProjectLocationVariableExpression) [1] https://dev.eclipse.org/mhonarc/lists/m2e-dev/msg00672.html
Thanks for the hints. I picked approach 2 and created a PR at https://github.com/tesla/m2e-core-tests/pull/37. That should cover the variable resolution as well as a check that moved projects can use the same variable expression!
Patch applied as http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=a06480b38f464769a983c802d52daf0691617be2 Test : https://github.com/tesla/m2e-core-tests/commit/40a09827c035a5404ae048f95ab47af9b20aadff Thanks for you contribution Konrad. Keep'em coming
Moved to https://github.com/eclipse-m2e/m2e-core/issues/