I have been working with Netbeans quite a while and I am now moving to Eclipse.
Basically I have a Maven project that I would like to work on using Eclipse.
What I am not sure about is whether I need to point my Eclipse workspace to the directory where my project super pom is located or whether the Eclipse workspace needs to point to a clean/empty directory.
My question is basically:
Are the source files eventually located in the Eclipse workspace directory?
Can anyone please advise?
Regards,
If you have the m2e or m2eclipse plugin installed, you can just do "Import..." then "Existing Maven Projects" and point it at the super-pom. It'll import all the modules it finds, as separate projects.
you can use the maven eclipse target to generate project files so you can move them directly in the eclipse workspace:
mvn eclipse:eclipse
info on the plugin
It's a matter of personal preference whether you have the source files in the workspace folder or not. Eclipse can import your project from any folder. Personnaly, I keep my projects folder separated from the workspace folder.
Related
I am using Eclipse Indigo, and after having successfully extracted my project folder into my Eclipse workspace, it does not show up in the package explorer. I tried refreshing eclipse and restarting it, to no avail. I am 100% certain my eclipse is using the right directory and the project is in it.
What could be the problem? Thank you.
EDIT: "import projects into workspace" worked for me, but why was that necessary?
Files in the directory are not automatically picked up by the package explorer. You need to import them.
Try using the File > import, then choose
Existing Projects into workspace.
There is a checkbox that says "Copy projects into workspace" which copies it to your workspace if it happens to be in a different folder. If you start with your files in another folder, you'll see how it's copied and set up with configuration files in your workspace directory.
To answer the question, "why is it necessary to import?" you have to realize that the Eclipse workspace is just a logical container for projects, not necessarily the physical container for them.
Also realize that a directory of project-related files does not make an Eclipse Project; Eclipse must be given or generate it's own set of configuration in order to understand a project (minimally, for Java projects, .project and .classpath). Without those, Eclipse has no idea what to do with an arbitrary folder that you call a "project." That's what the Import or Create Project wizards are doing under the covers, generating those config files.
I wrote a batch file to do a SVN checkout that saves all the projects I checkout from a repository into my workspace and starts eclipse.
After starting eclipse, I need to import these projects but I wanted to find a way to automate this. Need help knowing how this can be done.
set svnbin="C:\Program Files\VisualSVN Server\bin\svn.exe"
set svnroot= some_url
%svnbin% list %svnroot%>projects.txt
type projects.txt
echo ============================================================%NL%
set /p checkout="Enter project name to checkout="
set svnfolder= some_url/%checkout%/trunk/
set CheckOutLocation=C:\Users\user\workspace\
svn checkout %svnfolder% %CheckOutLocation%\%checkout%\trunk\
Now , I have projects in my workspace folder . How can I automate eclipse
to add these existing projects by itself?
If the projects you are checking out are not eclipse projects already, then you can try running mvn command
mvn eclipse:eclipse
This will convert your project into eclipse projects and then you can import them into eclipse.
I have not tried this but this is my 2 cents -
If they are Eclipse projects when you check out, you can copy the .project, .classpath and .settings folder and into a folder and make this folder one of the projects of the Eclipse workspace.
I bought a new computer and installed Eclipse on it. After the ADT plugin finished downloading I tried to import my projects (composed of 4 sub-projects), but Eclipse doesn't see them!
I just click "import/general/import existing projects into workspace", select the folder containing the sub projects, hit the open button but Eclipse says "No projects found to import".
I'm using Eclipse Kepler and the projects files are directly taken from Eclipse Juno.
Eclipse need .project file to import the projects into workspace. what you can do is create a new project and copy the source and libraries into that project
Alternative method can be that create a new project and copy the .project file from that project to your project but make sure you edit the .project file and change the name of that project according to your project. read this for more information on .project file
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html
I will suggest you to use the First method .
Make sure that you've tried to:
Refresh everything
Searched for Nested Items
Go to (In the libg-gdx setup) Advanced >> Check Eclipse
And if that doesn't work, add a .project file into the folder manually
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
My Eclipse recently broke completely and I have upgraded to Galileo. I have created a fresh workspace (say foo/workspace) and created a trivial project. I have then copied an old project from (bar/workspace/myproject) to foo/workspace/myproject. It is mavenised and has a pom.xml. How do I tell Eclipse to build it (it does not seem to recognise it is mavenised). Do I have to install the maven plugin?
In general what is the smoothest way to reinstall Eclipse (i.e. what else do I need to think about?)
I never create or checkout a project directly under the Workspace but rather use something like ~/Projects for all my projects. This allows me to remain IDE independent. Actually, I never use any IDE to create a project.
I share my workspace location across several Eclipse install (specified at startup or using -data). If anything goes wrong, I don't mind deleting and loosing my workspace, it doesn't contain anything really important anyway.
Use the m2eclipse Eclipse plugin to Import > Maven Projects into Eclipse. Another option is to use the maven eclipse plugin to generate the .project and .classpath from the command line and then to Import > Existing Projects into Workspace from Eclipse.
It is better to reference directly your old workspace when starting your new eclipse installation: see this eclipse.ini
-data
c:/a/path/to/your/old/workspace
That way, you get back all your projects.
You can install the m2eclipse maven plugin by adding its update site to the list of sites examined by the eclipse p2 provisioning mechanism
http://m2eclipse.sonatype.org/update/
If the metadata associated with your workspace is messed up, and it sounds like it is, the easiest thing to do is simply delete the .metadata folder from the workspace (or rename it to something else). Start up Eclipse, it will show an empty workspace, and then use File -> Import to import existing projects back into your workspace. Just point it to the folder of the existing project and it will do the right thing, leaving the project in place.
For the maven stuff, the Import Maven projects mentioned above seems right and probably does some other stuff to have maven work out.