FlowingCode / DevelopmentConventions

Repository hosting conventions, decisions and documentation related to best coding practices that can be utilized in development projects
Apache License 2.0
9 stars 0 forks source link

Describe local environment setup guidelines #44

Open mlopezFC opened 2 months ago

mlopezFC commented 2 months ago

It would be nice to write some documentation regarding useful tips and guidelines regarding local setup:

javier-godoy commented 2 months ago

My two cents:

Recommended location for checked out projects

C:\dev\projects\customer\

Customer-based organization is important, as it enables quick removal of all customer-related sources once retention is no longer necessary. (This can be improved in case one works with many different customers at once.)

I also use a separate directory for Eclipse workspaces (C:\dev\workspaces\project) so that the checked out project is free from .metadata. This means they aren't tied to a specific IDE version, making it easier to roll back during IDE upgrades.

Recommended location for IDEs and JDKs (Windows)

I like to have all of them in the same directory (eventually, one needs to use an older IDE for some legacy project; or maybe one wants to try a new IDE). The same applies for JDKs

C:\dev\ide\eclipse-jee-2023-03
C:\dev\jdk\jdk-17.0.0_35-corretto

Set JAVA_HOME to the bin directory of your preferred JDK, and include %JAVA_HOME%\bin in the PATH. This way you don't need to update both variables after a JDK upgrade. To ensure the right version is used, add %JAVA_HOME%\bin immediately after the %SystemRoot% entries. (Since earlier paths take precedence, your preferred JDK will remain the default even Even if a different java.exe is added to the PATH.)

Recommended location for Maven binaries (Windows)

It’s handy to store them in a well-known location that's easy to type when a project requires a specific Maven version.

Example: C:\dev\app\apache-maven-3.9.7

Add C:\dev\app\apache-maven-3.9.7\bin to the PATH.

(Optionally, make C:\dev\app\apache-maven a symlink to the default installation of Maven, and point the PATH to it.)

Recommended location for local maven repository

At first, I used a custom location, but after forgetting to configure it a few times and ending up with duplicate downloads, I decided to stick with the default %USERPROFILE%\.m2\repository

If the build fails because "CreateProcess error=206, The filename or extension is too long" one can mount it somewhere else:

subst M: %USERPROFILE%\.m2\repository
mvn -Dmaven.repo.local=M:\ spring-boot:run

Recommended local settings for VCS

None. I'm happy with the defaults.

Recommended tooling (Windows)

Other tools