Category: Interview Questions
How do you get sources Jars from Maven Repository?
To get sources Jars and Java docs from Maven Repository you need to execute below Goals: In case you have lot of dependencies, you can…
Java main method
public static void main (String[] args) public public is access specifier which indicates that main() method can be called outside the class. static static methods…
What are the elements in POM that a profile can freely modify when specified in the POM?
Profile can modify following elements in POM repositories pluginRepositories dependencies plugins properties, modules reporting dependencyManagement distributionManagement
What are the uses of Maven Plugins?
Maven Plugins are used to Create jar file Create war file Compile code files Unit testing of code Create project documentation Create project reports
What is the sequence in which Maven searches for dependency libraries?
Following is the search pattern Search for dependency in the local repository, if not found, move to step 2 else do the further processing Search…
What would the command mvn clean do?
This command deletes the target directory with all the build data before starting the build process.
Where do you find the class files when you compile a Maven project?
You will find the class files ${basedir}/target/classes/.
List out what are the build phases in Maven
Following are the phases of Maven build lifecycle validate: validate the project and check if everything is correct and all necessary information is available. compile:…
Explain how you can exclude dependency?
By using the exclusion element, dependency can be excluded
List out the dependency scopes in Maven
The various dependency scopes used in Maven are Compile: It is the default scope, and it indicates what dependency is available in the classpath of…