DevOps Classroom notes 28/Mar/2026

Maven

  • Java distribution formats

    • JAR
    • WAR
    • EAR
  • Maven manages

    • libraries
    • compiles the commands
    • test execution
    • packaging
  • Maven solves this by using conventions over configuration
    • a standard folder structure
    • pom.xml file
    • ready made commands
  • Heart of maven (pom.xml) which tells maven
    • project name
    • version
    • dependencies
    • build settings
    • plugins
  • Important fields of pom.xml
    • groupId: This represents organization
    • artifactId: name of your project
    • version: Version of your application
  • Standard Maven Project Structure
    Preview
  • Maven lifecycle:

    • we dont tell maven every tiny step, we tell it a stage and it performs that stage pluse required early stages
    • Important phases
      • validate
      • compile
      • test
      • package
      • verify
      • install
      • deploy
  • Commands
    • mvn compile for compile phase
    • mvn package for package phase
    • mvn clean package
  • Maven generates artifacts into target folder
  • In maven project we can specify dependencies and it downloads dependencies into ~/.m2/repository which can be changed with env M2_HOME
  • Maven requires Java to work

    • Lets install jdk 21
    • Maven prompt => give me steps to install latest maven on ubuntu 24

Dependencies

  • JAVA:
    • mvn => resolve depdencies
  • Dotnet
    • nuget
  • Python
    • pip
  • node js
    • npm

Artifacts and .gitignore

  • Artifacts are build outputs
  • Any files that are generate during build/test should not end up in git repo
  • To ensure unnecessary files dont end up in git repo we create .gitignore file

Github actions pipeline

  • Which on pull request to dev branch will ensure all the tests are passing
  • Refer Here
  • Lets enhance this pipeline to show the test results
  • Refer Here to the changes over here

Static code analysis

  • Most of orgs use static code analysis tools such as
    • sonarqube
    • codeql

Codeql

  • Github provides its own built-in static code analysis tool called codeql

Exercise

  • Fork the spring petclinic repo
  • remove existing github actions
  • create a new workflow for pull request
  • Ensure you perform all the checks ref
    • tests
    • codeql
  • use this as Refer Here
  • Inspired by this try doing the same for .net repository

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube