Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
868 views
by The go-to Tester (222 points)
I am new to Java and Maven. Can u explain what is Maven all about and what is dependency?

2 Answers

1 like 0 dislike
by The go-to Tester (448 points)
selected by
 
Best answer

As per the test automation services Apache Maven is a Software project management and comprehension tool. It is based on the concept of a project object model (POM).Maven can perform many operations like manage a project's build, reporting and documentation from a central piece of information.

Maven provides developers a complete build lifecycle framework. Development team can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.
Maven provides developers ways to manage following:
• Builds
• Documentation
• Reporting
• Dependencies
• SCMs
• Releases
• Distribution
• Mailing list

Maven Dependency:
Maven's dependency-handling mechanism is organized around a coordinate system identifying individual artifacts such as software libraries or modules.Dependency management is one of the features of Maven that is best known to users. Through the local repository,projects developed on a single machine can depend on each other . The local repository acts both as a cache for downloaded dependencies and as it is a centralized location for locally built artifacts.

For a single project, it is not difficult to manage dependencies but for handling a project with multiple modules Maven is capable enough for maintaining control and stability.
Section for maven dependency is a mechanism for centralizing dependency information. For a set of projects that inherits a common parent, it's promising to put all information about
the dependency in one common POM and have references to artifacts in the child POMs.

 

by The go-to Tester (222 points)
Hi Rajeev,

Thank you for posting the answer. Kindly specify the source.

Thank you
by The go-to Tester (448 points)
The Maven Source Plugin creates a jar archive of the source files of project. By default, this jar file is created in the target directory of the project.
The Maven Source Plugin have 5 goals:

1. source:aggregate :The aggregates sources are for all modules in an aggregator project.
2. source:jar: This is used to bundle the main sources of project into a jar archive.
3. source:test-jar: It is used to bundle the test sources of the project into a jar archive.
4. source:jar-no-fork : This is similar to jar but does not fork the build lifecycle.
5. source:test-jar-no-fork :This is similar to test-jar but does not fork the build lifecycle.

POM Syntax For Maven Source Plugin:
    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
0 like 0 dislike
by

What is maven?

Maven is a project management tool. It will help you define project structure and define group ID, artifact name, your CI URL and many more things about the project you can include into Maven.

Most of the time we use maven to manage the dependencies.

So, when you use Maven, it will put all your dependency into the central location and all your projects will use dependency from there. It will ultimately reduce your project size.

Say, you have the project where you are using Selenium and Cucumber dependency
your project size will be around 25 MB.

If you use Maven, all you need is just one pom.xml file and inside pom.xml file you can define your Selenium and Cucumber dependency. So, maven will automatically download it and add it to your build path.

So, your project size will be reduced to some KBs like approx 500 KBs.
Also, updating and managing dependencies will be easy with maven.

What is the dependency?
Dependencies are set of the JAR files that are required by your project


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...