Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
SWARM-856: main() clear up in examples repo (#114)
Browse files Browse the repository at this point in the history
Motivation
----------
There are many usages of main() in our examples that don't require a main() as they can be configured through project-stages.yml.

Modifications
-------------
Removed all Shrinkwrap specific examples that can be achieved with a `war` project type and project-stages.yml.

Modified remaining main() examples to use project-stages.yml instead.

Result
------
No impact to product, simplified examples
  • Loading branch information
kenfinnigan committed Dec 7, 2016
1 parent 865ab3d commit ac61d71
Show file tree
Hide file tree
Showing 195 changed files with 203 additions and 4,207 deletions.

This file was deleted.

25 changes: 1 addition & 24 deletions arjuna/arjuna-shrinkwrap/README.md → arjuna/arjuna/README.md
Expand Up @@ -6,10 +6,6 @@ Note, these are not Java EE compliant APIs and classes we're going to use. But t

## Project `pom.xml`

The project is a normal maven project with `jar` packaging, not `war`.

<packaging>jar</packaging>

The project adds a `<plugin>` to configure `wildfly-swarm-plugin` to
create the runnable `.jar`.

Expand All @@ -27,41 +23,22 @@ create the runnable `.jar`.
</executions>
</plugin>

Additionally, the usual `maven-jar-plugin` is provided configuration
to indicate which of our own classes should be used for the `main()`
method.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.wildfly.swarm.examples.transactions.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>

To define the needed parts of WildFly Swarm, a dependency is added

<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>jaxrs</artifactId>
<version>${version.wildfly-swarm}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>transactions</artifactId>
<version>${version.wildfly-swarm}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>msc</artifactId>
<version>${version.wildfly-swarm}</version>
<scope>provided</scope>
</dependency>

## Build
Expand Down Expand Up @@ -105,4 +82,4 @@ To define the needed parts of WildFly Swarm, a dependency is added

You should get something like the following in your browser ...

Nested transaction BasicAction: 0:ffffac1c8001:-315e47ea:567ed60e:19 status: ActionStatus.RUNNING started!
Nested transaction BasicAction: 0:ffffac1c8001:-315e47ea:567ed60e:19 status: ActionStatus.RUNNING started!
13 changes: 5 additions & 8 deletions arjuna/arjuna-shrinkwrap/pom.xml → arjuna/arjuna/pom.xml
Expand Up @@ -22,7 +22,7 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.wildfly.swarm.examples</groupId>
Expand All @@ -31,12 +31,12 @@
<relativePath>../</relativePath>
</parent>

<artifactId>example-arjuna-shrinkwrap</artifactId>
<artifactId>example-arjuna</artifactId>

<name>WildFly Swarm Examples: Arjuna ShrinkWrap</name>
<description>WildFly Swarm Examples: Arjuna ShrinkWrap</description>
<name>WildFly Swarm Examples: Arjuna</name>
<description>WildFly Swarm Examples: Arjuna</description>

<packaging>jar</packaging>
<packaging>war</packaging>

<build>
<plugins>
Expand All @@ -47,9 +47,6 @@
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<configuration>
<mainClass>org.wildfly.swarm.examples.arjuna.Main</mainClass>
</configuration>
<executions>
<execution>
<id>package</id>
Expand Down
4 changes: 2 additions & 2 deletions arjuna/pom.xml
Expand Up @@ -23,7 +23,7 @@
<packaging>pom</packaging>

<modules>
<module>arjuna-shrinkwrap</module>
<module>stm-shrinkwrap</module>
<module>arjuna</module>
<module>stm</module>
</modules>
</project>

This file was deleted.

6 changes: 0 additions & 6 deletions arjuna/stm-shrinkwrap/README.md → arjuna/stm/README.md
Expand Up @@ -37,28 +37,22 @@ Additionally, the usual `maven-war-plugin` is provided.
</configuration>
</plugin>

Currently we have to add javax.transactions into the pom.xml for building due to
https://github.com/wildfly-swarm/wildfly-swarm/issues/27

To define the needed parts of WildFly Swarm, a dependency is added

<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>jaxrs</artifactId>
<version>${version.wildfly-swarm}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>transactions</artifactId>
<version>${version.wildfly-swarm}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>msc</artifactId>
<version>${version.wildfly-swarm}</version>
<scope>provided</scope>
</dependency>

## Build
Expand Down
35 changes: 16 additions & 19 deletions arjuna/stm-shrinkwrap/pom.xml → arjuna/stm/pom.xml
Expand Up @@ -22,7 +22,7 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.wildfly.swarm.examples</groupId>
Expand All @@ -31,12 +31,12 @@
<relativePath>../</relativePath>
</parent>

<artifactId>example-stm-shrinkwrap</artifactId>
<artifactId>example-stm</artifactId>

<name>WildFly Swarm Examples: STM ShrinkWrap</name>
<description>WildFly Swarm Examples: STM ShrinkWrap</description>
<name>WildFly Swarm Examples: STM</name>
<description>WildFly Swarm Examples: STM</description>

<packaging>jar</packaging>
<packaging>war</packaging>

<build>
<plugins>
Expand All @@ -45,21 +45,18 @@
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>ObjectStore</directory>
</fileset>
</filesets>
</configuration>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>ObjectStore</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<configuration>
<mainClass>org.wildfly.swarm.examples.stm.Main</mainClass>
</configuration>
<executions>
<execution>
<id>package</id>
Expand All @@ -81,9 +78,9 @@
<artifactId>examples-base</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.narayana.stm</groupId>
<artifactId>stm</artifactId>
<version>5.2.12.Final</version>
<groupId>org.jboss.narayana.stm</groupId>
<artifactId>stm</artifactId>
<version>5.2.12.Final</version>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
Expand Down
5 changes: 2 additions & 3 deletions camel/camel-cxf-jaxrs/pom.xml
Expand Up @@ -33,6 +33,8 @@

<artifactId>example-camel-cxf-jaxrs</artifactId>

<packaging>war</packaging>

<dependencies>
<dependency>
<groupId>org.wildfly.swarm.examples</groupId>
Expand All @@ -49,9 +51,6 @@
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<configuration>
<mainClass>org.wildfly.swarm.examples.camel.cxf.jaxrs.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
Expand Down

This file was deleted.

5 changes: 2 additions & 3 deletions camel/camel-cxf-jaxws/pom.xml
Expand Up @@ -33,6 +33,8 @@

<artifactId>example-camel-cxf-jaxws</artifactId>

<packaging>war</packaging>

<dependencies>
<dependency>
<groupId>org.wildfly.swarm.examples</groupId>
Expand All @@ -49,9 +51,6 @@
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<configuration>
<mainClass>org.wildfly.swarm.examples.camel.cxf.jaxws.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit ac61d71

Please sign in to comment.