Skip to content
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

WO Launch configurations generate wrong classpath for maven projects at runtime #153

Open
hugithordarson opened this issue Mar 15, 2021 · 2 comments

Comments

@hugithordarson
Copy link
Contributor

The classpath generated when launching a Maven application in Eclipse using a WO Launch configuration vs. when starting it as a regular java application is different. Most notably, when started as a WO application it seems:

  • dependency exclusions are not respected
  • dependency versions are not overridden (i.e. if I have a dependency on a library and there's a transient dependency on an older version of the same library, both versions are present in the generated classpath)
  • the test scope is included in the runtime classpath

This only applies when running from within Eclipse, i.e. the classpath.txt generated by an actual maven build looks like one would expect.

@hugithordarson
Copy link
Contributor Author

hugithordarson commented Sep 21, 2022

Replacing the WOLips classpath provider (WORuntimeClasspathProvider) with org.eclipse.m2e.launchconfig.classpathProvider results in a correct (or at least standard/expected) classpath being generated, but results in _NSUtilities.classWithName() having issues with locating some classes from the main bundle, such as Mainand DirectAction. I'm guessing due to some issue with classpath ordering.

Going to pursue this direction and see if it that can be fixed from the WO side.

@hugithordarson
Copy link
Contributor Author

hugithordarson commented Sep 25, 2022

For the past few days I've been using the regular Java launcher in Eclipse to launch my apps, rather than the WOLips launcher. This means a correct classpath is generated by Eclipse/m2e. Everything seems to work perfectly fine, although two modifications have to be made to the Java launch configuration when it's created.

  1. Add the VM argument -DNSProjectBundleEnabled=true
  2. Set the working dir to ${working_dir_loc_WOLips:[YourProjectName]}

Since this works for me, I'm not going to put any more work into trying to fix the WOLips launcher for now (but I'll not go so far as to close the issue since this is still broken in the WOLips launcher).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant