Wildfly-Swarm – Basic setup

Tried this with Wildfly Swarm version 2017.8.1.

In the maven pom.xml the following entries are added.

<dependencyManagement>
   <dependencies>
      <dependency>
         <groupId>org.wildfly.swarm</groupId>
         <artifactId>bom-all</artifactId>
         <version>2017.8.1</version>
         <scope>import</scope>
         <type>pom</type>
      </dependency>
   </dependencies>
</dependencyManagement>

 

For building the uberjar or executing the plugin needs to be added.

<plugins>
   <plugin>
      <groupId>org.wildfly.swarm</groupId>
      <artifactId>wildfly-swarm-plugin</artifactId>
      <version>${version.wildfly.swarm}</version>
      <executions>
         <execution>
            <goals>
               <goal>package</goal>
            </goals>
         </execution>
      </executions>
   </plugin>
</plugins>

 

Creation of the uberjar happens, when you call package goal:

mvn package

 

The uberjar could be found in the target folder. Execute it with java -jar:

java -jar ./target/myapp-swarm.jar

 

If you want to debug your code, run it from maven, add the following parameter to your maven command and do a remote debugging session in your ide. Beware, that the Wildfly-Swarm process stops until a connection is open. Here we open a debug port on 8888.

maven run -Ddebug=8888

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.