Skip to content

Commit 8c8717b

Browse files
author
Mariana Azevedo
committed
Adding information on README.md. Adding maven-assembly-plugin in the pom.xml.
1 parent 960e997 commit 8c8717b

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

.classpath

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
<attribute name="test" value="true"/>
1414
</attributes>
1515
</classpathentry>
16-
<classpathentry kind="src" path="src/main/resources"/>
16+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
17+
<attributes>
18+
<attribute name="maven.pomderived" value="true"/>
19+
</attributes>
20+
</classpathentry>
1721
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
1822
<attributes>
1923
<attribute name="maven.pomderived" value="true"/>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
eclipse.preferences.version=1
22
encoding//src/main/java=UTF-8
3+
encoding//src/main/resources=UTF-8
34
encoding//src/test/java=UTF-8
45
encoding/<project>=UTF-8

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
A project of solved exercises from Hackerrank website in Java and SQL.
66

7-
## Summary
7+
### Summary
88

99
#### Java Challenges
1010

@@ -14,3 +14,21 @@ A project of solved exercises from Hackerrank website in Java and SQL.
1414
#### SQL Challenges
1515

1616
- [Practice SQL](https://github.com/mariazevedo88/hackerrank-challenges/blob/master/sql/SQL.md)
17+
18+
#### Run the .jar file
19+
20+
In order to run any Java Challenge in the project, on **Linux/Mac/Windows** terminal, run the jar simply as following:
21+
22+
```bash
23+
java -cp hackerrank-challenges-1.0.0-SNAPSHOT-jar-with-dependencies.jar {Class that you want execute}
24+
```
25+
26+
For example, to run the `Matrix.java` in the `Graphs` section:
27+
28+
```bash
29+
java -cp hackerrank-challenges-1.0.0-SNAPSHOT-jar-with-dependencies.jar io.github.mariazevedo88.hc.prepkit.graphs.Matrix
30+
```
31+
32+
#### Contributing
33+
34+
[![](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/images/0)](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/links/0)[![](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/images/1)](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/links/1)[![](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/images/2)](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/links/2)[![](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/images/3)](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/links/3)[![](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/images/4)](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/links/4)[![](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/images/5)](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/links/5)[![](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/images/6)](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/links/6)[![](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/images/7)](https://sourcerer.io/fame/mariazevedo88/mariazevedo88/hackerrank-challenges/links/7)

pom.xml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.github.mariazevedo88</groupId>
66
<artifactId>hackerrank-challenges</artifactId>
7-
<version>0.0.1-SNAPSHOT</version>
7+
<version>1.0.0-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<name>hackerrank-challenges</name>
@@ -41,7 +41,6 @@
4141
</dependencies>
4242

4343
<build>
44-
<finalName>hackerrank-challenges</finalName>
4544
<plugins>
4645
<plugin>
4746
<groupId>org.apache.maven.plugins</groupId>
@@ -52,6 +51,22 @@
5251
<target>${java.version}</target>
5352
</configuration>
5453
</plugin>
54+
<plugin>
55+
<artifactId>maven-assembly-plugin</artifactId>
56+
<executions>
57+
<execution>
58+
<phase>package</phase>
59+
<goals>
60+
<goal>single</goal>
61+
</goals>
62+
</execution>
63+
</executions>
64+
<configuration>
65+
<descriptorRefs>
66+
<descriptorRef>jar-with-dependencies</descriptorRef>
67+
</descriptorRefs>
68+
</configuration>
69+
</plugin>
5570
</plugins>
5671
</build>
5772
</project>

0 commit comments

Comments
 (0)