How to use Eclipse plugins inside regular Java project? - eclipse

I have a EMF project with an Ecore model, and I exported it as an Eclipse Plugin. Now I want to reuse this plugin (the plugin exported Java packages) inside a regular Java project (using Eclipse).
I created a Java project, and tried to use the option Build Path > Add Libraries > Plugin Dependencies but it shows an empty plugin list and I cant add entries.
The created Java project have no META-INF/MANIFEST.MF and I have not found a way to create it automatically.
How can I add a dependency to my exported plugin? Do I need to create a special kind of project?

You need to create a Plugin Project. So you can edit your MANIFEST.MF and add the generated plugin as a dependency.
Lars Vogel has a good tutorial that covers how to do it in EMF context.

Related

I developed an eclipse editor using ecllipse-rcp concepts .My requirement is to build the project using maven

I developed an eclipse editor using eclipse-rcp concepts .My requirement is to build the project using maven.
So i wrote the pom with packaging type=bundle using apache felix concepts.
After building the project, the project jar has the class files,plugin.xml and the manifest file.
Now, I am dropping this jar in plugins folder of eclipse.I want to open files of a certain extension with this editor. But my eclipseis not showing my editor name in the Internal/External editor list, even though the plugin is the plugins folder of eclipse.
Please help.
If you want to build Eclipse plug-ins with Maven, you should use Tycho: https://www.eclipse.org/tycho/. It provides specific packaging types for handling Eclipse plugins and features (groups of plugins).

How to add acustom plug-in to a java project in eclipse

I have created a custom plug-in and i want to add to add that dependency to my java program.
How do I do that?

how can I create maven Gwt project?

Hello friends I have not so much Idea about maven build tool. I just download and install it in my system as I read maven is a build tool and work perfectly with transitive dependency. this is the basic reason to use it
I also configure mavan plugin in Eclipse.
so what is the proper Gwt maven archetype in eclipse and I read so many command in tutorials like maven:gwt run but I dont to where is this command exist in eclipse
I am very new in maven so please help me like a beginner
This is a common approach to get support of maven in existing GWT-Project
Make a gwt project by using the gwt plugin in Eclipse. Now you have
an Eclipse gwt project.
Select the project in Project Explorer , right-click it, then choose
Configure . Then select Convert to Maven Project . Now you get a
gwt-maven project.
Now add necessary dependencies to pom.xml .
if you want to create a gwt maven project directly you need to choose gwt archetype if not exist you can add this have a look in
this video
You should:
Download the gwt plugin in Eclipse and create a gwt project.
In Eclipse select the project, right-click on it, then choose Configure. Then select Convert to Maven Project.
Now you get a gwt-maven project.

Importing AEM projects into Eclipse

I have searched around and couldn't find a direct answer in how to import an existing AEM project on my local into Eclipse. I am relativity new to AEM and would like to use the features Eclipse has. I have the AEM plug in downloaded and am able to create a new project, just not import.
I am not using maven, just packages and OSGI.
Advice?
You can create a new AEM archetype project (provided by the AEM eclipse plugin). That project will be a maven project.
Since you are not using maven in your current project, you can manually move all of your java files into their respective location on the newly created AEM project. As for the java dependencies, you can lookup tutorials on how to use maven and add your java dependencies to it. or you can just add your dependencies directly on the project, but I recommend using maven.
You have only package and OSGI bundle, so you can only modify the content (package) and cannot modify the bundle.
We cannot import a project from the osgi bundle to make the source code editable.
For import AEM project to Eclipse, follow the procedure:
Import AEM project as maven projects. Please check with image.
Then select your project and build.
From where you are getting those packages and bundles?
When ever you build the project from the source(cmd : mvn clean install), packages/bundles will be generated under respective target folder based on pom.
So, you can only import project source on eclipse and not the generated target files.

Can't access class in Eclipse plugin from a Java Project

In abstract, my problem is the following: I want to access a class contained in an Eclipse plugin from a Java Project. Is it possible? I've included that class in the "Exported Packages" of the plugin, which supposedly are "all the packages that this plug-in exposes to clients." Can my Java project be a "client" or only other plugins can be clients?
More concretely, I've encountered this problems when using XText. I built an editor for a language, and programs written with this language are stored in a text based format that follows the grammar defined with XText.
I want my users to be able to write Java programs that load and manipulate those xtext-based files. For that, they need to access all the classes that XText generated in the plugin project. However, I haven't been able to use those classes: in an Eclipse instance that is running the plugin with my editor, those classes are not visible.
How can I access them? The only solution I've found is to export my plugin as a jar and then include it in the Build Path of the Java project, in the other Eclipse instance, but this doesn't sound elegant.
Another way of looking at this problem is the following: I want a certain class to be available to any Java project built in an Eclipse instance where a certain plugin is loaded. How can I do it?
Thanks for your help.
PS. I'm launching the second Eclipse instance (the one where the plugin is loaded) from within the first Eclipse instance.
Once you generate your XText support, you need to make sure every package is exported from the Runtime tab by editing your MANIFEST.MF.
Then once you deploy your plugins into an eclipse, that eclipse environment will be able to see those classes.
But that would only help other plugin developers. Java apps can see classes that exist on the classpath (if you add the plugin jars, for example) but as most eclipse plugins depend on the eclipse lifecycle to work, it's unlikely that their java programs would run. That's not always the case (you can use JFace without a running eclipse) but only for plugins specifically designed that way.
If your plugin is installed, you can create a java project and add the plugin jar as an external jar, using *ECLIPSE_HOME* variable. If your plugin is a project in the workspace, you can depend on it (from the java build path) just like another java project. But since it's a plugin, that probably won't help them run.