Repaso
Español
Maven, Git & SDLCFoundationsVCS-32

In a standard Maven project, where do the source code and the test code go?

Options

  1. src/main/java and src/test/java (Correct option)
  2. bin/main and lib/test folders
  3. target/src and docs/test folders
  4. web/java and test/java folders

Answer

src/main/java and src/test/java

Why

Maven uses a standard folder layout, so every project looks alike:

  • src/main/java: your application code.
  • src/test/java: your tests.
  • src/main/resources: configuration files such as application.properties.
  • target: output of the build, like the packaged JAR. You do not edit it and you do not commit it.

Remember

main code in src/main/java, tests in src/test/java.

Key terms

Practice this question in Repaso