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 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
Plugin for Social Media by Acurax Wordpress Design Studio
Exit mobile version
%%footer%%