Skip to content

prathi1282/hello-java-maven

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

☕ Hello Java Maven with Jenkins

Build Status
Jenkins
Maven

A simple Java Hello World project built using Maven and automated with Jenkins Freestyle Job.


📁 Project Structure

hello-java-maven/ ├── src/ │ └── main/ │ └── java/ │ └── HelloWorld.java └── pom.xml


🧠 Overview

This project demonstrates:

  • How to use Jenkins to build a Java project with Maven.
  • Basic CI/CD concepts with Jenkins Freestyle jobs.
  • A simple Java program that prints "Hello, Jenkins + Maven!".

⚙️ Setup Instructions

1️⃣ Create Java App

src/main/java/HelloWorld.java

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, Jenkins + Maven!");
    }
}

2️⃣ Start Jenkins

Run Jenkins in Docker:

docker run -d --name jenkins -p 8080:8080 jenkins/jenkins:lts


Open Jenkins at http://localhost:8080
 and complete setup.

3️⃣ Configure Maven in Jenkins

Go to Manage JenkinsGlobal Tool Configuration

Add Maven (e.g., Maven 3.8.6)

4️⃣ Create a Freestyle Job

New ItemFreestyle ProjectName it hello-java-maven

Under Build, select Invoke top-level Maven targets

Set Goal: clean package

Save and click Build Now

5️⃣ Verify the Build

Open Console OutputYou should see:

[INFO] BUILD SUCCESSOutput

A successful Maven build for the Java HelloWorld app using Jenkins.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages