score:21
At a minimum you should be check-in the .project
and .classpath
files. If anybody on your team is hard-coding an external JAR location in the .classpath
you should put them up against the wall and shoot them. I use Maven to manage my dependencies but if you are not using maven you should create user libraries for your external JARs with with a consistent naming convention.
After that you need to consider things on a plug-in by plug-in basis. For example I work with Spring so I always check-in the .springBeans
and likewise for CheckStyle I always check-in the .checkstyle
project.
It gets a bit trickier when it comes to the configuration in the .settings
folder but I generally check-in the following if I change the default settings for my project and want them shared with the rest of the team:
- .settings/org.eclipse.jdt.ui.prefs - it contains the settings for the import ordering
- .settings/org.eclipse.jdt.core.prefs - it contains the settings for the compiler version
In general I haven't noticed Ganymede modifying files without me modifying the project preferences.
score:0
Don't. Only check in the source code of your projects.
score:0
As a response to:
"There are settings unique to each development machine as well as settings global for all developers on a project. Keeping these apart was hard."
Eclipse offers a number of ways to keep local settings manageable: Java Classpath Variables (Java > Build Path > Classpath Variables) are one, 'Linked Resources' (General > Workspace > Linked Resources) are another http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/concepts-13.htm Creating a README that states which settings to set before building/running the project works pretty well in my opinion.
Now how to make sure your continuous build system understands the changes that were made to the eclipse settings, thats another issue... (I have a separate build.xml for ant that I keep up to date by hand)
score:1
I use IntelliJ, which has XML project files. I don't check those in, because they change frequently and are easy to recreate if I need to.
I don't check in JAR files. I keep those in a separate repository, a la Maven 2.
I don't check in WARs or JARs or javadocs or anything else that can be generated.
I do check in SQL and scripts and Java source and XML config.
score:1
I'd suggest having the actual project files ignored by the version control system due to the downsides you mentioned.
If there is enough consistent information in the project settings that there would be benefit from having it accessible, copy it to a location that Eclipse doesn't treat as special, and you'll have it available to work with on checkout (and copy back to where Eclipse will pay attention to it). There is a decent chance that keeping the actual project files separate from the controlled ones will result in loss of synch, so I'd only suggest this if there is clear benefit from having the settings available (or you're confident that you'll be able to keep them synchronised)
score:1
In our case, we used to check in the project files (.project and .classpath) to make it easy for all developers to create their project workspace. A common preferences file and team project set were located in source control as well, so creating your workspace was as simple as import preferences and import team project set. This worked very well, but does rely on everyone having a consistent environment, any customizations would have to be applied after the basic workspace is created.
We still do this for the most part, but Maven is now used so of course dependency management is handled via Maven instead. To avoid conflicting information, the .project and .classpath were removed from source control and are now generated via maven goals before we import the team project set. This would easily allow for different environments, as you would simply need scripts to generate the IDE specific portions based on the Maven configuration.
PS-For ease of maintenance though, I prefer having everyone use the same environment. Anything else inevitably becomes a full time maintenance job for someone.
score:1
Netbeans 6.5 has an improved Eclipse project import which is supposed to sync changes from Netbeans back to Eclipse: http://wiki.netbeans.org/NewAndNoteWorthyNB65#section-NewAndNoteWorthyNB65-EclipseProjectImportAndSynchronization
score:3
I like checking in the .project, .classpath, and similar files only if they will be identical on any Eclipse user's machine anyway. (People using other IDEs should be able to check out and build your project regardless, but that issue is orthogonal to whether or not to check in Eclipse-only files.)
If different users working on the project will want to make changes or tweaks to their .project or .classpath or other files, I recommend that you do not check them into source control. It will only cause headaches in the long run.
score:4
Try to port your project to a build system like maven. It has everything you need to get the same experience of the project on every machine you use.
There are plugins for just everything. Like the eclipse plugin. You just type "mvn eclipse:eclipse" and the plugin generates your entire ready to work eclipse project.
To give the answer to your question. Never check in files that are not being used by your project at any time in the development cycle. That means that metadata files like eclipse properties etc. should never be checked in in a SCM.
score:6
I only ever check in things are done by humans, anything else that is generated (whether automaticly or not) should be easy to regenerate again and is liable to change (as you've stated). The only exeption to this is when the generated files are hard (requires alot of human intervention ;) ) to get it right. How ever things like this should really be automated some how.
score:7
In our world, we check in the entire Eclipse project and the entire parallel but separate Netbeans project. Our motivations for this were entirely focused on "when I do a checkout, I want a functional configuration immediately afterward." This means that we had to do some work:
- Create runnable configurations for each primary IDE (people like what they like). This includes main class, working directory, VM parameters, etc.
- Create useful start up scripts for all of our relevant scenarios.
- Create edited datasets that don't cause the checkout to take too much longer (it's a big project).
This philosophy was worth cash money (or at least labor hours which are almost more valuable) when our new hire was able to check out the project from Subversion into Eclipse and immediately run a functional system with a (small) real data set without any fuss or bother on his part.
Follow up: this philosophy of "make the new guy's life easier" paid off again when he changed IDEs (he decided to try Netbeans after using Eclipse for quite a long time and decided to stick with it for a while). No configuration was required at all, he just opened the Netbeans project in the same directory that Eclipse had been pointing to. Elapsed switchover time: approximately 60 seconds.
score:9
I recommend to use maven so that the entire life cycle is outside of any IDE. You can easily create an eclipse project with it on the command line and you can use whatever you want, if it's not eclipse. It has it's quirks but takes out a lot of bitterness when it comes to dependencies and build management.
Source: stackoverflow.com
Related Query
- To check in, or not check in, the entire Eclipse project?
- How can I use the java Eclipse Abstract Syntax Tree in a project outside Eclipse? (ie not an eclipse plugin)
- Eclipse Build Error "A class file was not written. The project may be inconsistent, if so try refreshing this project and building it"
- Eclipse Oxygen - The project was not built since its build path is incomplete
- The project was not built due to "Failed to init ct.sym for C:\Program Files\Java\jre-10.0.2\lib\jrt-fs.jar" in IDE Eclipse
- "The project: swing which is referenced by the classpath, does not exist" in Eclipse when project name is the same as workspace name
- Why when I rename a project in Eclipse does Tomcat not pick up the new resource name?
- Eclipse CDT indexing not working to find declarations within the project
- Eclipse - how to set javadoc warnings only to specific folders, not the whole project
- eclipse project not importing the jar packages in local Maven repository
- Eclipse Ctrl+Shift+R not showing all files in the project
- In dynamic web application project the Eclipse debugger is not hitting breakpoints
- how to check the current workspace of Eclipse and the project on that workspace using java program?
- Is it possible to add the entire eclipse Plugin Project to a Eclipse RCP Application
- How to attach the source to the jar in the Gradle Eclipse Project when the source attachment is not modifiable?
- The ECLIPSE RCP project could not be exported successfully
- How do I tell eclipse to ignore files not related to the project
- Why does eclipse not find the beans.xml files in a spring based Maven project
- How to not check in Eclipse specific project files?
- Specific JRE name (which might not be the same on other computers) stored in meta-data for Eclipse Ganymede WTP project
- Eclipse 2019-09 - Getting the error: "Could not determine Java version", while creating a new project
- Dynamic web project in eclipse does not open the welcome page
- Eclipse deleting project but not the source code
- How to open folder of a file not in the project explorer in Eclipse IDE?
- Eclipse > Remote System Plugins > Error : the resource is not on the build path of a script project
- pydev plugin in eclipse not showing the files in the project explorer
- Eclipse 3.2.2 content assist not finding classes in the project
- Eclipse IDE - Classnotfound exception even though path known. Why can Eclipse find the lib in one Project but not in the other?
- Spring Project is not building in the eclipse
- Get HTTP Status 404 - Not Found, when the name of a dynamic web project renamed and deployed on Glassfish with Eclipse
More Query from same tag
- JIBX binding directory throws unexpected access binding error
- How to use the class from a jar file into a JSP page?
- How to fill an int array with random values from a range with exactly one duplicate for each value?
- Subclipse problem: running .java file as Java application
- Testing a Geo Transformation fails in maven, works in eclipse
- execute java class with ant
- Eclipse says "Launching : Verifying launch attributes", for half an hour, for a medium sized project
- Display query on BIRT report layout
- Eclipse error : cannot be resolved to a type
- How can I make my plugin automatically install third party features?
- Cannot start Tomcat 8 server Eclipse
- how to delete target folder of maven project in eclipse
- "Install new software error" with eclipse indigo/juno RCP
- Eclipse Java Doc
- Cannot find text document when using different consoles
- Non-resolvable parent POM and Could not transfer artifact from/to central repository
- Ability to avoid reloading spring context in tomcat when hot swapping classes
- Eclipse - sorting members on save
- Can't export signed applications
- Using E(fx)clipse and getting error with JRE
- Android Installation. Problem with Android SDK
- EGit, selecting correct parameters for URI, Host, and Repository Path.
- Logcat messages disappear after a short time
- Strange disconnect between Eclipse CDT, included system headers, and the underlying C build
- What is reason for yellow exclamation mark ("!") in eclipse java project(package and classes)?
- How I get a file in Android SDK?
- Override method but parameter is arg0
- How can I setup shortcuts in Eclipse to format elements in Javadoc?
- Eclipse no more showing android "Added in API Level" on mouse over
- LWJGL/OpenGL implementation causes NullPointerException error