How to clone Hibernate sources using Egit (Eclipse)? - 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

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.

Running Eclipse project with maven dependency to another project in same workspace?

In my workspace i have many maven projects with dependecies between them managed by maven.
When i try to navigate through the types it shows the maven installed artifact and not the actual class in the workspace residing in another project.
It will be of much help if eclipse autoresolves the maven dependency and point to the local project instead of installed artifact. Is there any we can force that.
Thanks

Using maven generated sources in Eclipse

I have an application made up of a number of maven projects. I work on it in Eclipse. Some of the projects use Maven plugins to generate stub classes for web services etc.
When i import the projects into a new workspace I have to issue a maven generate sources command followed by attach source folders to build path on each project. The application i work on has more than 5-6 projects which require these steps.
Is there a plugin I can install in Eclipse to pick up the generated sources, or even one that generates the sources and updates the build path to save the manual steps?
I'm pretty sure the m2e plugin takes care of this automatically. m2e is included in the primary Java and Java EE packages of recent Eclipse versions, so you probably already have it. If you right-click on your project, and there is a Maven submenu, then the project is already managed by m2e. Otherwise, right-click and choose Configure > Convert to Maven project.
Well, it depends on exact maven plugin you are using.
generate sources
Before I considered that m2e connector would be needed for any non common plugin, like generator. But I came recently on some plugins (1), that do it without special m2e connector.
attach source folders to build path
For this part check build-helper-maven-plugin and answer to M2E and having maven generated source folders as eclipse source folders

Setting up project is 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.

Question on "Converting Maven project of Mahout into Eclipse project"

While installing the open-source software like Mahout, I read some notes like
Convert Maven project of Mahout into Eclipse project
What does this mean? What's the difference between a Maven project and Eclipse project?
Install Maven if you haven't already done it.
Enter the command prompt or a shell and navigate to the directory where the Mahout is located (there's a pom.xml file). Type the command:
mvn eclipse:eclipse
which will create project files for Eclipse and open the project in Eclipse.
No conversion is needed. Eclipse supports Maven projects, and vice-versa.
Difference between these two projects yield from the difference of the tools. Eclipse is an IDE and Maven is a build tool. In fact, IDE is a superset of a build tool. That's why Eclipse may use Maven for building. Common properties between the projects relate to how the build is being done and Eclipse has a set of properties aimed to persist the state between programming sessions.