Subclipse: How to add the default output folder to version control (*.class files)? - eclipse

I am using eclipse 4.2 and Subclipse 1.8.20.
I am trying to add the contents of /WebContent/WEB-INF/classes to version control (this is also the default output folder of my project).
First let me state that this is possible with TortoiseSVN. I do understand why by default Subclipse ignores this directory, and I tried to change the Team settings, but I am not seeing a relevant entry for *.class files:
Is this at all possible with Subclipse?
More info:
Old an unanswered similar question: http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=473163
Same topic but opposite question: How can I ignore build directory in Subclipse?

It is a horribly bad idea to version your build directory. Every time Eclipse does an auto-build it will cause all of the files to need to be committed again.
To answer your question, all Eclipse team providers automatically ignore any resource that is marked as "Derived" by Eclipse. The Derived flag is set on files that are created by the Eclipse builders. If you select one of these files that are ignored in Eclipse, right click and choose Properties. Navigate to the Eclipse Resource page. There will be a bunch of checkboxes. You should see that one of these is labelled Derived and will likely be checked.
Do not try to change the checkbox value. I am just pointing out where you can see and confirm this.

Related

What causes "ghost" classes to appear in Tomcat/Eclipse after big changes?

I recently renamed one of the projects in my workspace. As a result Hibernate is throwing errors on a "ghost" class which no longer exists and is not referenced anywhere in my entire workspace including, source files, hidden files, config files, derived files, and binary files.
See screenshot below for visual people.
Where is the non-existing class name coming from? It is clearly being found by a component-scan.
Every time this happens, I am able to work-around the issue by doing all the following:
Delete the Tomcat server
Delete all my projects from Eclipse
Re-clone projects from git into Eclipse
Re-create new Tomcat server and re-add the projects into them
Is there a better solution?
You never mentioned whether you did a "Project->Clean..." from the menu. That could very well help. It's also not clear whether this is a Maven project. If it is, then doing Maven->UpdateProject from the project context menu could help.

Eclipse does not respect .cvsignore

In my project there is a symlink to a folder from another project.
The name of this folder is in .cvsignore
But this folder (symlink) contains cvs metadata (CVS folders) from the other project.
The cvs command has no problem with this and ignores the folder.
But eclipse wants to synchronize it.
The question is, can ecplise ignore a folder at synchronize time, or how to make eclipse respect .cvsignore files?
the folder (symlink) name is shared and in my .cvsignore contains a line with it's name
We use the symlink trick to share sources between our software and its plugins which are built separately (separate autotools projects).
The issue here is an explicitly shared folder overriding the .cvsignore entry.
You can find the exact details as explained by the previous Eclipse CVS component lead within bug 169710. This bug is marked as a duplicate of another defect which is still open, meaning this is a known issue.
As Michael pointed out, your choice is to use an Eclipse link for development:
Add new folder to Eclipse project
Select Advanced > Link to alternate location (Linked Folder)
Select the workspace variable (i.e. WORKSPACE_LOC) and point to the other project on your workspace (i.e. WORKSPACE_LOC/other_project/foo)
This will get you a linked resource that developers don't have to worry about mistakenly checking-in. For your automated builds you'll need an extra post-checkout step where you create the symlink.
This is not ideal but it's a sensible alternative, short of fixing the Eclipse issue.

Why are Eclipse project folders marked Derived still showing up in the Synchronization view?

How can I get the Sync view to ignore my Derived folders in Eclipse?
In the past, I recall that marking my Ant build output folders as Derived (right-click on folder, select properties, check the Derived checkbox) would:
keep them from showing up in the Open Resource dialog
correctly ignore them as not being legitimate outgoing changes in my CVS Sync view
When I mark the Ant build folder as Derived now, the contents are still showing up in my Sync view as outgoing changes.
What am I doing wrong? Has something changed with Eclipse?
I have tried cleaning, rebuilding, opening and closing the project, re-importing the project, and launching Eclipse with the -clean option.
Eclipse Version: 3.6.2, Build id: M20110210-1200
Eclipse has changes on this indeed. Now you have to either use Preferences/Team/Ignore Resources or add files/path to exclude from version control into local .cvsignore or per-repository CVSROOT/cvsignore
Cheers,
Max

ClearCase and Eclipse: How to hide/ignore files?

I'm working with Eclipse and ClearCase and we're facing the problem that there's no "ignore"-feature in ClearCase and we're having regularly checked-in files that shouldn't have been checked in.
In Eclipse, I already found the "Ignored Resources" configuration in Window -> Preferences -> Team and have been able to ignore files that follow a specific pattern that way.
But what do I do if I want to
keep a folder and all its contents from being checked in (such as a target-folder containing classes and such) or
keep a single specific file that can't be matched by a pattern in "Ignored Resources" from being checked in?
Update: We're using the provided Eclipse-plugin.
Within eclipse itself, the current ClearCase plugin cannot specify files to ignores, and they will always show up with a native ls -private command as private files.
Only a dedicated GUI (like CCRC -- ClearCase Remote Client -- used as Rich Client Platform based on eclipse) has a way to specify ignore files.
I'd say look at creating an entry in your configspec to exclude the target file/folder.
(I'm assuming you are using the Eclipse plugin)
When you create a new file or folder, it asks you whether or not you want to add the element(s) to source control. If you simply click cancel on the popup, then it will be ignored until you specifically add it. So, ClearCase, in effect, asks you whether or not this is an ignored file as soon as you create it. If the files are being checked in, blame the people who checked it in, not ClearCase.

How do you make eclipse use an existing svn working copy?

I've got a working copy checked out with svn; furthermore, I've created a new project in Eclipse that has the root of the working copy as the project's location. I want to be able to do stuff like compare versions from Eclipse. I have Subclipse 1.4.8, but that doesn't seem to give me what I want. Am I doing something wrong?
i have an svn working copy that also is a project in eclipse. after installing the subclipse plugin i had the same problem, the working copy was not recognized as such.
i just managed by chance to get it recognized as an svn working copy by renaming the project in question and then renaming it back to its old name. not very nice, but it did the trick :-)
There is an option when creating a new project, to use an existing source directory:
New project/ new Java Project / Create project from existing source.
Use that, tell it where your source lives, and it should automatically detect if it's a SVN working copy.
I guess this is not possible with Subclipse as it's given in its documentation that, you can only import an existing svn-managed folder under one condition, according to the doc:
"The only requirement is that your
working copy has to also be a valid
Eclipse project."
So, if you have a working copy that is not a complete eclipse project, Subclipse will not connect it to SVN.
You can right click on the root node of your project and select: Team / Share project
Then you choose SVN, let the default settings and it should work fine!
I am answering this after a long time of the question being asked. I ended up here because I was facing the same problem.
My solution was to create an empty .svn folder at the root folder of the project (in the latest version of svn client tortoise all meta-data is at the root folder). Then did an eclipse refresh and voila it did the trick. I am running subclipse core - 1.8.4.
One step that seemed to work for me, that no one has explicitly mentioned yet: I closed and then re-opened the project. I tried the "rename" trick, above, and that didn't work, but perhaps the poster of that answer also closed the project - they didn't detail exactly what steps they went thru to rename it. (I found you don't have to close the project to rename it, but perhaps they did.)
< /rob>
In my case, I couldn't use an existing copy because I checked out the code using a newer version of Subversion on the command-line and Subclipse 1.4 couldn't recognize it. Upgrading and going through the improved "Share Project" menu resolved the problem.
I got this tip from the forums here:
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2380064
I had the same issue and here are the details of the fix.
My Eclipse is "Helios Service Release 1".
I had an SVN checkout on my filesystem, I went to New Java Project, unchecked Use default location, chose the location, went to next step, chose the source folder and said Finish.
The project came up with no disk icon on it. As per few forum posts, right-clicked on the project, went to Team > Share Project, chose SVN, clicked Next, and the option was only to share the files to the SVN Repository for the first time.
I said Cancel, and the option is to make changes to the SVN plug-in settings. Went to Window menu, chose Preferences, browsed Team> SVN. Chose the SVN Connector tab, changed the SVNKit 1.2.3 to SVNKit 1.3.5 and said OK.
Then, right clicked on the project, said Team> SVN, on the next screen, chose the option Use Project Settings and clicked Finish. The disk button came to the project and the SVN URL got displayed on it.
Add the repository to your list of repositories in subclipse by choosing Window->Show View->Other... and choose SVN->SVN Repositories. Put in all the necessary info to connect to the repository.
Next, right click the repository and choose "checkout". If the project doesn't already have an eclipse .project file, you can create a new project from the source. If it already has a .project file, it will import that .project and use that as your eclipse project locally.
It will definitively not work if you use a different version of svn to checkout, that the one that is supported by Eclipse. I had this problem as I used svn 1.6 to checkout but I had an older eclipse version that had only 1.5. Subclipse has its own build-in svn client (Actually, in two flavors if I am not mistaken).
Check that the subclipse version matches the svn client that you used to checkout. You can check the plugin version number for subclipse (Help -> About -> Click on subversion logo) and match it against svn --version
This worked for me:
1) Go to the 'SVN Repository Exploring' perspective and add a folder somewhere above your working copy
2) Close and open the Eclipse projects.
This should then be enough to get them recognized by Subclipse.
I have encountered a similar situation were existing projects would not get associated with the Subversive plugin. Unfortunately, none of the previous suggestions helped (renaming projects etc.). What has helped is removing projects from Eclipse by deleting them -- just the projects from Package Explorer and not the actual directories and files on disc (the deletion prompt has a special checkbox for that, which is unchecked by default) -- and reimporting the deleted projects as existing projects back.
Of course, as mentioned in some of the answers here, the relevant SVN repositories need to be registered with Eclipse before reimporting the projects. Otherwise, there would no repositories to re-associate the projects with.
When you open a versioned project (i.e., a project in SVN working copy) in Eclipse, that was never previously used with Subclipse, you need to perform these steps:
Right-click the project in Project Explorer.
Select Team | Share Project.
At this point Subclipse will tell you that "The project is already configured with SVN repository information". Click Next.
Subclipse automatically recognizes this project as versioned and all the features of the SVN plug-in should become available.