You are currently viewing maven linkedin assessment answers
maven linkedin assessment answers_theanswershome

maven linkedin assessment answers

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

  • versioning
  • builds
  • project structure
  • source code style

2. What is a valid packaging type for a Maven project?

  • all of these answers
  • WAR
  • EAR
  • POM

3. What are the artifacts that Apache Maven uses to perform its build operations?

  • ant files
  • properties
  • dependencies
  • plugins

4. There are two general uses of plugins. The first is build and the second is _____ .

  • distribution management
  • servers
  • dependencies
  • reporting

5. What will the mun dependency: tree command do?

  • Prune unused dependencies from your dependency tree.
  • Download all the transitive dependencies.
  • Verify the dependencies defined in the POM file.
  • Print out a report of your project’s dependencies in a tree format.

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

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

7. Below is a section of a settings.ml file. How can you use the path to the app home in our POM file?

  • $ {set-app-home}
  • $ {activeProfile}
  • $ {/path/to/application}
  • $ {application-home}

8. How do you check for unused dependencies in your project?

  • Run mvn clean and look at which plugins are not mentioned in the output.
  • Run the analyze goal of the dependency plugin.
  • Include the Maven dependency plugin in your POM file and run the unpack goal.
  • You will need to do this manually.

9. Why is it best practice to avoid overriding the default directory structure?

  • Overriding the default structure is very complex.
  • Keeping the default structure reduces onboarding time, because developers recognize it.
  • Overriding the default structure will cause Maven to take longer to compile your code.
  • all of these answers

10. Why is it best practice not to release SNAPSHOT versions of Maven artifacts to production?

  • A release marked with SNAPSHOT indicates that not all of the tests have passed.
  • A release marked with SNAPSHOT may contain sensitive security information.
  • A SNAPSHOT can be hard to reproduce, making it difficult to determine the cause of an issue.
  • SNAPSHOT releases do not contain any dependencies.

11. Suppose you are packaging a Maven project and see the following error: "[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!" What do you add to your POM file to set the platform encoding to ensure your build is not platform dependent?

  • <project.build.resources>
  • <maven. compiler.source>
  • <project.compiler.encoding>
  • <project.build. sourceEncoding>

12. How can Maven profiles be triggered?

  • through Maven settings
  • based on environment variables
  • by explicitly calling the profiles using the -P flag
  • all of these answers

13. What is the default location of the local Maven repository?

  • /repo
  • USER HOME/maven/repository
  • USER HOME/.m2/local
  • USER HOME/.m2/repository

14. What does the following command do?

  • It generates a new Maven archetype.
  • It generates a new Maven project using the default Maven archetype.
  • It does nothing since no archetype has been specified
  • It cleans and installs the sample-maven-project project.

15. Below is an SCM configuration in a POM file. What does the developerConnection element tell Maven to do?

  • fetch changes via the HTTP protocol and push changes via SSH
  • fetch changes at the start of every build and push changes at the end of every build
  • push changes at the end of every build
  • fetch changes at the start of every build

Leave a Reply