This is a Maven-based HR application designed for managing various HR-related tasks. The project is built with Java and uses Spring Boot as its backend framework. This guide will walk you through the steps to set up and run the project in IntelliJ IDEA.
Before you start, ensure you have the following installed:
Follow these steps to set up and run the project:
Open a terminal and clone the repository to your local machine:
git clone https://github.com/awokeo/hr-application.git
cd hr-application- Launch IntelliJ IDEA.
- Select File > Open and navigate to the directory where you cloned the repository.
- Choose the
pom.xmlfile in the project root and click Open as Project. - IntelliJ IDEA will automatically import the Maven project.
- In IntelliJ IDEA, go to File > Project Structure > Project.
- Under Project SDK, select your installed JDK (17 or higher). If not listed, click Add SDK and locate your JDK installation directory.
- Ensure the Language Level matches your JDK version.
Maven will handle dependency installation. If IntelliJ does not automatically resolve dependencies:
- Open the Maven tool window (usually on the right side of IntelliJ).
- Click the Reload All Maven Projects button (a circular arrow icon).
- Create a new file named
application.propertiesin thesrc/main/resourcesdirectory. - Add your database and other configurations. For example:
spring.datasource.url=jdbc:mysql://localhost:3306/hr_db
spring.datasource.username=your-username
spring.datasource.password=your-password
spring.jpa.hibernate.ddl-auto=update
server.port=8080- Navigate to the
HrApplication.javafile in thesrc/main/javadirectory. - Right-click on the file and select Run 'HrApplication.main()'.
- The application should start, and you can access it at
http://localhost:8080.
To run tests:
- Open the Maven tool window.
- Expand Lifecycle and double-click test.
- Dependency Issues: If you face issues resolving dependencies, try running
mvn clean installin the terminal. - Database Connection Errors: Ensure your database is running, and the credentials in
application.propertiesare correct.
Contributions are welcome! Feel free to fork the repository and submit a pull request.