Introduction
A file named .project marks a folder as a project in the
Eclipse IDE. It holds the project’s name, the
builders that run when it is built and its natures, which say what kind of project it
is, such as a Java or a C/C++ project, and so which tools Eclipse switches on for it.
The file has no name before the dot, so it is hidden on macOS and Linux.
Other settings sit beside it. A Java project has a .classpath file
listing its source folders, output folder and libraries, and plugins keep their
preferences in a .settings folder.
Structure
The file is XML with a projectDescription root. It contains the
name, an optional comment, a projects list of
referenced projects, a buildSpec of buildCommand entries each
naming a builder, and a natures list. It can also define linked resources:
folders or files kept outside the project folder.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Links
Software
- Eclipse IDE (Windows, macOS, Linux)
- Visual Studio Code, whose Java extension reads and writes these files (Windows, macOS, Linux)