Skip to content

Commit

Permalink
enable wildfly plugin in resteasy-spring-rest and resteasy-spring-mvc #…
Browse files Browse the repository at this point in the history
  • Loading branch information
liweinan authored Apr 22, 2022
1 parent 793b612 commit 94dc535
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
21 changes: 21 additions & 0 deletions resteasy-spring-mvc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,24 @@ $ curl http://localhost:8080/rest/foo
```

It will fetch the value of context parameter `foo` defined in `web.xml`. This shows the injection of `ServletContext` by `@Context` annotation.


## Deploying The Project To WildFly

This example has embedded `wildfly-maven-plugin` embedded, so it can be deployed to a managed WildFly server by running the Maven command. Run the following command to build the example, download WildFly server, start the server and finish deployment automatically:

```bash
$ mvn wildfly:run
```

After the embedded WildFly server is downloaded and run, access the example service with following `curl` command:

```bash
$ curl http://localhost:8080/resteasy-spring-mvc/rest/foo
```

And it will print the output result:

```bash
bar
```
11 changes: 11 additions & 0 deletions resteasy-spring-mvc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,16 @@
</dependencies>
<build>
<finalName>resteasy-spring-mvc</finalName>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly-maven-plugin}</version>
<configuration>
<artifactId>wildfly-preview-dist</artifactId>
<version>${version.wildfly}</version>
</configuration>
</plugin>
</plugins>
</build>
</project>
20 changes: 20 additions & 0 deletions resteasy-spring-rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,23 @@ public class SpringRestAnnotationResource {
}
```

## Deploying The Project To WildFly

This example has embedded `wildfly-maven-plugin` embedded, so it can be deployed to a managed WildFly server by running the Maven command. Run the following command to build the example, download WildFly server, start the server and finish deployment automatically:

```bash
$ mvn wildfly:run
```

After the embedded WildFly server is downloaded and run, access the example service with following `curl` command:

```bash
$ curl http://localhost:8080/resteasy-spring-example-rest/spring
```

And it will print the output result:

```bash
Spring is coming!
```

11 changes: 11 additions & 0 deletions resteasy-spring-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,16 @@
</dependencies>
<build>
<finalName>resteasy-spring-example-rest</finalName>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly-maven-plugin}</version>
<configuration>
<artifactId>wildfly-preview-dist</artifactId>
<version>${version.wildfly}</version>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 94dc535

Please sign in to comment.