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

pom.xml configuration #4

Open
SehamAAlharbi opened this issue Apr 11, 2022 · 2 comments
Open

pom.xml configuration #4

SehamAAlharbi opened this issue Apr 11, 2022 · 2 comments

Comments

@SehamAAlharbi
Copy link

Hello,

I have tried to create a simple maven project and configured the pom.xml by coping yours but it seems not to be working. my main goal is to access the workspace using JDT:

IWorkspace workspace = ResourcesPlugin.getWorkspace();

but from a simple maven project instead of a plug-in or an RCP application .. is this possible?
if yes could you please let me know how the pom.xml file should be configured?

thanks.

@jmini
Copy link
Owner

jmini commented May 9, 2022

As I wrote in my blog post: Eclipse JDT without eclipse, as soon as you use a workspace (like with ResourcesPlugin.getWorkspace()) your code needs to be executed inside an OSGi container. Otherwise you will some Exception.

In the programcreek-osgi project, the trick is to put the code inside some unit tests and to have the bnd tooling execute them inside an OSGi runtime.

This works without Eclipse.

@SehamAAlharbi
Copy link
Author

Thanks Jmini,

In my code I need to access the workspace and manipulate the code structure of certain classes in a certain project.
In your repo you mentioned:

"To execute the tests in an IDE, be sure to run them inside an OSGi container (in the same way the maven build is doing it). If you are using Eclipse IDE, consider installing bndtools."

I am using Eclipse and I installed Bndtools but do not know how to use it to run these test cases, or how to add this bndtools." in my Maven project. any tips or resources to learn it would be really appreciated.

Thanks.

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

2 participants