How do I add jar files to imported project from SVN in Eclipse - 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.

Related

Importing Apache Lucene-Solr into Eclipse Luna

I'm having a great deal of difficulty importing the source from git://git.apache.org/lucene-solr.git into Eclipse. I mean, I can import it as a vanilla non-java project, but that's not very helpful. It's not a Maven project, but it has this Ivy thing. I've download the IvyDE plugin, but I don't understand how to use it to import a project, and I haven't found any useful documentation from the Lucene project relevant to my problem.
Any ideas?
Edit:
To be clear, I'm not trying to add Lucene to any application. I simply want to browse the source code in Eclipse as a stand-alone project.
I did just
ant compile
ant eclipse
and then in Eclipse
File -> Import -> Existing Projects Into workspace
and that's it.
you can find the needed steps here [1]. As you said, it's not a maven project so there are some preliminary (ant) steps to do before.
[1] https://wiki.apache.org/solr/HowToContribute#Getting_the_source_code
Although Lucene is not --- at first --- a maven project, you can create a Maven project with a provided Ant target (I guess it is a target but I haven't checked the code).
In the sub-directory dev-tools/maven/README.maven there are instructions on how to make Lucene a Maven project:
ant get-maven-poms
cd maven-build
Now you can use all the normal Maven commands and import the Maven project into Eclipse (although it won't show the source).
If you wish to edit the source use:
ant compile
ant eclipse
Happy coding!
Ref.:
http://svn.apache.org/repos/asf/lucene/dev/branches/lucene_solr_4_0/dev-tools/maven/README.maven
http://svn.apache.org/repos/asf/lucene/dev/branches/lucene_solr_4_0/README.txt

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.

How do I have Maven install and/or configure eclipse plugins automatically

I am new to eclipse and the interaction between eclipse and maven.
Is it possible to have Maven automatically install Eclipse plugins if the eclipse path is known?
Is it possible to configure specific project settings for each installed plugin when the eclipse project is created? Is it easy to update these configuration settings once the eclipse project is created?
How may I go about this using Maven? Or is it not possible/ideal?
To install a plugin, you would have to copy the plugin files to the eclipse/plugins folder as described in the Eclipse wiki
You can use maven to copy the plugin files/folders to the eclipse plugins directory. This question will show how: Best practices for copying files with Maven
However, I would not advise to use maven to configure the IDE and its plugins, you should manage your projects and not your IDEs with maven.

What eclipse plugin the project is required?

I have found this project sample. It says it is an eclipse project type but I am wondering what eclipse plugin does it require to be compiled successfully? I'd like to build the sample with my eclipse but I am not sure how should I prepare my eclipse to compile such kind of project? What additional libs etc... So I need your advice
Here is its structure screen shot
project source...
Any useful comment is appreciated
That looks more like a maven project structure - check if it has a pom.xml.
In the root directory of the project , I found it has a pom.xml , so it is a Maven based project.
Looking into .project file (an eclipse project-specific file) , it has the following :
<nature>org.maven.ide.eclipse.maven2Nature</nature>
org.maven.ide.eclipse.maven2Nature means that the project has the m2eclipse (a maven pluign for eclipse) nature .Note that after the version 0.12.1 , m2eclipse project is moved to Eclipse Foundation and become the part of Eclipse 3.7 (Indigo) release . The name of this nature becomes org.eclipse.m2e.core.maven2Nature
Besides ,I also found that there are some WTP-specified setting files (eg org.eclipse.wst.common.project.facet.core.xml) in the .setting folder . WTP is included inside the 'Java EE Developers version' of eclipse by default.
So , this project is created by eclipse installed with the WTP and the m2eclipse with the version at or before 0.12.1.
how should I prepare my eclipse to compile such kind of project? What
additional libs etc.
As it is a maven project , you don't have to include the additional libs explicitly . All the libs required are configured inside the pom.xml and maven will download these libs for you.
For me , I would use an eclipse installed with WTP , m2eclipse ,m2eclipse-wtp and GWT eclipse plugin . Then create a new maven war application , and only copy the pom.xml and the src folder to the project .After that use the m2eclipse function to update the download libs and those project-specified setting files.