From 5dc1934483985334c3e1c9233e10fa2a0a4f5fc3 Mon Sep 17 00:00:00 2001 From: Aryaman Rishabh Date: Sun, 11 Feb 2024 23:55:30 -0500 Subject: [PATCH 1/4] update pom.xml to add jar config --- pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pom.xml b/pom.xml index 0644728..bc1b09e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,6 +6,7 @@ com.example demo + jar 1.0-SNAPSHOT demo @@ -13,6 +14,7 @@ http://www.example.com + 17 UTF-8 1.7 1.7 @@ -91,6 +93,15 @@ maven-jar-plugin 3.0.2 + + + + true + lib/ + com.example.Main + + + maven-install-plugin From 45eef5ee243586725bc242bdb3ce5562473cccb9 Mon Sep 17 00:00:00 2001 From: Aryaman Rishabh Date: Sun, 11 Feb 2024 23:55:51 -0500 Subject: [PATCH 2/4] update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index aac66a5..afd01e6 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,13 @@ cd mvn clean install ``` +### Execute jar file: + +```shell +java -jar +``` +Replace the location of the generated jar file (usually `target/demo-1.0-SNAPSHOT.jar`) + ### Running Tests Execute tests with Maven: From 4e6f5e60f641a0781d9aae8dfe4a3249ebf905cb Mon Sep 17 00:00:00 2001 From: Aryaman Rishabh Date: Sun, 11 Feb 2024 23:56:18 -0500 Subject: [PATCH 3/4] add logger component --- src/main/java/com/example/App.java | 4 +++- src/main/java/com/example/Main.java | 4 +++- src/main/java/com/example/logger/Log.java | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/example/logger/Log.java diff --git a/src/main/java/com/example/App.java b/src/main/java/com/example/App.java index 1c94b31..c926a06 100644 --- a/src/main/java/com/example/App.java +++ b/src/main/java/com/example/App.java @@ -1,5 +1,7 @@ package com.example; +import com.example.logger.Log; + /** * Hello world! * @@ -7,6 +9,6 @@ public class App { public static void main(String[] args) { - System.out.println("Hello World!"); + Log.debug("Hello World!"); } } diff --git a/src/main/java/com/example/Main.java b/src/main/java/com/example/Main.java index b47156f..3d92aa4 100644 --- a/src/main/java/com/example/Main.java +++ b/src/main/java/com/example/Main.java @@ -1,7 +1,9 @@ package com.example; +import com.example.logger.Log; + public class Main { public static void main(String[] args) { - System.out.println("Hello world!"); + Log.debug("Hello World!"); } } \ No newline at end of file diff --git a/src/main/java/com/example/logger/Log.java b/src/main/java/com/example/logger/Log.java new file mode 100644 index 0000000..cecb0f5 --- /dev/null +++ b/src/main/java/com/example/logger/Log.java @@ -0,0 +1,10 @@ +package com.example.logger; + +public class Log { + public static void debug(String str) { + System.out.println(str); + } + public static void error(String str) { + System.err.println(str); + } +} From d9ae81edc4f3122bd672be87bd9d865aa782bab0 Mon Sep 17 00:00:00 2001 From: Aryaman Rishabh Date: Mon, 12 Feb 2024 00:05:27 -0500 Subject: [PATCH 4/4] resolved merge conflict --- src/main/java/com/example/App.java | 4 +++- src/main/java/com/example/Main.java | 8 +++----- src/main/java/com/example/logger/Log.java | 10 ++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/example/logger/Log.java diff --git a/src/main/java/com/example/App.java b/src/main/java/com/example/App.java index 1c94b31..c926a06 100644 --- a/src/main/java/com/example/App.java +++ b/src/main/java/com/example/App.java @@ -1,5 +1,7 @@ package com.example; +import com.example.logger.Log; + /** * Hello world! * @@ -7,6 +9,6 @@ public class App { public static void main(String[] args) { - System.out.println("Hello World!"); + Log.debug("Hello World!"); } } diff --git a/src/main/java/com/example/Main.java b/src/main/java/com/example/Main.java index 175d8c1..3d92aa4 100644 --- a/src/main/java/com/example/Main.java +++ b/src/main/java/com/example/Main.java @@ -1,11 +1,9 @@ package com.example; -import com.example.service.MessageService; +import com.example.logger.Log; public class Main { public static void main(String[] args) { - MessageService service = new MessageService(); - System.out.println(service.fetchMessage()); - + Log.debug("Hello World!"); } -} +} \ No newline at end of file diff --git a/src/main/java/com/example/logger/Log.java b/src/main/java/com/example/logger/Log.java new file mode 100644 index 0000000..cecb0f5 --- /dev/null +++ b/src/main/java/com/example/logger/Log.java @@ -0,0 +1,10 @@ +package com.example.logger; + +public class Log { + public static void debug(String str) { + System.out.println(str); + } + public static void error(String str) { + System.err.println(str); + } +}