Skip to content

Commit 1dc2d3d

Browse files
committed
Adding missing dependencies
Adding support to run fatJars
1 parent 558e759 commit 1dc2d3d

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

pom.xml

+32-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@
2222
<java.version>11</java.version>
2323
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2424
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
25+
26+
<slf4j-simple.version>1.7.25</slf4j-simple.version>
2527
<ev3dev-lang-java.version>2.6.2-SNAPSHOT</ev3dev-lang-java.version>
2628

2729
<!-- EV3 Parameters -->
2830
<ev3.host>192.168.1.151</ev3.host>
2931
<ev3.user>robot</ev3.user>
3032
<ev3.password>maker</ev3.password>
33+
3134
</properties>
3235

3336
<repositories>
@@ -47,6 +50,11 @@
4750
</repositories>
4851

4952
<dependencies>
53+
<dependency>
54+
<groupId>org.slf4j</groupId>
55+
<artifactId>slf4j-simple</artifactId>
56+
<version>${slf4j-simple.version}</version>
57+
</dependency>
5058
<dependency>
5159
<groupId>com.github.ev3dev-lang-java</groupId>
5260
<artifactId>ev3dev-lang-java</artifactId>
@@ -85,8 +93,30 @@
8593
</configuration>
8694
</plugin>
8795
<plugin>
88-
<artifactId>maven-jar-plugin</artifactId>
89-
<version>3.0.2</version>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-assembly-plugin</artifactId>
98+
<version>3.1.1</version>
99+
100+
<configuration>
101+
<descriptorRefs>
102+
<descriptorRef>jar-with-dependencies</descriptorRef>
103+
</descriptorRefs>
104+
105+
<archive>
106+
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
107+
</archive>
108+
</configuration>
109+
110+
<executions>
111+
<execution>
112+
<id>make-assembly</id>
113+
<phase>package</phase>
114+
<goals>
115+
<goal>single</goal>
116+
</goals>
117+
</execution>
118+
</executions>
119+
90120
</plugin>
91121
<plugin>
92122
<artifactId>maven-site-plugin</artifactId>

scripts/deploy.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ ARTIFACT=$4
1717
function deploy() {
1818

1919
echo "Deploy artifact to EV3"
20-
echo "sshpass -p $EV3_PASSWORD scp -P 22 ./target/$ARTIFACT.jar $EV3_USER@$EV3_HOST:/home/robot/"
20+
echo "sshpass -p $EV3_PASSWORD scp -P 22 ./target/$ARTIFACT-jar-with-dependencies.jar $EV3_USER@$EV3_HOST:/home/robot/"
2121
sshpass -p $EV3_PASSWORD \
2222
scp -P 22 \
23-
./target/$ARTIFACT.jar $EV3_USER@$EV3_HOST:/home/robot/
23+
./target/$ARTIFACT-jar-with-dependencies.jar $EV3_USER@$EV3_HOST:/home/robot/
2424
}
2525

2626
function run() {
2727

2828
echo "Run artifact"
29-
echo "sshpass -p $EV3_PASSWORD ssh -p 22 $EV3_USER@$EV3_HOST java -jar $ARTIFACT.jar"
29+
echo "sshpass -p $EV3_PASSWORD ssh -p 22 $EV3_USER@$EV3_HOST java -jar $ARTIFACT-jar-with-dependencies.jar"
3030
sshpass -p $EV3_PASSWORD \
3131
ssh -p 22 \
32-
$EV3_USER@$EV3_HOST "java -jar $ARTIFACT.jar"
32+
$EV3_USER@$EV3_HOST "java -jar $ARTIFACT-jar-with-dependencies.jar"
3333
}
3434

3535
deploy

0 commit comments

Comments
 (0)