diff --git a/maven/maven-quiz.md b/maven/maven-quiz.md index c8e550343e..6dada74490 100644 --- a/maven/maven-quiz.md +++ b/maven/maven-quiz.md @@ -14,8 +14,8 @@ Maven Assessment - `maven.verify.execute=FALSE` #### Q3. When building a Maven EAR project and specifying the configuration of which projects to include, what is the element in the plugin configuration that contains Enterprise Java Bean projects? -- modules/webModules -- modules/ejbModules +- modules/webModule +- modules/ejbModule - modules/enterpriseModules - modules/services @@ -96,3 +96,75 @@ mvn install - the transitive dependency that comes from the dependency listed first in the pom.xml file - the transitive dependency that comes from the dependency listed last in the pom.xml file - the transitive dependency version of the artifact that is closest to your project + +#### Q16. Many organizations set up local mirrors to the Maven central repository. In order to leverage your company's Maven repository as a proxy for the Maven central repository, which element should you put into the settings.xml file? +- Replacements +- Proxies +- Mirrors +- LocalRepositories + +#### Q17. Which Maven plugin would you leverage to specify the version of the compiler to target as well as the source level of the language? +- Versions +- Surefire +- Target +- Compiler + +#### Q18. If your machine is behind a proxy, where should you specify the proxy server settings in order for Maven to access remote resources? +- .m2/proxy.txt +- pom.xml +- proxy.xml +- settings.xml + +#### Q19. What environment variable can you alter to increase the memory Maven uses? +- MAVEN_OPTS +- M2_HOME +- MAVEN_MEMORY +- PATH + +#### Q20. How can you use Maven to run unit tests in parallel? +- It is not possible to do this. +- Implement the JUnit dependency and add a configuration that sets the parallel element to true. +- Specify the Maven Surefire Plugin and add a configuration that sets the parallel element to true. +- Move each test suite into a separate submodule. + +#### Q21. What will the mvn dependency:tree command do? +- Verify the dependencies defined in the POM file. +- Print out a report of your project's dependencies in a tree format. +- Download all the transitive dependencies. +- Prune unused dependencies from your dependency tree. + +#### Q22. How do you run a single unit test in Maven? +- Maven runs only a single unit test by default. +- Use the -Dtest= flag and pass in the name of the test. +- Use a plugin that can specify the test you want to run. +- It is not possible to do this. + +#### Q23. How can Maven profiles be triggered? +- by explicitly calling the profiles using the -P flag +- based on environment variables +- all of these answers +- through Maven settings + +#### Q24. Why will an mvn install command not deploy any artifacts to a remote repository? +- The name of the artifact must also be specified in the command. +- The name of the remote repository must also be specified in the command. +- Deploying artifacts to a remote repository must be done manually. +- The deploy phase of the default Maven lifecycle comes after the install phase. + +#### Q25. Suppose you want to include a properties file in the JAR generated by your Maven build. What directory should you put it in? +- ${basedir}/src/main/resources +- ${basedir}/src/main/java/resources +- ${basedir}/resources +- ${basedir}/src/main/properties + +#### Q26. Which structure in a settings.xml file allows for flexing properties based on some value for the runtime of Maven? +- Environment +- Properties +- Switch +- Profiles + +#### Q27. What does it mean if the scope of a dependency is runtime? +- The dependency is not required to compile the project, but is needed at runtime. +- The dependency is needed at compile time and at runtime, and must be packaged for distribution. +- The dependency is needed at compile time and at runtime, but does NOT need to be packaged for distribution. +- The dependency is required for compilation.