Skip to content

Commit

Permalink
Spring 6 examples back
Browse files Browse the repository at this point in the history
Signed-off-by: jansupol <[email protected]>
  • Loading branch information
jansupol authored and senivam committed Sep 5, 2022
1 parent 0f7bd90 commit 9f4bf3c
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 32 deletions.
4 changes: 2 additions & 2 deletions examples/helloworld-spring-annotations/README.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[//]: # " Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved. "
[//]: # " Copyright (c) 2015, 2022 Oracle and/or its affiliates. All rights reserved. "
[//]: # " "
[//]: # " This program and the accompanying materials are made available under the "
[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at "
Expand All @@ -10,7 +10,7 @@ Jersey Spring Integration Spring Helloworld WebApp Example
==========================================================

This example demonstrates how to create simple Jersey application that
utilises Spring 3 DI features based on Spring annotations, packaged into WAR file.
utilises Spring 6 DI features based on Spring annotations, packaged into WAR file.

Contents
--------
Expand Down
45 changes: 37 additions & 8 deletions examples/helloworld-spring-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.examples</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.99-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>helloworld-spring-annotations</artifactId>
<description>Spring 4 Integration Jersey Example</description>
<description>Spring 6 Integration Jersey Example</description>

<repositories>
<repository>
<name>Spring Repository</name>
<id>spring-repository</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>

<dependencies>
<dependency>
Expand All @@ -32,15 +40,36 @@
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring5</artifactId>
<artifactId>jersey-spring6</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring5.version}</version>
<scope>compile</scope>
<version>${spring6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring6.version}</version>
</dependency>

<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
Expand All @@ -52,9 +81,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet5.version}</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -28,7 +28,7 @@ public class App {

private static final URI BASE_URI = URI.create("http://localhost:8080/base/");

public static final String ROOT_PATH = "base";
public static final String ROOT_PATH = "spring-resource";

public static void main(String[] args) {
try {
Expand Down
60 changes: 46 additions & 14 deletions examples/helloworld-spring-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,22 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.99-SNAPSHOT</version>
</parent>

<artifactId>helloworld-spring-webapp</artifactId>
<packaging>war</packaging>
<name>jersey-examples-helloworld-spring-webapp</name>

<description>Spring 4 Integration Jersey Example</description>
<description>Spring 6 Integration Jersey Example</description>

<repositories>
<repository>
<name>Spring Repository</name>
<id>spring-repository</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>

<dependencies>
<dependency>
Expand All @@ -43,11 +51,37 @@
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring4.version}</version>
<scope>compile</scope>
<version>${spring6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring6.version}</version>
</dependency>

<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet5.version}</version>
</dependency>

<dependency>
Expand All @@ -64,17 +98,10 @@

<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring4</artifactId>
<artifactId>jersey-spring6</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api-2.5</artifactId>
<version>${jetty.servlet.api.25.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -86,8 +113,13 @@
<plugins>
<!-- Run the application using "mvn jetty:run" to deploy to Jetty-->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<webApp>
<contextPath>/helloworld-spring-webapp</contextPath>
</webApp>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -10,8 +10,6 @@

package org.glassfish.jersey.examples.helloworld.spring;

import org.springframework.stereotype.Component;

import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down
15 changes: 13 additions & 2 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
<module>helloworld-pure-jax-rs</module>
<module>helloworld-webapp</module>
<module>helloworld-weld</module>
<!-- <module>helloworld-spring-webapp</module>-->
<!-- <module>helloworld-spring-annotations</module>-->
<module>http-patch</module>
<module>http-trace</module>
<module>https-clientserver-grizzly</module>
Expand Down Expand Up @@ -279,4 +277,17 @@
</resources>
</build>

<profiles>
<profile>
<id>jdk17</id>
<activation>
<jdk>[17,)</jdk>
</activation>
<modules>
<module>helloworld-spring-webapp</module>
<module>helloworld-spring-annotations</module>
</modules>
</profile>
</profiles>

</project>

0 comments on commit 9f4bf3c

Please sign in to comment.