Skip to content

DurgeshOnStack/Maven_Project01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ό Employee Salary Slip Generator (Spring + Maven)

A simple Spring Core + Maven based Java application that generates an employee salary slip using dependency injection and annotation-based configuration. This project demonstrates how to use Spring’s IoC container, annotation-driven configuration, and basic business logic to compute salary details like gross salary, tax deductions, and net salary.

The application works by creating an Employee bean, injecting it into a SalarySlipService, and then calculating the salary breakdown using simple formulas. It uses Spring annotations like @Configuration, @ComponentScan, @Component, @Service, and @Autowired to manage dependencies automatically.

Tech Stack: Java (JDK 8+), Spring Core (Annotation-based), Maven, any IDE like IntelliJ or Eclipse.

Project Structure (simplified): com.nit β”œβ”€β”€ config β†’ AppConfig.java β”œβ”€β”€ main β†’ TestApp.java β”œβ”€β”€ sbeans β†’ Employee.java, SalarySlipService.java └── meaven_Project01.Employee_Salary_Slip_Generator β†’ App.java

Key Files:

AppConfig.java (Spring Configuration)

Employee.java (Bean class holding employee data like id, name, salary, HRA, DA, tax percentage)

SalarySlipService.java (Business logic for salary calculation: gross = basic + HRA + DA, tax = percentage of gross, net = gross - tax)

TestApp.java (Main class that loads Spring context, sets employee data, and triggers salary generation)

How to Run:

  1. Clone the repository git clone https://github.com/Maven_Project01/employee-salary-slip.git

  2. Navigate to the project folder cd employee-salary-slip

  3. Build using Maven mvn clean install

  4. Run TestApp.java from your IDE

Sample Output:

Salary Slip for Raj Gross Salary: 47700.0 Tax Deducted: 7632.0 Net Salary: 40068.0

Learning Outcomes: Understanding Spring IoC container, dependency injection, annotation-based configuration, and clean separation between data (Employee) and business logic (SalarySlipService).

Future Improvements: Convert to Spring Boot REST API, add database integration, support multiple employees, export salary slip as PDF.

Author: Durgesh Tiwari (Student, learning Java and Spring)

License: Free to use for educational purposes.

About

A Spring Core + Maven based Java application that generates employee salary slips using dependency injection and annotation-based configuration. It calculates gross salary, tax deductions, and net salary through a clean separation of data and business logic.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages