Challenge - 5 Problems
Maven Build Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding Maven Build Phases
Which Maven build phase is responsible for compiling the source code of a project?
Attempts:
2 left
💡 Hint
Think about when the source code is turned into bytecode.
✗ Incorrect
The compile phase compiles the source code of the project. Other phases like test run tests, package creates the distributable, and install puts the package into the local repository.
❓ Predict Output
intermediate1:30remaining
Maven Default Lifecycle Execution Result
What will be the final output directory after running
mvn package on a standard Maven project?Attempts:
2 left
💡 Hint
Where does Maven put the packaged jar or war file?
✗ Incorrect
Running mvn package compiles and packages the project, placing the output (like jar or war) in the target directory.
❓ assertion
advanced2:00remaining
Correct Assertion for Maven Build Success
Which assertion correctly verifies that a Maven build executed successfully in a Java Selenium test using ProcessBuilder?
Selenium Java
ProcessBuilder builder = new ProcessBuilder("mvn", "clean", "install"); Process process = builder.start(); int exitCode = process.waitFor();
Attempts:
2 left
💡 Hint
A successful Maven build returns exit code zero.
✗ Incorrect
Maven returns 0 on success. The assertion assertEquals(0, exitCode); confirms the build succeeded.
🔧 Debug
advanced2:00remaining
Debugging Maven Build Failure
Given the Maven command
mvn clean install fails with a test failure, which option best describes the cause?Attempts:
2 left
💡 Hint
Test failures stop the build during the test phase.
✗ Incorrect
If tests fail, Maven stops the build during the test phase, causing mvn clean install to fail.
❓ framework
expert2:30remaining
Integrating Maven with Selenium Tests
Which Maven plugin configuration is required to run Selenium WebDriver tests during the Maven test phase?
Attempts:
2 left
💡 Hint
Which plugin runs tests during the test phase?
✗ Incorrect
The maven-surefire-plugin runs unit and integration tests during the test phase, including Selenium WebDriver tests.