I created a maven project and imported it in intellij. In a run configuration there is a field "working directory" which points to the root of maven project. If I change this folder it doesn't seem to affect anything. So what is it?
In computing, the working directory of a process is a directory of a hierarchical file system, if any, dynamically associated with each process. It is sometimes called the current working directory (CWD), e.g. the BSD getcwd function, or just current directory.
a module is like a project, it produce jar file and can behave independently, but directory is part of a project and use to organize folders and classes.
Change the default location for projects In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Appearance & Behavior | System Settings. In the Default project directory field, specify the path to the folder in which you want to store your projects. Apply the changes and close the dialog.
Content in IntelliJ IDEA is a group of files that contain your source code, build scripts, tests, and documentation. These files are usually organized in a hierarchy. The top-level folder is called a content root. Modules normally have one content root. You can add more content roots.
This is the directory that is set as the Java user.dir
system property. If you have any code that creates relative files or directories, it will be relative to this directory. So for a well designed application (i.e. resolves resources from the classpath and is configurable for output directories) this will not be a factor. There is also some importance to this value in maven projects, especially multi-module maven projects. This directory specifies the directory IDEA will read the POM from.
If you are unflamilar with what the Java user.dir
is, there is some discussion available here and in the class level Javadoc for the File class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With