Skip to content

Latest commit

 

History

History
101 lines (71 loc) · 3.54 KB

Maven.md

File metadata and controls

101 lines (71 loc) · 3.54 KB

Question List

1.] The primary purpose of Apache Maven is to provide uniform, easy, and standardized ___ .

  1. project structure
  2. builds
  3. source code style
  4. versioning

2.] When building a web application with WAR type project, which project directory should contain the style sheet, JavaScript, and other static files?

  1. src/main/resources
  2. src/main/webapp
  3. src/main/web
  4. src/main/static

3.] When building a Maven EAR project and specifying the configuration of which project to include,what is the element in the plugin configuration that contains Enterprise Java Beans projects?

  1. modules/services
  2. modules/enterpriseModules
  3. modules/webModule
  4. modules/ejbModule

4.] Which plugin is used to copy, filter, include, and exclude non-Java files into your final project?

  1. Files
  2. Resources
  3. Copy
  4. Build

5.] Many organizations set up local mirrors to the Maven central repository. In order to leverage your company's Maven repository as a proxy for a Maven central repository, which element should you put into the setting.xml?

  1. LocalRepositories
  2. Mirrors
  3. Proxies
  4. Replacements

6.] What will the mvn dependency:tree command do?

  1. Verify the dependencies defined in the POM file.
  2. Print out a report of your project's dependencies in a tree format.
  3. Prune unused dependencies from your dependency tree.
  4. Download all the transitive dependencies.

7.] Which argument do you pass to Maven in order to update SNAPSHOTs from the remote repository?

  1. -X
  2. -s
  3. -U
  4. -J

8.] In order to leverage a single execution of an Apache Maven goal on a multimodule project, from which directory should you execute the goal?

  1. the directory with the parent POM
  2. the module directory
  3. the development directory
  4. the workspace directory

9.] How can Maven profiles be triggered?

  1. based on environment variables
  2. through Maven settings
  3. by explicitly calling the profiles using the -P flag
  4. all of these answers

10.] Suppose you want to include a properties file in the JAR generated by your Maven build. What directory should you put it?

  1. ${basedir}/src/main/properties
  2. ${basedir}/resources
  3. ${basedir}/src/main/java/resources
  4. ${basedir}/src/main/resources

11.] Why might you NOT want to include groupid and version elements in child POM files?

  1. The values in the parent POM will be overridden by what is define in child POM.
  2. Child POM files should include definitions of only dependencies and plugins.
  3. These elements are inherited from the parent POM file, and do not need to repeated.
  4. if you include these elements, an error will be thrown when you try to build the project.

12.] How can you use Maven to run unit tests in parallel?

  1. Move each test suits into a separate submodule.
  2. Specify the Maven Surefire Plugin and add a configuration that sets the parallel element to true.
  3. It is not possible to do this.
  4. Implement the JUnit dependency and add a configuration that sets the parallel element to true.

13.] Which Maven plugin would you leverage to specify the version of compiler to target as well as the source level of language?

  1. Target
  2. Compiler
  3. Surefire
  4. Versions

14.] How do you run a single unit test in Maven?

  1. Use a plugin that can specified the test you want to run.
  2. Maven runs only a single unit test by default.
  3. Use the -Dtest = flag and pass in the name of the test.
  4. It is not possible to do this.