Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does eclipse create a .settings directory?

Tags:

java

eclipse

i have noticed that eclipse recently creates a .settings directory with 1 file inside and i am wondering if i should add this to version control? SVN?

also, is this new? i have been using eclipse for quite a while, but never noticed it.

the contents of the file in the directory is this:

#Sun Oct 11 14:57:03 CEST 2009 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.6 

shouldnt these settings be workspace-wide and not project specific?

like image 349
clamp Avatar asked Oct 11 '09 15:10

clamp


People also ask

What is the purpose of .project file in Eclipse?

File created by Eclipse when creating a new project; saved in an XML format and contains the project name, build specifications, and dependencies; used for saving and loading projects into the Eclipse IDE; uses the filename .

What is the use of .classpath file in Eclipse?

The . classpath maintains the project's source and target references for Java compilation and compressed file or project dependencies. This configuration is maintained through the Java Build Path page in the project's properties.

Where does Eclipse store project settings?

Where are they stored? Most preferences are stored under the workspace location, in a folder named . metadata. If you use project-specific settings (a good idea in general), those are stored under the project root directories in various folders and files, mostly beginning with .

What is project root folder in Eclipse?

Eclipse designates a root folder in which to house sub-folders for projects and their resources. You can set up multiple workspaces if you want, but at any one time you will only have one open in Eclipse at a time. Chances are that you will need only one workspace for all of your work in this course.


2 Answers

This file records project specific settings vs. workspace preferences.

I noticed that this file is usually created when you convert a regular Java project to Java EE project.

The only time I would check this file in is when the project's compiler/warning settings are different from the default workspace settings.

This may be the case when some legacy projects cannot be compiled with the latest and greatest java compiler, or when the source code generated by a 3rd party produces a lot of warnings that are benign but pollute your Problems view.

If you are going to use project specific settings, then definitely check this file in. Otherwise delete it.

like image 113
Alexander Pogrebnyak Avatar answered Oct 08 '22 00:10

Alexander Pogrebnyak


The .settings folder is used by various plugins to set persistent 'Properties' as opposed to 'Preferences' to specify project specific settings that should be preserved.

This is usually a directory you most definitely want checked into svn/cvs/git etc as it will ensure that all users who check that project out into eclipse use the right project specific settings.

In our case we use it to supply a minimum compiler version of 5 since some devs are on Java 5 versus 6 etc but we want things compiled to 5 for our servers. We also use it to enforce some coding standards and auto-formaters which makes version diffs much easier to read.

In your specific case you selected 'Enable Project Specific Settings' under "Properties->Java Compiler" by right clicking on the project and choosing properties.

like image 32
fisherja Avatar answered Oct 07 '22 22:10

fisherja