Automating Project Builds and Running Tests with Maven Quiz Quiz

  1. Maven Build Lifecycle

    Which Maven lifecycle phase is responsible for compiling the project's source code?

    1. compile
    2. test-compile
    3. verify
    4. initialize
    5. compilee
  2. Running Unit Tests

    What Maven command is used to run unit tests in a project?

    1. mvn test
    2. mvn unittest
    3. mvn verify-tests
    4. mvn tets
    5. mvn check
  3. Skipping Tests

    Which Maven command disables running tests during the build process?

    1. mvn install -DskipTests
    2. mvn install --notest
    3. mvn install -skipTests
    4. mvn install -DskippTests
    5. mvn install -DtestSkip
  4. Testing Plugin

    Which Maven plugin is primarily responsible for running tests written using JUnit?

    1. maven-surefire-plugin
    2. maven-junit-plugin
    3. maven-compiler-plugin
    4. maven-failsafe-plugin
    5. maven-surfier-plugin
  5. Project Object Model

    What is the default name of the file where Maven build configuration is stored?

    1. pom.xml
    2. build.gradle
    3. pomx.xml
    4. proj.xml
    5. poml.xml
  6. Integration Tests

    Which Maven command runs integration tests and verifies the outcome?

    1. mvn verify
    2. mvn integtest
    3. mvn integration
    4. mvn checkit
    5. mvn test-verify
  7. Build Output

    By default, in which directory does Maven place compiled Java .class files during the build?

    1. target/classes
    2. output/classes
    3. build/output
    4. target/classess
    5. bin/classes
  8. Specifying a Test Class

    Which CLI option lets you run a specific test class using Maven?

    1. -Dtest=ClassName
    2. --test ClassName
    3. -test ClassName
    4. -Dtests=ClassName
    5. -runtest ClassName
  9. Adding a Plugin

    Where in the pom.xml file should you declare build plugins?

    1. Within the u003Cbuildu003Eu003Cpluginsu003E section
    2. Inside u003CdependencyManagementu003E
    3. In the u003Cprofilesu003E tag
    4. Under u003Crepositoriesu003E
    5. In the u003Cpropertiesu003E block
  10. Maven Clean Phase

    What does the Maven clean phase do when you run 'mvn clean'?

    1. Deletes the target directory
    2. Removes unused dependencies
    3. Cleans all Java code of errors
    4. Clears your repository cache
    5. Resets the pom.xml file