linkedin-skill-assessments-quizzes

Maven

Q1. What element in the pom.xml file allows you to provide values that can be reused in other elements of the pom.xml?

Q2. If you wish to build and package your artifact using the Maven package goal but don’t want to execute the unit tests, which environment variable and value would you use?

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?

Q4. The goal that is executed to generate and deploy a documentation website is _.

Q5. What does the mvn -version command do?

Q6. There are several properties available for use in a pom.xml file that refer to details of the project, such as groupId and version. What do all of these properties start with?

Q7. What directory structure contains the source code of your artifact?

Q8. Which command is used to run the clean lifecycle followed by verify, install, and package with Maven?

Q9. Which goal would you use with the Dependency plugin to determine which included dependencies are not used, as well as those you are using that you have not defined?

Q10. In a multimodule project, if you have a plugin bound to a phase in the parent, it will be bound to the same phase in the module. What strategy could you employ to prevent the plugin from executing in the module?

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

Q12. When performing a build, which Maven plugin will allow you to set the specific version of the artifact to be built without manual modifying the pom.xml file?

Q13. When building a Maven Archetype, what is the filepath and file of the archetype descriptor that specifies how to lay out the prototype files?

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

Q15. When two dependencies of your Maven project introduce the same transitive dependency with different versions, which one(s) will be included in the dependency list for 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?

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?

Q18. If your machine is behind a proxy, where should you specify the proxy server settings in order for Maven to access remote resources?

Q19. What environment variable can you alter to increase the memory Maven uses?

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

Q21. What will the mvn dependency:tree command do?

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

Q23. How can Maven profiles be triggered?

Q24. Why will an mvn install command not deploy any artifacts to a remote repository?

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

Q26. Which structure in a settings.xml file allows for flexing properties based on some value for the runtime of Maven?

Q27. What does it mean if the scope of a dependency is runtime?

Q28. If you want to utilize a locally developed JAR file in another project and that JAR file has not been deployed to either the Maven central repository or your own locally sourced mirror repository, what Maven goal do you need to execute on the locally developed JAR project?

Q29. What is the default packaging type for a Maven project build artifact?

Q30. What does the following command do?

mvn archetype:generate
-DgroupID=sample-maven-project
-DartifactID=com.palmer.bethan.sample
-Dversion=1.0.0
-DinteractiveMode=false

Q31. When defining a dependency that is included with the runtime container, what scope do you use in the pom.xml?

Q32. What argument do you pass to Maven in order to update SNAPSHOT from the remote repository?

Q33. When performing a release using the Maven release plugin, which environment variable for batch mode is used to define the stamp placed in SCM to indicate the state of the artifact for the actual release?

Q34. These are two general uses of plugins. The first is build and the second is _

Q35. What does the mvn clean command do?

Q36. Bellow is a definition of the Maven JAR Plugin, where the main class is set to com.palmer.bethan.App. What is the effect of this?

<configuration>
    <archive>
        <manifest>
            <addClasspath>true</addClasspath>
            <mainClass>com.palmer.bethan.App</mainClass>
        </manifest>
    </archive>
</configuration>

Q37. 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?

Q38. Why might you not want to include groupId and version elements in child POM files?

maven docs

Q39. The settings.xml file that provides the user-specific settings for Maven is contained in which directory by default?

Q40. Suppose you are using Maven in a corporate environment and, to save bandwidth, you want to prevent the need for large numbers of developers to download the same dependency from the internet. What do you do to limit this?

Q41. In multimodule projects, what do child POMs inherit from the parent POM?

q43

Q43. Which build plugin allows you to create a “fat” JAR file that contains all of the dependencies in the final JAR file?

Q44. What is the default scope for Maven dependencies?

Q45. How many times is compiler:compile called when executing mvn clean compile test package?

Q46. What is one of the advantages of using properties in Maven?

Q47. What are the phases of the clean lifecycle?

Q48. A compile-time dependency of a dependency for your project is often called a_ dependency.

Q49. For what purpose can plugins use the validate phase in the default lifecycle?

  1. stackoverflow
  2. maven docs

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

  1. baeldung
  2. stackoverflow

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

maven docs

Q52. What is the main purpose of the install phase?

maven docs

Q53. How do you skip the tests when running a mvn package command?

Q54. Below is a section of a settings.xml file. How can you use the path to the app home in your POM file?

<profiles>
    <profile>
        <id>set=app-home</id>
        <properties>maven-people-plugin</artifactId>
            <application-home>/path/to/application</application-home>
        </properties>
    </profile>
</profiles>
<activeProfiles>
    <activeProfile>set-app-home</activeProfile>
</activeProfiles>

Q55. What is the default value of the warSourceDirectory configuration property of the Maven WAR Plugin?

Q56. When building a Maven Archetype, where do you put your prototype files?

Q57. The primary purpose of Apache Maven is to provide uniform, easy, and standardized _.

Q58. Below is the definition of a mirror in settings.xml. What does the element <mirrorOf>\*</mirrorOf> tell Maven to do?

<mirror>
    <id>internal-repo</id>
    <url>http://repo.mycompany.com/proxy</url>
    <mirrorOf>\*</mirrorOf>
</mirror>

Q59. How do you generate a site for a project with Maven?

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

Q61. A phase is a step in _.

maven docs

Q62. What is the Maven central repository?

!reference

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

!reference

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

!reference

Q65. What is a module in a Maven project?

!reference

Q66. What does the mvn --version command do?

!reference

Q67. When building a Maven project, where are Maven dependencies stored?

!reference

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

!reference

Q69. Why do you use Maven Wrapper on a project shared with a large team of developers?

Q70. This POM file contains an XML validation error. What is the cause of the error?

q70

Q71. Below is the configuration for a server on settings.xml. What does this configuration do?

q71

Q72. Below is the build element of a parent POM file. Why might the resources not get copied when executing the plugin on a child project?

5d697fe5498e21bcd2763c2a-1567198471328

maven docs

Q73. This image shows a POM file with a profile. When will this profile be activated?

img

Q74. What command can you use to run the goal of the compiler plugin?

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

!reference