0% found this document useful (0 votes)
13 views

Jenkins 9

Devops notes cond

Uploaded by

demoallr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Jenkins 9

Devops notes cond

Uploaded by

demoallr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

jenkins9.

md

Build Tools
Make:
This is a first generation build tool which has automated building of c and c++ projects.
The build steps are configured in a file which is called as Makefile
Apache Ant:
This is a build tool majorly used in Java Projects for building packages
The build steps are configure in a file called as build.xml

Apache Maven
Maven is a build tool used for java and java based languages (Groovy and Scala).
Maven belives in convention over configuration
Maven helps in
building
testing
packaging
managing dependencies.
Maven has a standard directory layout Refer Here
Maven has archetypes using which we can generate folder structures with sample code.

Setup Maven

Maven relies on java, so java should be installed

sudo apt update


sudo apt install openjdk-17-jdk -y

Lets use untar approach to install maven (3.9.8)


reference article Refer Here

Project Object Model (pom)

Refer Here for official docs


Simple pom.xml

<project>
<modelVersion>4.0.0</modelVersion>
<groupId>blog.directdevops</groupId>
<artifactId>hello-maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
</project>

Maven lifecycle

1/3
jenkins9.md

validate
compile
test
package
install
deploy

Information about maven

Maven will create a folder called as target and add all artifacts into it.
clean step removes the target folder
When we install maven in the home directory (C:\Users<username>\ or /home/) a .m2 folder will be
created.
This .m2 folder will have all the dependencies downloaded over here and is also referred as local
repostiory
In maven we deal with 3 repositories
local
remote
central

Building Sample Projects

we have installed jdk 17


Lets build Refer Here

git clone https://github.com/jenkins-docs/simple-java-maven-app.git


cd simple-java-maven-app
mvn validate
mvn compile

2/3
jenkins9.md

mvn test
mvn package

Lets build spring pet clinic

git clone https://github.com/spring-projects/spring-petclinic.git


cd spring-petclinic
mvn clean package

Multi-project model:
Try building game-of-life Refer Here

References

Libraries: Library is a reusable code. Libraries are of two types


static library:
dynamic library:
Dependency: Dependency at a source code level, means relying on libraries to acheive some
functionality.
Modern build tools
build code
dependency management
artifact versioning and storage support

3/3

You might also like