Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/addition component #8

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ cd <project-directory>
mvn clean install
```

### Execute jar file:

```shell
java -jar <location to jar file>
```
Replace the location of the generated jar file (usually `target/demo-1.0-SNAPSHOT.jar`)

### Running Tests

Execute tests with Maven:
Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>

<name>demo</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
Expand Down Expand Up @@ -92,6 +94,15 @@
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.example.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/example/App.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.example;

import com.example.logger.Log;

/**
* Hello world!
*
*/
public class App {
public static void main(String[] args) {

System.out.println("Hello World!");
Log.debug("Hello World!");
}
}
8 changes: 3 additions & 5 deletions src/main/java/com/example/Main.java
Original file line number Diff line number Diff line change
@@ -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!");
}
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/example/logger/Log.java
Original file line number Diff line number Diff line change
@@ -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);
}
}