Skip to content

haidargit/Java_SortingNames

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 

Repository files navigation

KST task logo

Names Sorter App Documentation

gitab

Table of content

About

This 'Names Sorter App' is built to sort a List of Names by their Last Name from the desired file which is already available and located inside this project("unsorted-names-list.txt"), then we save the sorted result into another file ("sorted-names-list.txt").

Stack

✅  No need 'specific IDEs'. Feel free to use any text editor to open the project folder. 

✅  Straightforward and easy to use. Since we don't do repetitive activities  
    such as start, stop, or even restart the localhost/local server for this project.      

✅  We check the application result on the Command Prompt / terminal by using mvn command  
    (you'll see it on below)

Prerequisites

==> Please make sure that you have installed <==

a. Maven: https://maven.apache.org/install.html (size: ± 10MB)

b. Java 8 (minimum version)

Use these commands to check the Maven and Java version on your system
(runnable on both Windows and Linux):

mvn -v

Screen Shot 2022-01-12 at 10 00 12

java --version

Screen Shot 2022-01-12 at 09 59 57


💡 as i mentioned earlier, we don't want to be bothered by choosing specific IDEs/Text Editor
for running/opening this Java maven app.

💡 By using Maven (mvn) command through our cmd or terminal, we can run this app easily.

Project Tree Details

dir
A: Directory where Main java files/classes located

B: Directory where Unit test files/classes located

C: resources for input("unsorted-names-list.txt") and output("sorted-names-list.txt").

You can modify the names as comprehensive and as many as you want inside the input file.
The output file content will be always overwritten based on your result.

Usage Example - Running the App

a. Download or clone this repository to your local computer

b. Navigate to the location of this project that you just downloaded through command prompt(CMD) or Terminal.
Go to the path where pom.xml is located (inside haidar folder = root).

c. Then type or copy these commands on your command prompt or terminal
(Both of these commands runnable on Windows/Linux/Mac)

Remember to install Maven (and Java) first.

<!-- Run this code just ONCE, for installing the project's dependencies. -->  
mvn compile && mvn clean install  


Then run the app,

mvn exec:java -Dexec.mainClass=com.haidar.App  

We can check and review the result.
Screen Shot 2022-01-12 at 10 14 33

Usage Example - Running the Unit Test

a. same as above, just a little different command.

mvn test

Screen Shot 2022-01-12 at 11 02 56

Code Editing and Modification Purpose

a. Open the project folder with any IDE/Text Editor that you desired, i.e Sublime, Atom, VS Code, Notepad++, etc.

b. Explore and modify any Java files with its resources (the .txt files that contain names). You can also modify the unit test.

c. After you finish your editing process and you want to see the different result, you must re-run these commands again.

Before you execute this command, make sure to navigate at project's root directory where the pom.xml lies, so you can run the 'mvn' command.

<!-- For running the Main App (if you edited the main app, etc)-->

mvn exec:java -Dexec.mainClass=com.haidar.App  
<!-- For running the Unit Test (if you edited the unit test) -->

mvn test

d. You can then see the modified result.

🦠If there's any issue regarding installation and debugging, kindly to inform me..



By Haidar Ali

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages