Read the log: the build fails before any test runs
QuizMediumAsked in: Capgemini, Google, Salesforce, TCS, Zupee
A new CI agent (a machine that runs the build) with a recent JDK (the Java development kit) fails at once.
console.log
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ ui-tests --- [INFO] Compiling 42 source files to /home/jenkins/workspace/ui-tests/target/test-classes [ERROR] COMPILATION ERROR : [ERROR] Source option 5 is no longer supported. Use 8 or later. [ERROR] Target option 5 is no longer supported. Use 8 or later. [INFO] BUILD FAILURE
What is the cause?
- The build uses an old compiler plugin default (Java 5 source and target); set the Java release in the pom (for example maven.compiler.release 21) and a current maven-compiler-plugin version
- A test assertion failed
- The agent has no internet connection
- The tests must be renamed to end with Test
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.