DevOps Classroom Notes 13/March/2024

Building Java Code using maven

  • Maven is a tool to build code using java based languages
  • The other popular tools used in Java
    • ANT
    • Gradle
  • To use maven, we need to install some version of Java

Activity 1: Setup maven and build the code

  • Lets create a linux vm
  • install java 17
sudo apt update
sudo apt install openjdk-17-jdk -y
  • Installing maven Refer Here for steps not version
cd /tmp
wget https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
tar -xvf apache-maven-3.9.6-bin.tar.gz
sudo mv apache-maven-3.9.6 /opt/
  • Lets try building the package for spring petclinic Refer Here
git clone https://github.com/spring-projects/spring-petclinic.git
cd spring-petclinic
mvn package
  • artifact path: target/spring-petclinic-3.2.0-SNAPSHOT.jar
  • How to run
java -jar spring-petclinic-3.2.0-SNAPSHOT.jar

Activity 2: Building .net code

sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-8.0
  • Clone the git and create a package
git clone https://github.com/nopSolutions/nopCommerce.git
cd nopCommerce
mkdir published
dotnet publish -c Release src/Presentation/Nop.Web/Nop.Web.csproj -o published/
  • artifacts: published/
  • how to run the application
cd published
dotnet Nop.Web.dll --urls "http://0.0.0.0:5000"
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