Adding 3 projects to version control (SVN) in Eclipse - java

I'm currently developing an application, and I have worked in the last weeks with the following 3-project setup :
the code itself;
unit tests;
acceptance tests.
Until now, I had only the code itself under version control. I'm researching on how to include all the 3 projects under version control. I'd like to have everything under the same repository. I've created 3 folders(one for each project) under my SVN repo.
In a new workspace, I've imported each one of the projects into Eclipse. This seems, at first, to be working fine, but I'm not sure if I won't get problems later on when trying to make commits to the server and the different projects aren't in the most recent update.
I'd guess this wouldn't be a problem as they don't share any file, at all, but I'm not really sure. Is this the correct approach for the given situation? How would you handle this?

You create a local project in Eclipse, right-click on it, and select Team/Share project...
Then a wizard will guide you, and allow putting the code into the correct folder of the svn server.

Related

Eclipse keeps building workspace

I'm using Eclipse Mars 4.5.0 IDE, and developing ColdFusion applications using CFEclipse plugin. Also, I have SVN Subversion and FileSync plugins.
The company, which I work, has a huge repository. I synchronized all files to the my own workspace and when I do any changes in Eclipse it should update my own workspace and development folder in our server.
It works fine, but sometimes, let's say once a week it starts to build workspace automatically. As I said workspace is huge, so it takes forever.
I cannot do any changes while it was building. Actually I can change the codes but I cannot save the file, saving task is just waiting to build workspace. When I cancel the building task, then try to save the code, before saving building workspace start again.
It's really annoying. I cannot do any work, I have to leave my computer at the work, when I came next morning building is done, and I can start to work. I tried everything to get ride of it, none of them worked.
Also project build automatically is unchecked. But when I do chances in the code, I have to build project not the workspace to sync the code to the development. But of course it builds all workspace not just project.
Interesting thing is that it is not happening all the time. Sometime it works fine, sometime not. For example, yesterday, I just copied one folder from one project to another one, and tried to build project, but Eclipse build whole workspace. I don't know what to do?
EDIT: Screenshot is added.
Have you tried unchecking build automatically in
Window/preferences/general/workspace?
EDIT:
similar question has been asked before on SO.
The answer was (as far as I can understand) to make jar-s out of projects that you use but don't want to compile them every time.
Make sure you have unchecked the option Build Automatically under the Project menu.

Spring Tool Suite (Eclipse) project run problems

So some quick background information to describe my problem. I have a project named Pear that contains a basic Spring project, using Maven. I put this exact project into a SVN repository, and then imported it into this same Eclipse/STS instance under the name of SpringTestRepo.
The problem is, this imported repository contains no Run options that the one I created in Eclipse originally has. For example, in the Pear project, Run -> Run As gives the option to run on an embedded Tomcat server. In the SpringTestRepo project, I have no options - anything past Run As is greyed out.
Another thing that I'm having a problem with in the difference between the two projects is that the one I imported via SVN (SpringTestRepo) has no little 'S' or 'M' by the name of the project. It's also missing several handy annotations, such as a list of methods underneath my HomeController.java class.
Here is a picture to help illustrate my problem.
Any ideas as to how to resolve this issue?
Edit: Just to be clear, it's a little hard to see but just above the Pear project there is a little Maven 'M' and a little Spring 'S' symbol.
I believe I solved the problem! To anyone else importing an SVN project into their STS and having trouble getting it recognized as a Maven/Spring project (the little 'M' and 'S' next to the project name), follow these instructions.
First, to import from your SVN repo after the Subversive Eclipse plugin, click File -> Import -> SVN -> Project from SVN and then press next. Enter in your repository location - in my case, it was svn+ssh://user#domainIp.goes.here/home/user/SvnRepositories/SpringTestRepo. This location will be wherever you are serving your SVN repo from - the beginning of the URL could be svn+ssh, http, https, or several other options depending on how your SVN is set up. Click next, and then click Finish when it asks you which Revision you want to import (I'm importing HEAD, which is selected by default).
A new dialog will pop up, giving you four different choices in the form of radio buttons as to how you want to import your project.
Logically, I tried 'Check out as a project with the name specified'. This is what yielded the picture in my question - a project not associated with Maven. What you need to choose is 'Check out as a folder into existing project'. Exit these dialogs, and create a new Spring MVC Project that you will import that SVN project into. That is File -> New Spring Project -> Spring MVC Project. Once you have created this project, go back through the steps and import your SVN repo project into the project you just created.
This resolved the issue for me. Feel free to edit if I missed anything. Thanks
You need to create a new run configuration. Eclipse doesn't know how to run your web app for you hence why its greyed out.
Check out this for starters:
http://wiki.openkm.com/index.php/Configure_Tomcat_server_in_Eclipse
http://www.codejava.net/frameworks/spring/spring-mvc-beginner-tutorial-with-spring-tool-suite-ide
Once you configure a server you can then select project to deploy to server and run.
Here is another good link to help you out run:
http://www.deepakgaikwad.net/index.php/2009/02/08/spring-mvc-tutorial-with-eclipse-and-tomcat.html

How to checkout an old revision using Subclipse subversion

I need some help checking out a java project from a SVN repository. In order to validate my work, I created a test java project in my local workspace, and am able to create a jar file of it. But I can not do that with the project that I check out from SVN. This is a project, which others have successfully checked out. Before I started I knew very little about SVN, so I read this url: How to use Subversion with Eclipse
I am using subclipse v 1.6.18
I choose checkout after right-clicking the repository from repository perspective. The developer of the code told me to use revision 10. So I click the selection button, and from the list of revisions I double click revision 10. and click on Finish. !
I also choose the "check out as a project in the workspace" and call the project javacardreader.
Unlike the tutorial I saw on youtube about SVN. I do not see any option to synchronize with the repository in the java perspective. I do see the javacardreader project in my java perspective. But when I try to create a jar file from it, the folder does not show up as an option like my other test project.
I also do not see an option for adding the binaries to SVN ignor in my list.
My question is what am I doing wrong? My understanding is that revisions are changes / improvements that developer(s) make to the code. One question that came up in my discussion with the developer was if I am pulling the committed code. How can I make sure I am doing that? Where should I look? Am I missing something about how SVN works?

Is it possible to use intellij idea and eclipse together

for someone it may seems a little weird but still I want to know if it's possible or not. We have a lot of projects which coded on eclipse so far and some of us wants to jump into intellij idea world.
Can we be able to run the projects via eclipse and intellij together at the same time? I mean for instance I'll be using intellij idea while another friend of mine will be using eclipse instead of intellij idea on the same projects, is it possible?
If it's possible, would it create any problem for version control systems such as subversion?
Subversion will have no problem at all, but I recommend you in that case that you rely your java build configuration (sources, compiler level, dependencies, etc.) on maven or gradle instead of doing it twice, once for every IDE you are using. Then both maven or gradle should be able to generate IDE-specific configuration files for each environment and you would work in the same conditions.
Actually I like the idea of working with a managed and automated build process, so if anyone is brave and bold enough to use vim... they can use it without problems, and still build their app.
Can we be able to run the projects via eclipse and intellij together at the same time?
Yes, because these IDE store their project data and configuration in different files, so they don't step on each other:
Eclipse stores its files in .project, .classpath, .settings
IntelliJ stores its files in .idea, *.iml
If it's possible, would it create any problem for version control systems such as subversion?
Not at all.
Btw I do this too sometimes: I have projects where members use different IDE: IntelliJ, Android Studio, Eclipse, with no problems.

Open eclipse svn project in netbeans

OK my problem is quite simple
Im about to start working with a team of programmers, and we are using a svn repository to store our code, thy files are set up as Eclipse Project as the rest of my team all like eclipse.
However I am die hard netbeans man, I have tried eclipse Iv given it some time but we do not gel as they say.
So my question is there a combination of plugins /hacks that i can use to access a Eclipse Project from an SVN repository inside Netbeans , without corrupting the eclipse project or causing problems for the rest of my team (I would rather suffer eclipse than do this to them)
Many thanks ^_^
In NetBeans 6.8 under File > Import Project there is both Eclipse Project and Resynchronize Eclipse Projects. I'm guessing this can be used to work together with people using Eclipse.
UPDATE: How the eclipse import function works.
As NA pointed out, there is a way to import your Eclipse projects into Netbeans. However, arguably, you shouldn't be checking in IDE-specific files into your repository unless you can guarantee everybody is using the same IDE. Otherwise, I would recommend only checking in the source code, resources, and additional libraries and keep the specific files on ignore and have each individual setup their own environment.
Another alternative, is to check in the IDE-specific files in a different folder in the repository so that an individual can grab them if they need them.

Categories