Importing AEM projects into Eclipse - aem

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.

Related

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.

Using maven generated sources in Eclipse

I have an application made up of a number of maven projects. I work on it in Eclipse. Some of the projects use Maven plugins to generate stub classes for web services etc.
When i import the projects into a new workspace I have to issue a maven generate sources command followed by attach source folders to build path on each project. The application i work on has more than 5-6 projects which require these steps.
Is there a plugin I can install in Eclipse to pick up the generated sources, or even one that generates the sources and updates the build path to save the manual steps?
I'm pretty sure the m2e plugin takes care of this automatically. m2e is included in the primary Java and Java EE packages of recent Eclipse versions, so you probably already have it. If you right-click on your project, and there is a Maven submenu, then the project is already managed by m2e. Otherwise, right-click and choose Configure > Convert to Maven project.
Well, it depends on exact maven plugin you are using.
generate sources
Before I considered that m2e connector would be needed for any non common plugin, like generator. But I came recently on some plugins (1), that do it without special m2e connector.
attach source folders to build path
For this part check build-helper-maven-plugin and answer to M2E and having maven generated source folders as eclipse source folders

How to use Eclipse plugins inside regular Java project?

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.

eclipse api's to get current project's repository url

i am working on developing a eclipse plugin which takes code from repository and builds the code in hudson.
for that i need to get the repository url of pom.xml
are there any eclipse api's to get repository url of current project.
for example i have got the workspace of current project using this api.
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
IPath location = root.getLocation();
I think you should try to "stand on the shoulders of giants". Eclipse has now integrated m2e from Sonatype (formally m2eclipse), and I found the following in an XML file
M2E provides both a framework for building Maven-centric Eclipse
tools and set of tools and user interface elements directly
consumable by Eclipse Users.
As a framework, M2E provides facilities to import and configure
Maven projects in Eclipse workspace as well as APIs that allow
m2e extensions to access Maven project metadata and participate in
Maven project configuration and workspace build.
So you should look into m2e and check if the API allows what you want to do. I would start with plugin org.eclipse.m2e.core and study how to get access to the maven project ...
I think eclipse may not know the repository url in pom.xml,the eclipse maven plugin can tell you about them,but why not manually analyze the pom.xml as resource file?

Eclipse doesn't see classes from a plug-in dependency

I want to use Netty in an Eclipse RCP application. After downloading the latest jar, I've added it to dependencies of my plug-in, but packages it provides aren't resolved in the editor. It's visible under "Plug-in dependencies" in the Package Explorer, as are all other dependencies (which work fine). How can I fix this?
What compilation error do you get when you import classes from netty? How did you create a plug-in project from the netty jar file? Did you use the "Plug-in from Existing JAR Archives" wizard? Are the packages of netty that you'd like to use exported in the manifest of the plug-in project of netty?