Devops Lab p5
Devops Lab p5
Create a Maven Project, Understanding the POM File, Dependency Management and
Plugins.
1. Prerequisites required
● Java JDK (version 21 preferable) must be installed.
java -version
->apache-maven-3.9.6-bin.zip
❌ Do NOT Download:
After Downloading:
1. Extract the zip file to a location like:
C:\Program Files\Apache\Maven\apache-maven-3.9.6
OR
-> After the Execution the above cmd on the command prompt, the project structure looks like
below.
1.
Step 4: Add a Dependency
-> Step 4 : Go to the demo-project folder and understand the usage of pom.xml file.
-> Add the below dependency code section to the pom.xml file.
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
-> In the same way you can add any number of dependencies required for your application.
Step 5: Building Maven Project
> cd demo-project
-> If you have a main() method in App.java, run the JAR like this: