Skip to content

Commit 419ef35

Browse files
author
tim
committed
updates pom to build a functional executable jar
1 parent 5f31575 commit 419ef35

File tree

2 files changed

+59
-7
lines changed

2 files changed

+59
-7
lines changed

pom.xml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,51 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6-
76
<groupId>io.magnetic.vamp</groupId>
87
<artifactId>bootstrap</artifactId>
98
<version>1.0-SNAPSHOT</version>
10-
11-
9+
<build>
10+
<plugins>
11+
<plugin>
12+
<groupId>org.apache.maven.plugins</groupId>
13+
<artifactId>maven-compiler-plugin</artifactId>
14+
<version>3.1</version>
15+
<configuration>
16+
<source>1.7</source>
17+
<target>1.7</target>
18+
</configuration>
19+
</plugin>
20+
<plugin>
21+
<artifactId>maven-assembly-plugin</artifactId>
22+
<configuration>
23+
<archive>
24+
<manifest>
25+
<mainClass>io.magnetic.vamp.Bootstrap</mainClass>
26+
</manifest>
27+
</archive>
28+
<descriptorRefs>
29+
<descriptorRef>jar-with-dependencies</descriptorRef>
30+
</descriptorRefs>
31+
</configuration>
32+
</plugin>
33+
</plugins>
34+
</build>
35+
<dependencies>
36+
<!-- vertx dependencies -->
37+
<dependency>
38+
<groupId>io.vertx</groupId>
39+
<artifactId>vertx-platform</artifactId>
40+
<version>2.1RC3</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>io.vertx</groupId>
44+
<artifactId>vertx-core</artifactId>
45+
<version>2.1RC3</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>io.vertx</groupId>
49+
<artifactId>vertx-hazelcast</artifactId>
50+
<version>2.1RC3</version>
51+
</dependency>
52+
</dependencies>
1253
</project>

src/main/java/Bootstrap.java renamed to src/main/java/io/magnetic/vamp/Bootstrap.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
/* Bootstrap configures Hazelcast for clustering in Docker
1+
/*
2+
Bootstrap configures Hazelcast for clustering in Docker
23
It performs two tasks:
4+
35
1) Setup Hazelcast for routing between Docker instances on different hosts
46
2) Setup the Vertx event bus for routing between verticles running in these Docker instances
7+
8+
This code is based almost entirely on the standard Vertx Starter class and the extra commit remarks regarding
9+
the programmatic configuration of the event bus, please see:
10+
11+
https://github.com/eclipse/vert.x/blob/master/vertx-platform/src/main/java/org/vertx/java/platform/impl/cli/Starter.java
12+
https://github.com/eclipse/vert.x/pull/777
513
*/
14+
15+
package io.magnetic.vamp;
16+
617
import org.vertx.java.core.json.JsonObject;
718
import org.vertx.java.core.logging.Logger;
819
import org.vertx.java.core.logging.impl.LoggerFactory;
@@ -101,13 +112,13 @@ private void runVertx(Args args) {
101112
JsonObject conf = new JsonObject();
102113

103114
// Set the initializing verticle. This is the verticle that will spin up all other verticles
104-
URL file_location = null;
115+
URL classpath_location = null;
105116
try {
106-
file_location = new URL("file:///" + vertxClassPath);
117+
classpath_location = new URL("file:///" + vertxClassPath);
107118
} catch (MalformedURLException e) {
108119
e.printStackTrace();
109120
}
110-
URL[] classpath = new URL[]{file_location};
121+
URL[] classpath = new URL[]{classpath_location};
111122

112123
pm.deployVerticle(vertxVerticle, conf, classpath, 1, null, new AsyncResultHandler<String>() {
113124
public void handle(AsyncResult<String> asyncResult) {

0 commit comments

Comments
 (0)