Creating new project in Eclipse from Github parent/child pom? - eclipse

What's the correct way to create a project in Eclipse from a github project which uses the parent/child pom construct, for example https://github.com/vladmihalcea/vladmihalcea.wordpress.com ?
I can clone/download it ok, but then do I need to manually create an eclipse project for each sub-project within or is there a better way?
(Googled the hell of out this question without finding an answer, but please feel free to post a link if you know of such.)

Use the Import feature of Eclipse.
Select File / Import ... from the Eclipse menu.
From the Import dialog window, Select the Maven / Existing Maven Projects wizard option.
Click Next.
From the Import Maven Projects dialog, choose the root directory using the Browse directory chooser.
With the directory choosen, the dialog will be populated with all available Maven projects. Check all the projects to be imported.
Click Finish.

Related

Import multiple projects in IntelliJ IDEA

I have a number of projects in my Eclipse workspace, some of them plain ol' Java projects, some of them Java web applications, some of them Flash Builder Flex projects.
They all live in a directory hierarchy. How can I open all of them in IntelliJ IDEA to be able to migrate from Eclipse to IDEA? The projects reference each other.
You can create an IntellIJ IDEA Project from source using the Import Project in the main menu.
Select the eclipse .project file or .classpath then check Link created IntelliJ IDEA modules to Eclipse project files.
The official docs, here:
To import an existing Eclipse projects to IntelliJ IDEA:
Open the New
Project Wizard. Having selected the option Import project from
external model, click Next.
On the Import page of the New Project
Wizard, select Eclipse. Optionally, check the option Import into
current project. Click Next.
On the next page of the wizard, specify
the directory, that contains the desired Eclipse workspace. In the
section IntelliJ IDEA project and module file location, specify
whether you want to create IntelliJ IDEA module files in the same
directory where the Eclipse projects reside, or in a dedicated
directory of your choice.
Check the option Link created IntelliJ IDEA
modules to Eclipse project files to automatically synchronize the
Eclipse projects and IntelliJ IDEA modules.
Specify whether you want test sources to be imported.
Click Next. IntelliJ IDEA scans the specified workspace for projects.
On the next page of the wizard, select the Eclipse projects you want
to import. So doing, each Eclipse project is converted to a separate
IntelliJ IDEA module. Click Next. Specify the name for the new
IntelliJ IDEA project, and the location of the project files.
Select also the format in which the project will be stored. Click Finish.
If you select "Keep project and modules in" you could separate eclipse project and IntelliJ IDEA project files
I never did something like this, but after reading docs and playing a bit the options it should be the best way.

Subclipse checking out as folder not Java project

I'm trying to import a Java project from my teams subversion repository. So I go through the import GUI for subversion, select my repository and the project, then choose to check it out as a project into the workspace.
However, the project now appears in my workspace simply as a folder:
Trying to add a new class tells me "source folder is not a java project". Is there something I am missing? Thanks.
Check out as a project only does what you want if you have checked-in the Eclipse .project, .classpath files etc. In that scenario those files get checked out and configure the Eclipse project. Otherwise you are just getting an Eclipse "Simple Project" which does not have the Java tools configured.
I assume you do not have those Eclipse files in your repository, so you want to use the other option that lets you run the Eclipse Create Project wizard as part of the checkout. This lets you choose the project type and setup some of the configuration. You can skip most of the configuration since you can also do that after the checkout finishes if you prefer.
See: Subclipse Checkout Documentation

Importing maven sourceproject into eclipse

I have imported my maven project in eclipse using Import Maven project. It got import in eclipse project explorer, but all the source folder are opening as files and folders, its not opening as java source folder. Since its opening as files and folder, it doesnot have compilation unit, found very difficult to code using it.
What do I need to do inorder to make the source folder as java source folder so that I can code easily?
Select the project and from the context menu choose Maven -> Update Project Configuration (This menu item gets reworded across various maven releases so look for something similar). You may also need to choose Update Dependencies.
In the shell/command line, execute mvn eclipse:eclipse

maven integration in eclipse new project checked out but can't navigate

I am struggling with maven in Eclipse even though I have m2e.
I checked out a maven project from CVS and cannot navigate anywhere. If I try References > Project, I get a pop up saying:
"Problems opening an editor Reason: services does not exist".
services is the name of the main project, which has sub projects within it. It all builds successfully so I am not sure why Eclipse does not work.
I suspect something related to classpath but have no idea how to edit it since it is not available from the project's properties. I actually tried to manually create a .classpath file but it did not help.
I also converted the project to a maven project but that did not help either.
Any ideas? I am using Eclipse JUNO.
I figured out my issue. I had to check out the project from CVS. Then (that's the important part), perform a maven import of an existing project within eclipse. That created maven "ready" projects where I could use all of the IDE's functionality.
Yes, you're right. If you import directly from a repository, hovering, linking and opening declarations isn't gonna work. Your solution is right, although another one more direct is use the "File->New->Other->Maven->Checkout Maven Projects from SCM". If then, you have problems because you can't select any SCM type, check Checkout Maven project from SCM - no connectors. If with connectors installed you still have problems: http://forum.springsource.org/showthread.php?102665-SCM-types-not-available-in-Checkout-Maven-Projects-from-SCM.
If you have checked out project from svn, project checked out is not generally a eclipse project thats why general functionality of eclipse does not work for the same.
To achieve the same functionality of eclipse like eclipse reader and all other shortcuts,we have to convert the checked out project to eclipse project.
Steps to Convert checked out project to eclipse project:
Right Click on Checked-out Project.
Point to Configure.
Click on Convert to Maven Project.(if checked out project is maven project)
These steps will convert the project to Maven project.
All the eclipse functionality will work for the same.
In addition to ensuring that the projects are configured as Maven projects, you may also go to Project Properties (right-click on the project in Package explorer) > Project References, and add projects in the workspace that the selected project may have references to.
I had this problem, too.
It looks like after a search-in-workspace Eclipse opened a wrong file.
I pressed Strl+Shift+H (Open Type in Hierarchy), typed in the class name, and opened it. The file opened in a new tab, and everything was navigable again.
The difference in icons is:

How do I import projects from another workspace?

I started with the default workspace C:\workspace but I mange to corrupt that by removing files so now I've created a new workspace to import the files to but I don't know how to do that. Could you tell me how I import projects from another workspace? I'm using the IBM RAD which is based on eclipse.
Thank you
Here are the steps for the original eclipse :
After switching eclipse to use the new workspace , go to File--> Import , and then choose General ---> Existing Projects into Workspace , and browse to the folder of the project that you want to import.
In Eclipse, the steps will be:
Select "File" tab
Select "Import" option in the drop down list.
Select "General" in the source listed.
Select "Archive File" if You have .zip/.rar file of the Project or "Existing Projects into Workspace" if You have Project in some other workspace.
Browse the Archive File or root directory location.
Select "Finish".
Now your project has been imported.
I am not very familiar with RAD but if its anything like Eclipse, the projects are stored by plugins. For ex: All my java related projects are stored under
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects
while my other projects related to another project (Seamframework related) are stored under
workspace/.metadata/.plugins/org.jboss.tools.seam.core/projects
The best thing would be to search your
workspace/.metadata/.plugins
folder and see if you can identify all your projects. When you do, you can import them all into your new workspace as is.
To import the projects, once you locate them, follow the instructions posted by others here.
Good Luck!