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.
Related
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
I have a project in my Eclipse workspace from Github (via File -> Import -> Projects from GIT).
However, I am unable to run the example because the only option I have under "Run As" is "Run Configurations."
After going to "Run Configurations" I click "browse" and the project that I imported from GIT isn't there.
Any ideas?
The question is already answered in the comments but I am providing this answer to possibly clear up some misunderstandings.
In order to recognize a folder as a (Java) project, Eclipse needs to read (or create) a few files for each project, like .project and .classpath. If you do not have them in your project, or do no create them during the import, then Eclipse just imports it as a resource, or a dumb folder.
If your project is tracked by git and is also a maven project, you can clone it locally with Git (command line or GUI tool) and then "Import as existing Maven project" in Eclipse. This will use your pom.xml to create the two files mentioned above and your project will be buildable.
Alternatively, if you have already imported it as you described in your question, you can right click on your project on Package Explorer and choose Configure-->Convert to Maven Project. This will create the .project and allow you to build the project using Maven (right click->Run as..-> Maven build) and Eclipse's incremental builder (where necessary). If your maven project builds an executable, the option to execute it will also be available in the Run as.. menu.
If you have a more complex maven project (like an aggregate pom), and want a Run Configuration that runs a specific program, you will have to write it yourself by opening the Run Configurations window and explicitly referencing the java class.
Don't import the project using git clone. Download it as zip file and extract it. Add it using Project>import> General> Projects from folder and Archive.
Provide path of extracted folder into import source and finish and go to eclipse and clean and build safely run and right click on project and run it.
It should work
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
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.