A Java web application built with Maven for DevOps Class 42 by Landmark Technology. Runs on port 8081 and serves a styled web page.
This application starts an embedded HTTP server on port 8081 and serves a web page about Landmark Technology's DevOps Class 42. Built with Java 17 and Apache Maven.
├── pom.xml # Maven build configuration
├── README.md # This file
└── src/
├── main/java/com/example/
│ └── Main.java # Web server entry point
└── test/java/com/example/
└── MainTest.java # Unit tests (JUnit 5)
On Amazon Linux (EC2):
sudo yum update -y
sudo yum install java-17-amazon-corretto-devel -y
sudo yum install maven -yVerify installations:
java -version
mvn -versiongit clone https://github.com/LandmakTechnology/landmark_javaapp.git
cd landmark_javaapp
mvn clean packagejava -jar target/simple-java-app-1.0-SNAPSHOT.jarExpected terminal output:
Hello from Landmark Technology!
Server started on port 8081
Access the application at http://localhost:8081
Then open your browser and go to:
http://localhost:8081
mvn testExpected output:
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
| Test | Description |
|---|---|
testGreetingMessage |
Verifies the greeting returns the exact expected string |
testGreetingIsNotNull |
Ensures the greeting is never null |
testGreetingIsNotEmpty |
Ensures the greeting is not an empty string |
testGreetingContainsLandmark |
Verifies the greeting mentions "Landmark" |
testFormattedTimeContainsPrefix |
Checks output starts with "Current Time: " |
testFormattedTimeContainsDate |
Verifies the date appears in the output |
testFormattedTimeExactMatch |
Validates exact output for a known date/time |
testHtmlPageContainsDevOpsClass42 |
Verifies the HTML page includes "DevOps Class 42" |
Step 1 — SSH into your EC2 instance:
ssh -i <your-key.pem> ec2-user@<your-ec2-public-ip>Step 2 — Install Java and Maven:
sudo yum update -y
sudo yum install java-17-amazon-corretto-devel -y
sudo yum install maven -yStep 3 — Clone, build, and run:
git clone https://github.com/LandmakTechnology/landmark_javaapp.git
cd landmark_javaapp
mvn clean package
java -jar target/simple-java-app-1.0-SNAPSHOT.jarStep 4 — Open port 8081 in your Security Group:
- Go to AWS Console → EC2 → Security Groups
- Select the Security Group attached to your instance
- Click Edit inbound rules → Add rule
- Set: Type: Custom TCP | Port: 8081 | Source: 0.0.0.0/0
- Click Save rules
Step 5 — Access the application in your browser:
http://<your-ec2-public-ip>:8081
Tip: To run the application in the background so it stays running after you close SSH:
nohup java -jar target/simple-java-app-1.0-SNAPSHOT.jar &
Landmark Technology — Maven Web Application | DevOps Class 42 | Open Source