Cannot revert .classpath and .project - classpath

I just created myself a new workspace by copying an existing one. I renamed the new one and deleted all included projects. Then i checked out some other projects. After this i got some local changes compared to the repository. These changes are in the .project and in the .classpath files.
The local .classpath looks like:
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=project&ivyXmlPath=ivy.xml&confs=*"/>
and on the remote repository it looks like:
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&confs=*"/>
The local .project looks like:
<nature>org.apache.ivyde.eclipse.ivynature</nature>
and in the remote repository this nature does not even exist.
If i revert these changes, SpringToolSuite instantly makes these changes again. Can someone tell me how i can fix this?

Related

Accidentally overwrote .classpath file when exporting project on eclipse?

I've been pushing and pulling projects from git and importing them into my eclipse workspace.
I tried exporting my project and I got an error (something about overwriting .classpath file) and I chose to proceed.Now I can't open my project(class path not in class file error) and I can't push anything into gitlab anymore because they will notify no changes have been made even if I modified the code.
What my Eclipse workspace looks like:
I googled, apparently you can re-generate .classpath files? If it helps I did save a copy of the overwritten .classpath file.

Commit multi-module maven project to SVN

I used Maven to create several projects in Eclipse, based on Maven archetypes, and ended up with this project structure (a parent project with multiple modules):
Parent project - pom.xml:
<name>backoffice-root</name>
<modules>
<module>backoffice-web</module>
<module>backoffice-ejb-core</module>
<module>backoffice-ws</module>
<module>backoffice-ear</module>
</modules>
Now I want to commit them to a SVN repository using Subclipse.
In my first approach, I added these projects to SVN in a flat hierarchy. The first project that I added was root, otherwise I'd get a warning saying that .svn folders in modules would be deleted:
backoffice-root
backoffice-web
backoffice-ejb-core
backoffice-ws
backoffice-ear
If I try to commit after that I get an error "backoffice-root/backoffice-web is already under version control". I believe this happens because when I added the projects to SVN, a .svn folder was created inside each one of them, but I don't know how can I solve this problem without deleting these folders and losing the information contained within them.
So I tried a second approach: adding root to SVN and then all the others under root (mapping my Maven project structure to SVN repository), creating this structure in the repository:
backoffice-root
backoffice-web
backoffice-ejb-core
backoffice-ws
backoffice-ear
But when I try to commit all of them, I get the same error of approach #1.
The only way that I get things to work is by just adding root to SVN and committing it (it commits all the modules since they are folders inside root). But I want to work on each project and commit them individually. Do I need to structure my Maven projects in a flat layout like explained in this post? How does one work this way with my original layout?
I'm working with the same your layout and everythings work. My project's skeleton is the following:
parent
-model
-util
-services
-web
model,util,services and web are all modules to parent and are placed in parent directory. Then I committed the parent project (that contains all modules) and finally I checked out and importing (In eclipse File->Import->Maven->Existing Maven Project) all modules.
Update1
Try to describe the procedure along some screenshoot:
Step1 I already committed the parent and all modules
After checkout you will wind the following situation:
where only the parent is linked with the svn. Now you have to do (File->Import->Maven->Existing Maven Project and selected all modules. Then automatically you will have all modules linked at the svn
Update2
My parent definition is the following:
<modules>
<module>model</module>
<module>util</module>
<module>services</module>
<module>vaadin-webapp</module>
</modules>
and each module has instead this configuration
<parent>
<groupId>myCompany</groupId>
<artifactId>myProject</artifactId>
<version>2.2.1-SNAPSHOT</version>
</parent>

Eclipse complains for the readonly .classpath file

We keep .classpath files in ClearCase. When a teammate gets a project from ClearCase, Eclipse complains that .classpath file is readonly. It is readonly because the teammate has not checked it out. We don't want them to check-out .classpath files, as changes on these files should be reflected to their workspaces without extra effort.
Is there anything we can do to stop Eclipse complain about readonly .classpath files?
Looking at the JDT source code it is expected that this file is available and is read/write at all times. I don't see anything to work around this.

How do I ignore this Eclipse file in Git?

I tried adding it to my global .gitignore but it is still showing up as an untracked file when I do git status.
researchProject/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator (4).launch
I disabled the JavaScript validator because it kept giving my build errors -- the only solution I found was to disable it.
add the following lines to your .gitignore file:
.project
.settings
.classpath
.metadata
and for your case also
.externalToolBuilders
and you should be good to go.
Do not add .project and .classpath to .gitignore if you are working on an eclipse-specific project.

Ignore .classpath file while sync CVS in eclipse

I know that you can ignore the file (preference-team-ignore resources) type while committing to CVS from eclipse however how can I ignore the file type being synchronized with CVS. I have got 40 project in workspeace and every time I sync with CVS, it list all the .classpath files from all the project however I would like to ignore this file to make CVS sync view better.
any help will be appreciated.
Cheers
You can add the .classpath file to the .cvsignore file. In Eclipse, you should be able to right click on the .classpath file and go to Team -> Add to .cvsignore. Here are some additional details.