Setting up project is eclipse - eclipse

I want to setup my work project in Eclipse, with following features:
1) Connect to SVN repository
2) It is a maven - multi module project
3) It is a spring project
If I import this project as Maven project I am not able to connect it to SVN repository.
If I check - out SVN repository, I am not able to set it up as Maven/Spring project.
And ideally I want to make it hot deployable, (as eclipse dynamic web project), so Development can be efficient.
How can I possibly do this.
I have setup eclipse Juno SR1 with Maven, STS, and SVN plugins.

What you can do is follow the below steps :-
Checkout from svn to your local drive.
As it is a mave nbuild project you will have the pom.xml file in the root of the project. Do a mvn eclipse:eclipse -Dwtpversion=2.0 on the project.
3.Open eclipse and go to File-->Import--> Existing projects into workspace.
This should do.
FYR see this

After the project is checked out into the Eclipse workspace, just remove the project by using the following action: -
right click at the project ---> delete ---> click ok
Please take a note, do not check the check box named "Delete project content on disk". We have just want to remove and re-import again.
All we need to do is re-importing by using the following action: -
File ---> Import ---> Maven ---> Existing Maven projects
This will help us to integrate the Maven with the SVN in Eclipse. We will see the revision information after the project name, folders, packages, classes, etc.
Anyhow to use Maven in the Eclipse, you should install the Maven Integration (m2e). Furthermore there is a useful plug-in to integrate the Eclipse WTP with the Maven as well. It is named Maven Integration for WTP.
I hope this may help.

Related

How to import a maven project in eclipse?

I have a (command-line) maven based project which just works great (mvn clean, mvn verify, install all perfect)! I want now import this into eclipse not as maven project but regular eclipse project.
I did it but I have a dependency issue which I solved by just copying all the jars created into the .m2 folder to another folder into my eclipse workspace. Then I've added all these jars to my project.
everything ok!
Question is: I have the feeling that this is not the best way to manage the dependency in eclipse ... what do you suggest? best practices
If you have a simple java project which is made up of only one module, using Eclipse is very simple. To generate the Eclipse project files from your POM you execute the following command:
mvn eclipse:eclipse
If you have created or checked out the project with Eclipse, you only have to refresh the project in your workspace. Otherwise you have to import the project into your Eclipse workspace (From the menu bar, select File > Import > Existing Projects into Workspace). In the latter case the project (directory) should not be located in your workspace, because Eclipse might come into trouble, especially if you want to use Eclipse as the scm client.

Regarding Maven

I am new to Maven and if you feel i am asking really basic question then please forgive me.
I am facing couple of problems with Maven mentioned below.
I am using Eclipse Luna 4.4.1 (Which comes with the Maven Plugin).Now i installed two plugins..out of which one is for subclipse(with SVNKit) and m2e-Subclipse which is used for integrating the maven with SVN.I downloaded the project in eclipse using svn plugin as "checkout as Maven project" and i could see the project being downloaded and now to remove all the errors related with the POM.XML i downloaded the Maven and given the local path of the Maven in the preferences > Maven > installations and changed the Global Settings and user settings files which are project specific.
1). Now even after doing all this circus i still can not see the Maven build options in my Eclipse.
2). I am not even able to clean the project from command prompt.
when i go to my project directory and type "mvn -version" which shows me the correct version of maven.
But when i try to clean it using mvn clean. it does not work.
Please help.
Regards.

How do I add jar files to imported project from SVN in Eclipse

Before posting this question, I did NOT see any reference to this topic. I just added the subversive plugin to my Eclipse Juno IDE and my question is after I imported a project from my SVN repository and now have the project setup in eclipse, how do I add JAR files to this project that the code needs to reference?
I do NOT see a configure build path on the project at all. I am new to subversive and could really use some help. I tried this in Netbeans 1.7.2 and it gives you the ability to add libraries to the project but I don't see it in Eclipse.
Any help/direction would be greatly appreciated. Regards.
Adding jars to a project build path doesn't have anything to do with SVN and subversive. You add the jar as you would do it without subversive: Project - Properties - Java Buid Path - Libraries - Add JARs/Add External JARs.

How to deploy a maven project in tomcat within Eclipse

I have been trying to deploy a project that I created within eclipse but when I right click on the tomcat server and click "Add and Remove...", I got the message "There are no resources that can be added or removed from the server".
From what I understand it has something to do with the facets? I am not really sure to understand what is going wrong here.
Here is what I did for know:
I created a Maven project.
executed mvn eclipse:eclipse through the command line on the folder of the project
installed m2e
tried to add the project to the tomcat server
You probably want to use either mvn eclipse:eclipse OR m2e, but not both. m2e has gotten MUCH better in the last couple years, so that's what I would suggest.
Make sure you are using Eclipse for Java EE, otherwise you will need to install other plugins like WTP
Install m2e.
Install maven integration for wtp (from the eclipse marketplace)
make sure the artifact type for your project is war
Import Existing Maven Project in eclipse and browse to your pom to import the project.
It should give the correct facets to your project so it looks like a web project.

How to clone Hibernate sources using Egit (Eclipse)?

I need help using Egit (Eclipse git integration capabilities). My goal is to have Hibernate sources in my local Eclipse. Eventually I aim for running their tests, doing some changes in the sources, issuing a git pull request (patch), etc.
Can someone explain how to clone Hibernate sources and have them as Java Project(s) in Eclipse?
All I can achieve myself is to have the sources cloned (as needed) to some specified path (the suggested path is outside of the workspace directory). Then I am puzzled trying to convert the structure into Java projects in Eclipse. I try different ways to import the project(s) using File | Import (e.g. Existing projects into workspace) or linking sources into a new created Java project. The problem seems to be the Hibernate sources are not a single maven project (not quite sure about this one either, I am new to maven) and probably not an Eclipse project at all, so Eclipse doesn't recognize the source structure at all.
It looks like it has both maven and ant builds, so you can generate Eclipse projects with both of these.
For maven you have 2 options:
Run mvn eclipse:eclipse to generate
eclipse project artifacts and then
import existing projects.
Install m2Eclipse and import Existing Maven
Project. This is the preferred
approach when working with Maven and
Eclipse.
For ant, New project->Java Project from Existing Ant Buildfile