DevOps Classroom notes 24/Nov/2023

Maven

Repository

  • In Maven we have three repositories
    • Local Repository (~/.m2/repository)
    • Remote Repository: Present with in organizational boundary where we can download dependencies and store artifacts. Jfrog and Nexus can be used as Remote Repositories
    • Central Repo: Open public repository having all the public dependencies
  • Goals:
    • install: copy the artifact into local repository
    • deploy: copy the artifact into remote repository
  • Maven settings file: If we need to configure maven with remote repository location or other configuration details ~/.m2/settings.xml Refer Here for official docs

Lets build a maven project

  • Install maven
  • lets use spring petclinic Refer Here
  • Lets execute maven phases
mvn validate
mvn compile
mvn test
mvn package
mvn install
  • Compilation, test, package and install a target folder will be created
    • compile: will create .class files
    • test: will run unit tests and creates test reports in xml format
    • package: will create a jar or war file
    • install: will copy jar an pom to local repo
  • Exercise: Try building openmrs core Refer Here
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%