Prev Next

DevOps / Maven Interview questions

How to run a single test method using maven.

junit 4.x provides support for running specific test methods. You must use the following syntax by specifying the test class and method name. This also accepts patterns for method names.

mvn -Dtest=TestClass#mytest test

you may also select multiple methods using the below syntax.

mvn -Dtest=TestClass#testMOne+testMTwo test

More Related questions...

What are the minimum requirements for a POM? What is Apache Maven? How do you rename a maven project? Explain dependency:copy-dependencies goal. maven repository central. Maven artifact. Build phases in Maven. MOJO. Explain the highlevel directory structure of a maven project. What jar:jar goal does? Types of maven repository. Can we use different name for POM.xml? How do I skip the tests? How can I run a single unit test? Maven plugin. POM. Different types of dependency scope. What makes a fully qualified name for the artifact? what uniquely identifies an artifact? Maven Repository. Why Maven is used? Where do we find .class files of a Maven project? Super POM. Transitive Dependency. What is Maven's order of inheritance? How do I find the Installed maven Version? Difference between compile and install. Find details on the dependencies for the project. What is a Maven project's fully qualified artifact name? Order by which Maven searches for the dependency. groupId. artifactId. Maven snapshot. Explain the difference phases in Maven build Lifecycle. How do I specify packaging/distributable format in Maven? How Maven searches for dependency JAR? Explain how Maven uses Convention over Configuration? How to run unit tests using Maven? How do I run a Single Test using Maven? How to run a single test method using maven. Difference between Gradle and Maven. How do I install a 3rd party jar into the Maven repository? Explain the advantages of using Maven. Drawbacks of using Maven. What is a Maven BOM file? What is the purpose of dependency-reduced-pom.xml generated by the shade plugin?
Show more question and Answers...


Comments & Discussions