So I did git clone to get a maven project from a remote git repository. Great! I have been working in the command line, doing git pull, commit, etc. Great! Now I want to import this project into eclipse and be able to use git inside eclipse through the installed egit. So I did a:
mvn eclipse:eclipse -Dwtpversion=2.0
And after that I am able to import the project into eclipse through the regular:
Import -> General -> Existing Projects into Workspace
But the GIT options do not appear under Team !!! :( :( :(
How do I import this project and have the git options at the same time?
First, what you want to do is import the project as a Maven project directly. Then you don't have to do all the random command line stuff, plus you have the Maven integration in Eclipse with your dependencies and pom.xml kept up to date. (You need m2e installed for this.) Go to Import and select 'Existing Maven Projects':
Then, what you should do is enable eGit on the project. Right click the root of the project and select "Share Project" under "Teams".
Select Git and it will tell you that you can use the existing repo. Voila, you're done.
Team > Share Project -> select the git project.
Related
I am quiet new to git but for now I have set up a repository on Bitbucket. The repository contains my libGdx Project which is gradle project containing 3 sub-projects (Android, Desktop and Core).
So now it is my aim to clone this to eclipse using EGit. Everything works until i have to choose a wizard for the Import of the projects.
After i added the repo i use Import > git to Import a Project from the added repository
Here i have to choose the wizard
If i choose "Import existing Projects" the program tells me that no Projects are found.
After that i tried the "Use the New Project wizard" but it confuses me and actually i want to Import a gradle Project and not create a new one.
The last Option "Import as General Project" gives me just Folders and files, so eclipse doesn't notice the existing Projects. Like i said i'm quiet new to git so i appreciate every help ! :)
Thanks :)
The wizard intends to create the project settings files for Eclipse (.project and .settings/).
It seens like you don't have them in your git repository (I don't think you should). That why Eclipse asks you to create a new "project".
the best way is "Import -> Gradle project" (you need to have gradle plugin installed in eclipse first)
But is you don't want to use gradle plugin you need first to generate eclipse file. To do so, type "gradle eclipse" in your working directory (see https://docs.gradle.org/current/userguide/eclipse_plugin.html) and then import existing project into your eclipse workspace.
Another thing, it seems that your workspace is in the same folder as sources (.metadata folder), you should create your eclipse workspace in another directory.
I'm trying to import a project on GitHub into eclipse because there are a few things I want to add to it. However whenever I add it I get a ton of errors and problems with it...
The GitHub project is https://github.com/dmulloy2/SwornGuns
I've tried adding it to eclipse and it didn't work. I then tried making a project in eclipse and then put the files in, that didn't work. I also read online that going to Configure -> Convert to Maven Project would work, and then importing the spigot.jar file that this source depends on. However that didn't work and just gives me a ton of import errors.
The errors I am getting:
That project is a maven project. A simple way is clone that project into your machine, and import it as a maven project, with File - Import - Maven - Existing Maven Project.
Eclipse will help you resolve the pom file and configure project and download necessary libs.
First, make sure you are using Luna, the most recent version.
In eclipse, File > Import > Git > Projects from Git > Existing Local Repository.
In the Import Projects from Git screen, click add, then goto the location of the cloned repository. Click open, finish, then next. Select Java > Java Project, and click next again.
At this point, there are three options.
Import existing projects
Use the New Project Wizard
Import as General Project
Pick "Use the New Project Wizard". Then, uncheck "Use Default location", and click browse. Select a folder (You probably want the location you cloned the repo to), click "Open", and give the Project a name. Click next, and make sure that the src/bin folders are setup correctly, and click finish.
Whew!
Of course, the Import from Git option was only added in Luna, so update eclipse if necessary.
I imported a Maven project into Eclipse. I was able to deploy it from the command line. In Eclipse it is full of red Xs. I have cleaned the project, updated the configuration and I ran the following command:
mvn -Declipse.workspace=<pathtoworksapce> eclipse:add-maven-repo
and I still have the same problem. The project is dependent on another project.
What I ended up doing was removing all of the projects in Eclipse, but not deleting the source files. Then instead of directly importing the code as Maven->Check out as Maven Projects with SCM, I selected Existing Maven Project and imported the code from my local machine. This got rid of the errors, but when I would right click on code and select "Open Declaration", I would get Error: Could not open the editor: The file does not exist" So I removed all projects again and this time I deleted all the ".project" files and repeated the import Existing Maven Project. So now there are no red Xs (dependency problems) and the lookup functionality within the code works.
Go to your master project and type the following :
mvn install
mvn eclipse:eclipse
After that, import your project. You can also install m2eclipse for better support. If you use gwt or any other framework which has a custom maven execution, you should also install plugins for those in Eclipse.
I am trying to integrate Spring into my project in Eclipse. I am using Maven and have added the dependencies in my POM. While the maven build works, Eclipse does not recognize imports like the following.
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
How do I get Eclipse to recognize Spring imports? I am hoping there is a way to do this w/o downloading the jar files, etc.
Thanks in advance.
Eclipse doesn't support Maven projects natively. You must install a plugin (m2eclipse) to be able to use a Maven project inside Eclipse.
Another way to fix this is to open a command line, navigate to your project, and run mvn clean install and/or mvn eclipse:eclipse the first will parse the pom.xml and download all the dependencies and the second will build your eclipse meta-data files(.classpath and .project) you can even do this with the project open in eclipse and hit F5 to refresh and viola
Check your maven path in eclipse.
Window >>> Preferences >>> Maven >>> User Settings
Check for User Settings field that contains settings.xml
I have a multi-modules Maven project checked out from SVN. I installed m2eclipse in Eclipse. Then I imported the project into Eclipse. Everything is fine. But after I update my Maven project from SVN(outside of Eclipse), Eclipse will give me a lot of errors and warnings unless I import the project again. That is really annoying. I have to import the project every time that I update it from SVN.
Is there a solution?
Thanks a lot. :)
Install Subclipse see here: http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA
Then install, m2eclipse and m2eclipse extras as mentioned here: http://m2eclipse.sonatype.org/installing-m2eclipse.html
After, these are done.
Open Eclipse go to Window > Open Perspective > Other... > SVN Repository Exploring
Add URL to SVN repository/code base.
Select a project. Right Click and select Checkout as Maven Project. You're done.
Now, update, commit, delete, build all from inside Eclipse.
Install m2e and subclipse from the Eclipse Marketplace depending on what version of Eclipse you have. Then:
Open Eclipse go to Window > Open Perspective > Other... > SVN Repository Exploring.
Add your svn url to SVN repository/code base.
Select a project. Right Click and select Checkout.
Assuming your project has a pom.xml, switch back to your Java perspective, select the project that was just imported, right click and select Configure > Convert to Maven Project.
try the other plugin of maven may be more stable.
http://www.eclipse.org/iam/
Svn have a very stable plugin
But frankly it's not working good think about switching to intellij if you work with maven the integration between the IDE and maven is really working period
may be the free version of intellij is enough for your needs