Maven Notes
Maven Notes
• Apache Maven is an build tool mainly for Java applications to help the
developer at the whole process of a software project.
What Maven does ?
• Compilation of Source Code
• Running Tests (unit tests and functional tests)
• Packaging the results into JAR’s,WAR’s,RPM’s,etc..
• Upload the packages to remote repo’s (Nexus,Artifactory)
Maven as a Devops Tool
• Maven requires that you describe what your project is doing. To this end,
Maven offers lifecycles and individual phases that you can configure to tell
Maven what to do in these phases.
→ Validate,Compile,Test,Package,Integration test,Verify,Deploy
• Maven is ideally suited for running all your tests as part of your
normal build setup. You don’t need a customized environment for
different types of tests. Unit tests run by default, and integration tests
are specified as a phase in the Maven build (between the packaging
and the install phases). In this way, you can rely upon the previously
built package, which can output a WAR file. To run your integration
tests, you need to add and configure the dedicated plug-ins.
Maven component repositories
1. Verify that your system has java installed or not. if not then install java.
2. Check java Environmental variable is set or not. if not then set java
environmental variable.
3. Download maven.
4. Unpack your maven zip at any place in your system.
5. Add the bin directory of the created directory apache-maven-3.5.3(it
depends upon your installation version) to the PATH environment
variable and system variable.
6. open cmd and run mvn -v command. If it print following lines of code
then installation completed.
POM(Project Object Model)
• Project Object Model (POM) is an XML file that has all the information
regarding project and configuration details. The POM has the
description of the project, details regarding the versioning, and
configuration management of the project.
• The XML file is located in the project home directory. When you
execute a task, Maven searches for the POM in the current directory.
The Need for Maven
• Add or write the code to create the application creation, and process it into
the source code repository.
• Edit any necessary configuration / pom.XML / plugin details.
• Build the actual application.
• Save your build process output as either a WAR or EAR file to a local server
or other location.
• Access the file from the local location or server and deploy it to the
production or client site.
• Update the application document by changing the date and updated
application version number, if necessary.
• Create and generate a report as requested for the application or the
requirement.
Advantages of Maven
• Accenture
• JPMorgan Chase & Co
• Via Varejo
• craft base
• Red Hat
• Mitratech Holdings, Inc.
• KRG TECHNOLOGIES
• Radio - Canada
How to Install Maven on Windows
Step 3: Download Maven Zip File and Extract