项目作者: pradipmudi

项目描述 :
car parking system implementation
高级语言: Java
项目地址: git://github.com/pradipmudi/car-parking-system.git
创建时间: 2021-07-11T19:28:47Z
项目社区:https://github.com/pradipmudi/car-parking-system

开源协议:

下载


car-parking-system

A command line based car parking system implementation

How to configure the project?

  • Java version used: 1.8
  • Maven version used: 4.0.0
  • Clone the project from GIT repo and import the project as “Existing Maven Project”(If you are using Eclipse)
  • All the dependencies are metioned in the ‘pom.xml’ file, after cloning the project simply clean and build it
  • Build configurations and Dependencies used in the project :
  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.apache.maven.plugins</groupId>
  5. <artifactId>maven-jar-plugin</artifactId>
  6. <configuration>
  7. <archive>
  8. <manifest>
  9. <addClasspath>true</addClasspath>
  10. <classpathPrefix>libs/</classpathPrefix>
  11. <mainClass>
  12. com.carparkingsystem.ParkingLotSystem
  13. </mainClass>
  14. </manifest>
  15. </archive>
  16. </configuration>
  17. </plugin>
  18. </plugins>
  19. </build>
  20. <dependencies>
  21. <dependency>
  22. <groupId>junit</groupId>
  23. <artifactId>junit</artifactId>
  24. <version>3.8.1</version>
  25. <scope>test</scope>
  26. </dependency>
  27. </dependencies>

How to create the command line based runnable jar from IDE like eclipse?

Create a runnable JAR with com.carparkingsystem.ParkingLotSystem.java in Launch Configuration

Or Build from CLI

  • Open terminal
  • Go to project directory
  • Run “mvn clean”
  • Run “mvn install”
  • Runnable jar will be created in the “target” directory

How to run from command line ?

  • Go to the target directory of the jar and run as shown in the examples :

Examples :

First run the jar, then keep entering the commands:

java -jar jar_name.jar

Input:

Create_parking_lot 6

Output

Created parking of 6 slots

Input:

Park KA-01-HH-1234 driver_age 21

Output

Car with vehicle registration number “KA-01-HH-1234” has been parked at slot number 1

Input:

Park PB-01-HH-1234 driver_age 21

Output

Car with vehicle registration number “PB-01-HH-1234” has been parked at slot number 2

Input:

Slot_numbers_for_driver_of_age 21

Output

1,2

Input:

Slot_numbers_for_driver_of_age 18

Output

No parked car matches the query

Input:

Park PB-01-TG-2341 driver_age 40

Output

Car with vehicle registration number “PB-01-TG-2341” has been parked at slot number 3

Input:

Slot_number_for_car_with_number PB-01-HH-1234

Output

2

Input:

Leave 2

Output

Slot number 2 vacated, the car with vehicle registration number “PB-01-HH-1234” left the space, the driver of the car was of age 21

Input:

Park HR-29-TG-3098 driver_age 39

Output

Car with vehicle registration number “HR-29-TG-3098” has been parked at slot number 2

Input:

Slot_number_for_car_with_number PB-01-HH-6789

Output

No parked car matches the query

Input:

Vehicle_registration_number_for_driver_of_age 18

Output

No parked car matches the query

Input:

Terminate

Output

Terminating the program…exiting the command line interface….