POM changes for jar building
This commit is contained in:
1
backend/.gitignore
vendored
Normal file
1
backend/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/dependency-reduced-pom.xml
|
||||
@@ -49,4 +49,31 @@
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- Maven Shade Plugin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.5.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>net.miarma.contaminus.server.MainVerticle</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,18 +0,0 @@
|
||||
package net.miarma.contaminus.clase;
|
||||
|
||||
import io.vertx.core.AbstractVerticle;
|
||||
import io.vertx.core.Promise;
|
||||
|
||||
public class BroadcastVerticle extends AbstractVerticle {
|
||||
@Override
|
||||
public void start(Promise<Void> promise) {
|
||||
vertx.setPeriodic(2000, _a -> {
|
||||
vertx.eventBus().publish("broadcast.addr", "Ola");
|
||||
});
|
||||
try {
|
||||
promise.complete();
|
||||
} catch (Exception e) {
|
||||
promise.fail(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package net.miarma.contaminus.clase;
|
||||
|
||||
import io.vertx.core.AbstractVerticle;
|
||||
import io.vertx.core.Promise;
|
||||
import io.vertx.core.eventbus.Message;
|
||||
import net.miarma.contaminus.common.Constants;
|
||||
|
||||
public class ConsumerVerticle1 extends AbstractVerticle {
|
||||
@Override
|
||||
public void start(Promise<Void> promise) {
|
||||
vertx.eventBus().consumer("broadcast.addr", this::handleMsg);
|
||||
try {
|
||||
promise.complete();
|
||||
} catch (Exception e) {
|
||||
promise.fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMsg(Message<String> msg) {
|
||||
Constants.LOGGER.info("Ola Broadcast soy Consumer1");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package net.miarma.contaminus.clase;
|
||||
|
||||
import io.vertx.core.AbstractVerticle;
|
||||
import io.vertx.core.Promise;
|
||||
import io.vertx.core.eventbus.Message;
|
||||
import net.miarma.contaminus.common.Constants;
|
||||
|
||||
public class ConsumerVerticle2 extends AbstractVerticle {
|
||||
@Override
|
||||
public void start(Promise<Void> promise) {
|
||||
vertx.eventBus().consumer("broadcast.addr", this::handleMsg);
|
||||
try {
|
||||
promise.complete();
|
||||
} catch (Exception e) {
|
||||
promise.fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMsg(Message<String> msg) {
|
||||
Constants.LOGGER.info("Ola Broadcast soy Consumer2");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package net.miarma.contaminus.clase;
|
||||
|
||||
import io.vertx.core.AbstractVerticle;
|
||||
import io.vertx.core.Promise;
|
||||
import net.miarma.contaminus.common.Constants;
|
||||
|
||||
public class MainVerticleClase extends AbstractVerticle {
|
||||
@Override
|
||||
public void start(Promise<Void> promise) {
|
||||
vertx.deployVerticle(new BroadcastVerticle(), result -> {
|
||||
if(result.succeeded()) {
|
||||
Constants.LOGGER.info("📡 BroadcastVerticle desplegado");
|
||||
} else {
|
||||
Constants.LOGGER.error("❌ Error al desplegar BroadcastVerticle", result.cause());
|
||||
}
|
||||
});
|
||||
vertx.deployVerticle(new ConsumerVerticle1(), result -> {
|
||||
if(result.succeeded()) {
|
||||
Constants.LOGGER.info("📡 ConsumerVerticle1 desplegado");
|
||||
} else {
|
||||
Constants.LOGGER.error("❌ Error al desplegar ConsumerVerticle1", result.cause());
|
||||
}
|
||||
});
|
||||
vertx.deployVerticle(new ConsumerVerticle2(), result -> {
|
||||
if(result.succeeded()) {
|
||||
Constants.LOGGER.info("📡 ConsumerVerticle2 desplegado");
|
||||
} else {
|
||||
Constants.LOGGER.error("❌ Error al desplegar ConsumerVerticle2", result.cause());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -23,4 +23,8 @@ public class MainVerticle extends AbstractVerticle {
|
||||
.forEach(v -> getVertx().undeploy(v));
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
io.vertx.core.Launcher.executeCommand("run", MainVerticle.class.getName());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user