Monday, May 6, 2019

Build And Release Interview In Java

Q- What is scope in maven dependency?
In maven dependency the scope attribute are used to specify the visibility of a dependency, relative to the different lifecycle phases (build, test, runtime etc).
There are six scopes in maven provides
compile
provided
runtime
test
system
import .

Q- What if scope is not defined properly in maven project?

Q-  What is groupId and artifactId?
In Maven groupId will identify our project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package name rules, what means that has to be at least as a domain name we control, and we can create as many subgroups as you want.
artifactId is the name of the jar without version.

Build And Release Engineer Interview Questions And Answers

Q- What is the differences between mvn clean package and mvn clean install?

While we use "mvn clean package". it will compile the code and package our application and put it in the target directory (by default).


While we use "mvn clean install". it will compile the code and package our application and put it in the target directory (by default).but it will also put the package in your local repository. So that other projects can refer to it and grab it from your local repository.

Q- How to create build in build using maven?

C:\MVN\project>mvn clean install
Or Using with profile
C:\MVN\project>mvn clean install -P UAT
Q- How to skip test cases in maven build?
We can also skip the test cases via the command line by executing the following command:
C:\MVN\project>mvn clean install -DskipTests

If you absolutely must, you can also use the maven.test.skip property to skip compiling the tests. maven.test.skip is honored by Surefire, Failsafe and the Compiler Plugin.
C:\MVN\project>mvn clean install -Dmaven.test.skip=true
Or
C:\MVN\project>mvn clean install -P UAT -Dmaven.test.skip=true

Q- What is Maven Surefire Plugin?
Maven Surefire Plugin: The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit test cases of an application. It will generates the report in two different formats

 Plain text files (*.txt) and XML files (*.xml).
By default, these files are generated in ${basedir}/target/surefire-reports/TEST-*.xml.
For More Details Refer https://maven.apache.org/surefire/maven-surefire-plugin/index.html

Q- What is Maven Classifier?

Q- What is maven phase and goal?
Answer: 
  • Each phase is a sequence of goals.
  • Each goal is responsible for a specific task.
  • When we run a phase – all goals bound to this phase are executed in order.
Q- How to change jar/war file name while craete a build in spring application?

<build>
    <finalName>${project.groupId}/${project.artifactId}-${baseVersion}</finalName>
</bulid>

Q- What is Maven profile?
Answer:
A profile is an alternative set of configuration for different environment values which set or override default values. By Using a profile like UAT, SIT, DEV, Prod.
We can customize a build for different environments.
Then we can run Maven with a command-line to execute goals in a specific profile.
Maven command to build with profile
C:\MVN\project>mvn clean install -P UAT

Where UAT is UAT environment and use properties from src/main/resources/profile/UAT/environments.properties  

Q- What are the three builds in Maven lifecycle?
Answer: 
  • Clean Lifecycle
  • Default Lifecycle
  • Site Lifecycle
Q- What is maven lifecycle? Or Maven build lifecycle?



Refer: Introduction to the Build Lifecycle

Q- What is the difference between unit testing and integration testing?

Unit Testing:
  • Unit testing is used to checks a particular (single) component or module of an application.
  • Unit tests should not depend on code outside the unit tested.
  • Unit testing is useful to test small pieces of code, typically individual functions in a component or module, alone and isolated.
  • If your test uses some external resource, like the network or a database, it’s not a unit test.
  • A unit tests should essentially just give the function that’s tested some inputs, and then check what the function outputs is correct.
  • Unit testing is the only testing method which also helps you write better code
  • Unit tests should be simple to write. 
Integration Testing:
  • Integration testing is useful to check that different modules are working together correctly.
  • Integration tests are similar to unit tests, but there’s one big difference, while unit tests are isolated from other components, integration tests are not.
  • Integration testing the idea is to test how parts of the system work together
Functional Testing:
  • Functional testing is defined as the testing of complete functionality of any application.
  • Functional testing is also sometimes called E2E testing, or browser testing. 
  • Functional testing with web apps, we can use some tool to automate a browser, which is then used to click around on the pages to test the application.
Non- Functional Testing:
  • Availability Testing.
  • Compatibility Testing.
  • Configuration Testing.
  • Load Testing.
  • Recovery Testing.
Q- What is Mvn clean install?
Q- What does Mvn clean package do?
Q- How do I exclude test cases in Maven?
Q- What is Maven and how it works?
Q- What is .m2 folder in Maven? and Where is the m2 folder?
Q- How do I find my maven path?
Q- What is artifactId in POM XML?
Q- What is the difference between groupId and artifactId in Maven?
Q- What is Maven repository?
Q- What is Maven local repository?
Q- What is Maven central repository?
Q- What is the default Maven repository?
Q- What is Maven site?
Q- What does MVN site do?
Q- What is Mojo in Maven?
Q- What is Codehaus mojo?
Q- What is exec Maven plugin?
Q- What is Maven Jar plugin?
Q- What is Maven war plugin?
Q- What is Maven compiler?
Q- What is exclusions in POM XML?
Q- What is Maven optional dependency?
Q- What is the default scope for a dependency in Maven?
Q- Does maven require JDK?
Q- What is source and target in maven compiler?
Q- What is a Maven dependency?
Q- What are Archetypes in Maven?
Q- What is difference between plugin and dependency in Maven?
Q- What is the purpose of settings XML in Maven?
Q- Which option stands for Super POM in Maven?
Q- What is spring boot starter parent?
Q- What is Maven in spring?
Q- What is parent child relationship in maven project?
Q- What is parent tag in Pom?
Q- What is parent POM and child pom?
Q- Can a pom have multiple parents?
Q- What is POM packaging in Maven?
Q- How do you skip a test?
Q- Which command is used for skipping the test?
Q- Which command is used for skipping the test in Maven?
Q- How do I run a maven test in debug mode?
Q- Is it mandatory to have at least one goal associated with a build phase?
Q- What are the types of Maven repository?
Q- Which option stands for Super POM in Maven?
Q- How do I debug a Maven plugin?
Q- How do you debug a JUnit test?
Q- What is Maven failsafe plugin?
Q- What is Maven mirror?
Q- What is the difference between Maven build and Maven install?
Q- What is Maven build goals?
Q- What is pluginManagement in Maven?
Q- What is Maven build command?
Q- How does maven deploy work?
Q- How do I run a maven test in debug mode?
Q- What is the difference between Ant and Maven?
Q- What is the difference between Gradle and Maven?

No comments:

Post a Comment