click below
click below
Normal Size Small Size show me how
Maven
Question | Answer |
---|---|
Which contains information to project a configuration information to build the project. | pom.xml |
I. If the project needs to have quick documentation, compiling and packaging of source code into JAR/ZIP files. II. If the project requires a huge amount of dependencies. III. If the version of dependencies requires a frequent up-gradation. | I, II, III |
In which directory a jar file will be created in the project? | project/target |
Which command is used to compile the maven project? | mvn compile |
Which command is used to create a simple Project using Maven? | archetype:generate |
What are the responsibilities of a build tool? I. Generate source code | All of the above |
What are the responsibilities of a build tool? II. Create documentation from the source code generated. | |
What are the responsibilities of a build tool? III. Compiles the source code | |
What are the responsibilities of a build tool? IV. Packages the compiled code into JAR of ZIP file. | |
What are the responsibilities of a build tool? V. Install the packaged code into Local repository, Server repository and Central repository. | |
Do we need Java to execute Maven? | TRUE Explanation : We need Java to execute maven. Java should be installed to set JAVA_HOME environment variable to point to a valid Java SDK(Like Java 8) |
Select the build tool? | Maven Apache Spark Apache Ant |
What does a valid POM file have? | group identifier, artifact and version |
Which is the correct way of defining the maven coordinates? | groupId:artifactId:packaging:version Explanation : Through which will express the dependencies of a project in POM file. |
Which of the following is not the main coordinates used in maven? | Group Name |
Files with ____ produces a web application. | WAR |
A project with packaging set to ____ will give Java file. | JAR |
Can we inherit Group id and version from parent POM file? | true |
_____ identifies uniquely a project, a dependency or a plugin defined in POM. | Maven Coordinates |
Which command is used to invoke clean lifecycle? | mvn post-clean |
Which are lifecycle goals in maven? | validate: check if all information necessary for the build is available compile: compile the source code deploy: copy the package to the remote repository |
___ is a Maven plugin used to create a project structure as per its template. | Archetype |
In which order does the file gets executed in maven? | Clean-dependency-package |
How is the order of execution decided in maven? | It depends on the order of which goals and phases invoked. |
____ command is used to compile the project’s source code. | mvn compile |
Which is the standard lifecycle followed in maven? I. clean II. default(or build) III. site | All the above |
____ phase is used to deploy the generated site documents to the specified web server in lifecycle. | site deploy |
Which command is used to create a new project based on Archetype? | mvn archetype:generate |
Which are commonly used requirement of a POM? | Project root Model version groupId |
Where does pom.xml file reside? | project's root-folder |
Which attribute are used to uniquely identify the project in repository? | Explanation : These attributes need to decided before creating a POM to identify the project. groupId artifactId version |
Which command is used to view the default configuration of super POM? | mvn help:effective-pom Explanation : By running this command, we can view the default configuration of super POM. |
Which resides in the base directory of the project as pom.xml file? | POM |
State True or False: All POMs inherited from Super POM. | true |
A project should have ____ to compile, build, test and run , which is collectively present in pom.xml file. | dependency |
In which repository does all the materials related to your project will be stored? | Local repository - present in developer's machine. |
Does maven throw an error if dependency is not found in all three repositories? | true maven will stop processing and throws an error if dependency is not found. |
_____ is used to downloads the dependencies, When there is a need and which was not there in local repository. | Central repository - present in maven community. Explanation : which is the default location for maven to download all the project dependency libraries. |
___ files will be installed in local repository by running mvn install command. | jar |
___ repository is used when maven needs to download the dependencies. | Remote repository - present in web server. Explanation : It is same as central repository. If we want anything from remote repository, have to download the required file from local repository. |
Which is the correct format of dependencies in pom.xml file? | <dependency> <groupId>........</groupId> <artifactId>........</artifactId> <version>.......</version> </dependency> |
How many repositories are there in maven? | 3 |
In which folder does maven store all the project jar files or dependencies by default. | .m2 |
In which order does maven search for the dependencies? | local repository -> central repository -> remote repository |
Maven dependencies - When installing dependencies from the pom.xml file, Maven first looks in the central Maven repository, then in the local repository in your .m2 folder | false Maven first looks at the local repository, then in the central repo if the dependency is not found locally |
What does the pom.xml do? | declares metadata about the project, including project coordinates, dependencies, and plugins |