1.
Plugins
2.
Build
3.
Properties
4.
Parent
Q 1 / 53
1.
`maven.test.ignore=TRUE`
2.
`maven.test.run=FALSE`
3.
`maven.test.skip=TRUE`
4.
`maven.verify.execute=FALSE`
Q 2 / 53
1.
modules/webModule
2.
modules/ejbModule
3.
modules/enterpriseModules
4.
modules/services
Q 3 / 53
1.
deliver
2.
site
3.
doc
4.
deploy
Q 4 / 53
1.
It builds your Maven project.
2.
It installs Maven on your computer.
3.
It updates Maven to the latest version.
4.
It print out your installed version of Maven.
Q 5 / 53
1.
pom
2.
maven
3.
jar
4.
project
Q 6 / 53
1.
src/code
2.
src/test/java
3.
src/main/java
4.
src/main/resources
Q 7 / 53
shell script mvn clean mvn package mvn verify mvn install
1.
`mvn clean istall package`
2.
`mvn package`
3.
`mvn clean install`
4.
Option 4
Q 8 / 53
1.
`dependency:tree`
2.
`dependency:properties`
3.
`dependency:evaluate`
4.
`dependency:analyze`
Q 9 / 53
1.
In the excluded element of the build section of the POM, list the plugin you do not want to run.
2.
Set the phase in the module to none.
3.
Set a value in the configuration of the plugin in the module to be excluded like this: TRUE.
4.
Do not specify the plugin in the module.
Q 10 / 53
1.
src/main/static
2.
src/main/web
3.
src/main/resources
4.
src/main/webapp
Q 11 / 53
1.
Compiler
2.
Surefire
3.
Versions
4.
Javadoc
Q 12 / 53
1.
`src/main/template/descriptor.xml`
2.
`src/main/resources/META-INF/maven/archetype-descriptor.xml`
3.
`src/main/archetype/descriptor.xml`
4.
`src/main/resources/META-INF/maven/maven-archetype.xml`
Q 13 / 53
1.
WAR
2.
all of these answers
3.
POM
4.
EAR
Q 14 / 53
1.
the dependency with the higher version
2.
the transitive dependency that comes from the dependency listed first in the pom.xml file
3.
the transitive dependency that comes from the dependency listed last in the pom.xml file
4.
the transitive dependency version of the artifact that is closest to your project
Q 15 / 53
1.
Replacements
2.
Proxies
3.
Mirrors
4.
LocalRepositories
Q 16 / 53
1.
Versions
2.
Surefire
3.
Target
4.
Compiler
Q 17 / 53
1.
`.m2/proxy.txt`
2.
`pom.xml`
3.
`proxy.xml`
4.
`settings.xml`
Q 18 / 53
1.
MAVEN_OPTS
2.
M2_HOME
3.
MAVEN_MEMORY
4.
PATH
Q 19 / 53
1.
It is not possible to do this.
2.
Implement the JUnit dependency and add a configuration that sets the parallel element to true.
3.
Specify the Maven Surefire Plugin and add a configuration that sets the parallel element to true.
4.
Move each test suite into a separate submodule.
Q 20 / 53
1.
Verify the dependencies defined in the POM file.
2.
Print out a report of your project's dependencies in a tree format.
3.
Download all the transitive dependencies.
4.
Prune unused dependencies from your dependency tree.
Q 21 / 53
1.
Maven runs only a single unit test by default.
2.
Use the -Dtest= flag and pass in the name of the test.
3.
Use a plugin that can specify the test you want to run.
4.
It is not possible to do this.
Q 22 / 53
1.
by explicitly calling the profiles using the -P flag
2.
based on environment variables
3.
all of these answers
4.
through Maven settings
Q 23 / 53
1.
The name of the artifact must also be specified in the command.
2.
The name of the remote repository must also be specified in the command.
3.
Deploying artifacts to a remote repository must be done manually.
4.
The deploy phase of the default Maven lifecycle comes after the install phase.
Q 24 / 53
1.
`${basedir}/src/main/resources`
2.
`${basedir}/src/main/java/resources`
3.
`${basedir}/resources`
4.
`${basedir}/src/main/properties`
Q 25 / 53
1.
Environment
2.
Properties
3.
Switch
4.
Profiles
Q 26 / 53
1.
The dependency is not required to compile the project, but is needed at runtime.
2.
The dependency is needed at compile time and at runtime, and must be packaged for distribution.
3.
The dependency is needed at compile time and at runtime, but does NOT need to be packaged for distribution.
4.
The dependency is required for compilation.
Q 27 / 53
1.
package
2.
install
3.
compile
4.
test
Q 28 / 53
1.
WAR
2.
JAR
3.
EAR
4.
POM
Q 29 / 53
> mvn archetype:generate -DgroupID=sample-maven-project -DartifactID=com.palmer.bethan.sample -Dversion=1.0.0 -DinteractiveMode=false
1.
It does nothing since no archetype has been specified
2.
It generates a new Maven archetype
3.
It generates a new Maven projet using the default Maven archetype
4.
It cleans and installs the sample-maven-project project
Q 30 / 53
1.
provided
2.
compile
3.
execution
4.
runtime
Q 31 / 53
1.
-U
2.
-J
3.
-X
4.
-S
Q 32 / 53
1.
tag
2.
scmMark
3.
developmentVersion
4.
releaseVersion
Q 33 / 53
1.
reporting
2.
servers
3.
dependencies
4.
distribution management
Q 34 / 53
1.
It removes the target directory
2.
It updates the version of the plugins defined in the POM file.
3.
It removes unused dependencies in your project
4.
It builds your project
Q 35 / 53
1.
install
2.
test
3.
compile
4.
package
Q 36 / 53
<configuration> <archive> <manifest> <addClasspath>true</addClasspath> <mainClass>com.palmer.bethan.App</mainClass> </manifest> </archive> </configuration>
1.
Maven will generate javadocs for the App class.
2.
Maven will generate an executable JAR, which can be used to run the App class.
3.
Maven will include only the App class when it compiles the source code.
4.
Maven will add an empty main method to the App class.
Q 37 / 53
1.
<project.build.resources>
2.
<maven.compiler.source>
3.
<project.build.sourceEncoding>
4.
<project.compiler.encoding>
Q 38 / 53
1.
If you include these elements, an error will be thrown when you try to build the project.
2.
These elements are inherited from the parent POM file, and do not need to be repeated.
3.
Child POM files should include definitions of only dependencies and plugins.
4.
The values in the parent POM will be overridden by what is defined in the child POM.
Q 39 / 53
1.
`${maven.home}/${user.name}/settings.xml`
2.
`${user.home}/.m2/settings.xml`
3.
`${maven.home}/conf/settings.xml`
4.
`${user.home}/maven/settings.xml`
Q 40 / 53
1.
Create an internal corporate repository to store copies of the necessary artifacts.
2.
It is not possible to do this.
3.
When defining the dependency, set the scope to provided.
4.
Each developer should define the dependency in the POM file in the local copy of the project.
Q 41 / 53
1.
all of these answers
2.
dependencies
3.
groupId
4.
version
Q 42 / 53
![q43](q43.png)
1.
The Checkstyle Plugin does not work on child modules.
2.
Each Checkstyle report is in the target/site folder of the respective module.
3.
All links in Checkstyle reports must be specified in the plugin definition.
4.
Checkstyle reports for child modules have to be behind a firewall.
Q 43 / 53
1.
Fatjar
2.
Shade
3.
Dependency
4.
Package
Q 44 / 53
1.
Test
2.
Compile
3.
Runtime
4.
Build
Q 45 / 53
1.
one
2.
two
3.
none
4.
three
Q 46 / 53
1.
Properties provide a template for you to build Maven projects with a certain structure.
2.
Properties allow you to inherit values from the parent POM in the child POM.
3.
You can avoid hard-coding values in multiple places.
4.
Properties speed up your Maven build.
Q 47 / 53
1.
pre-clean,clean and post-clean
2.
Compile, clean and install
3.
clean and install
4.
validate, clean and deploy
Q 48 / 53
1.
Transitive
2.
runtime
3.
provided
4.
test
Q 49 / 53
1. [stackoverflow](https://stackoverflow.com/a/40601037) 2. [maven docs](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#a-build-lifecycle-is-made-up-of-phases)
1.
to check the parent POM file defines all of the child POM files
2.
to carry out checks before building the project
3.
to ensure plugins defined in the POM file are in the correct order
4.
to check the project structure is correct after building a project
Q 50 / 53
1. [baeldung](https://www.baeldung.com/maven-unused-dependencies) 2. [stackoverflow](https://stackoverflow.com/a/1518661)
1.
Run mvn clean and look at which plugins are not mentioned in the output.
2.
You will need to do this manually.
3.
Include the Maven dependency plugin in your POM file and run the unpack goal.
4.
Run the analyze goal of the dependency plugin.
Q 51 / 53
1.
Keeping the default structure reduces onboarding time, because developers recognize it.
2.
Overriding the default structure is very complex.
3.
Overriding the default structure will cause Maven to take longer to compile your code.
4.
all of these answers
Q 52 / 53
1.
to compile the source code of the project
2.
to install all of the remote dependencies
3.
to deploy the final project artifacts into a remote Maven repository
4.
to copy the final project artifacts into the local Maven repository
Q 53 / 53