Compare commits
10 Commits
0465e57be7
...
61b0152318
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61b0152318 | ||
|
|
843076f81c | ||
|
|
b56a00054e | ||
|
|
1eec82748f | ||
|
|
054c9769a8 | ||
|
|
0d0976cc8e | ||
|
|
51abbb89a7 | ||
|
|
98fc09c9c9 | ||
|
|
0a936772d4 | ||
|
|
3f1d834a77 |
180
0001-Patch-out-dependency-on-JMockit.patch
Normal file
180
0001-Patch-out-dependency-on-JMockit.patch
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
From 620e6de1e6054559998605626314ab20b5f090f7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: guoxiaoqi <guoxiaoqi2@huawei.com>
|
||||||
|
Date: Thu, 13 May 2021 17:26:55 +0800
|
||||||
|
Subject: [PATCH] Patch out dependency on JMockit
|
||||||
|
|
||||||
|
Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com>
|
||||||
|
---
|
||||||
|
.../jersey/ext/cdi1x/internal/CdiUtilTest.java | 45 ------------
|
||||||
|
.../internal/scanning/PackageNamesScannerTest.java | 80 ----------------------
|
||||||
|
2 files changed, 125 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/cdi/jersey-cdi1x/src/test/java/org/glassfish/jersey/ext/cdi1x/internal/CdiUtilTest.java b/ext/cdi/jersey-cdi1x/src/test/java/org/glassfish/jersey/ext/cdi1x/internal/CdiUtilTest.java
|
||||||
|
index 0cdafe1..bcc2a66 100644
|
||||||
|
--- a/ext/cdi/jersey-cdi1x/src/test/java/org/glassfish/jersey/ext/cdi1x/internal/CdiUtilTest.java
|
||||||
|
+++ b/ext/cdi/jersey-cdi1x/src/test/java/org/glassfish/jersey/ext/cdi1x/internal/CdiUtilTest.java
|
||||||
|
@@ -28,11 +28,6 @@ import static org.hamcrest.CoreMatchers.instanceOf;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
|
-import mockit.Mock;
|
||||||
|
-import mockit.MockUp;
|
||||||
|
-import mockit.Mocked;
|
||||||
|
-import mockit.Verifications;
|
||||||
|
-
|
||||||
|
/**
|
||||||
|
* Unit tests for {@link org.glassfish.jersey.ext.cdi1x.internal.CdiUtil}.
|
||||||
|
*
|
||||||
|
@@ -48,34 +43,6 @@ public class CdiUtilTest {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- @Test
|
||||||
|
- public void getBeanManagerCustom(@Mocked final TestBeanManagerProvider custom,
|
||||||
|
- @Mocked final DefaultBeanManagerProvider fallback) throws Exception {
|
||||||
|
- CdiUtil.getBeanManager();
|
||||||
|
-
|
||||||
|
- new Verifications() {{
|
||||||
|
- custom.getBeanManager(); times = 1;
|
||||||
|
- fallback.getBeanManager(); times = 0;
|
||||||
|
- }};
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Test
|
||||||
|
- public void getDefaultBeanManagerDefault(@Mocked final DefaultBeanManagerProvider fallback) throws Exception {
|
||||||
|
- new MockUp<CdiUtil>() {
|
||||||
|
- @Mock
|
||||||
|
- @SuppressWarnings("UnusedDeclaration")
|
||||||
|
- <T> T lookupService(final Class<T> clazz) {
|
||||||
|
- return null;
|
||||||
|
- }
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
- CdiUtil.getBeanManager();
|
||||||
|
-
|
||||||
|
- new Verifications() {{
|
||||||
|
- fallback.getBeanManager(); times = 1;
|
||||||
|
- }};
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
@Priority(500)
|
||||||
|
public static class MyServiceOne implements MyService {
|
||||||
|
}
|
||||||
|
@@ -115,16 +82,4 @@ public class CdiUtilTest {
|
||||||
|
assertThat(CdiUtil.createHk2InjectionManagerStore(), instanceOf(TestInjectionManagerStore.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
- @Test
|
||||||
|
- public void createHk2LocatorManagerDefault() throws Exception {
|
||||||
|
- new MockUp<CdiUtil>() {
|
||||||
|
- @Mock
|
||||||
|
- @SuppressWarnings("UnusedDeclaration")
|
||||||
|
- <T> T lookupService(final Class<T> clazz) {
|
||||||
|
- return null;
|
||||||
|
- }
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
- assertThat(CdiUtil.createHk2InjectionManagerStore(), instanceOf(SingleInjectionManagerStore.class));
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
diff --git a/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/scanning/PackageNamesScannerTest.java b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/scanning/PackageNamesScannerTest.java
|
||||||
|
index f8f5668..abc8c49 100644
|
||||||
|
--- a/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/scanning/PackageNamesScannerTest.java
|
||||||
|
+++ b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/scanning/PackageNamesScannerTest.java
|
||||||
|
@@ -16,10 +16,6 @@
|
||||||
|
|
||||||
|
package org.glassfish.jersey.tests.jmockit.server.internal.scanning;
|
||||||
|
|
||||||
|
-import mockit.Expectations;
|
||||||
|
-import mockit.Injectable;
|
||||||
|
-import mockit.Tested;
|
||||||
|
-import mockit.Verifications;
|
||||||
|
import org.glassfish.jersey.server.internal.scanning.PackageNamesScanner;
|
||||||
|
import org.glassfish.jersey.server.internal.scanning.ResourceFinderException;
|
||||||
|
import org.junit.Before;
|
||||||
|
@@ -94,82 +90,6 @@ public class PackageNamesScannerTest {
|
||||||
|
new PackageNamesScanner(createTestClassLoader("bad", createTestURLStreamHandler("bad"), jaxRsApiPath), packages, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
-
|
||||||
|
- @Tested
|
||||||
|
- PackageNamesScanner scanner1 = new PackageNamesScanner(new String[]{"javax.ws.rs"}, false);
|
||||||
|
- @Tested
|
||||||
|
- PackageNamesScanner scanner2 = new PackageNamesScanner(new String[]{"javax.ws.rs.core"}, false);
|
||||||
|
- @Tested
|
||||||
|
- PackageNamesScanner scanner3 = new PackageNamesScanner(new String[]{"javax.ws.rs.client"}, false);
|
||||||
|
-
|
||||||
|
- /**
|
||||||
|
- * Reproducer for OWLS-19790: When scanner is reset the underlying JAR input streams should be closed.
|
||||||
|
- */
|
||||||
|
- @Test
|
||||||
|
- public void testInputStreamClosedAfterReset() throws Exception {
|
||||||
|
- JarInputStream stream = new JarInputStream(
|
||||||
|
- new ByteArrayInputStream("test".getBytes(), 0, 4));
|
||||||
|
-
|
||||||
|
- new Expectations(InputStream.class){};
|
||||||
|
-
|
||||||
|
- scanner1.reset();
|
||||||
|
-
|
||||||
|
- scanner2.reset();
|
||||||
|
- scanner2.reset();
|
||||||
|
-
|
||||||
|
- scanner3.reset();
|
||||||
|
-
|
||||||
|
- new Verifications() {{
|
||||||
|
- stream.close();
|
||||||
|
- times = 4;
|
||||||
|
- }};
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /**
|
||||||
|
- * Reproducer for OWLS-19790: When scanner is closed the underlying JAR input streams should be closed as well.
|
||||||
|
- */
|
||||||
|
- @Test
|
||||||
|
- public void testInputStreamClosedAfterClose() throws Exception {
|
||||||
|
-
|
||||||
|
- JarInputStream stream = new JarInputStream(
|
||||||
|
- new ByteArrayInputStream("test".getBytes(), 0, 4));
|
||||||
|
-
|
||||||
|
- new Expectations(JarInputStream.class){};
|
||||||
|
-
|
||||||
|
- scanner1.close();
|
||||||
|
-
|
||||||
|
- scanner2.close();
|
||||||
|
- scanner2.close();
|
||||||
|
-
|
||||||
|
- scanner3.close();
|
||||||
|
-
|
||||||
|
- new Verifications() {{
|
||||||
|
- stream.close();
|
||||||
|
- times = 3;
|
||||||
|
- }};
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /**
|
||||||
|
- * Reproducer for OWLS-19790: When we iterate through the all entries provided by a scanner JAR input stream should be closed.
|
||||||
|
- */
|
||||||
|
- @Tested
|
||||||
|
- PackageNamesScanner scanner = new PackageNamesScanner(new String[]{"javax.ws.rs"}, false);
|
||||||
|
- @Test
|
||||||
|
- public void testInputStreamClosedAfterIteration(@Injectable("false") boolean recursive) throws Exception {
|
||||||
|
- JarInputStream stream = new JarInputStream(
|
||||||
|
- new ByteArrayInputStream("test".getBytes(), 0, 4));
|
||||||
|
-
|
||||||
|
- new Expectations(JarInputStream.class) {{
|
||||||
|
- stream.getNextJarEntry();
|
||||||
|
- result = null;
|
||||||
|
- stream.close();
|
||||||
|
- }};
|
||||||
|
-
|
||||||
|
- while (scanner.hasNext()) {
|
||||||
|
- scanner.next();
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
private ClassLoader createTestClassLoader(final String scheme,
|
||||||
|
final URLStreamHandler urlStreamHandler,
|
||||||
|
final String resourceFilePath) {
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
100
0001-Port-to-hibernate-validation-5.x.patch
Normal file
100
0001-Port-to-hibernate-validation-5.x.patch
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
From 227cdb9bce8e2b5f20983e8c0a600b56233fdbcb Mon Sep 17 00:00:00 2001
|
||||||
|
From: guoxiaoqi <guoxiaoqi2@huawei.com>
|
||||||
|
Date: Thu, 13 May 2021 17:10:06 +0800
|
||||||
|
Subject: [PATCH] Port to hibernate validation 5.x
|
||||||
|
|
||||||
|
Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com>
|
||||||
|
---
|
||||||
|
ext/bean-validation/pom.xml | 2 +-
|
||||||
|
ext/cdi/jersey-cdi1x-validation/pom.xml | 2 +-
|
||||||
|
.../jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java | 4 ++--
|
||||||
|
.../cdi1x/validation/internal/CdiInterceptorWrapperExtension.java | 2 +-
|
||||||
|
pom.xml | 6 +++---
|
||||||
|
5 files changed, 8 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/bean-validation/pom.xml b/ext/bean-validation/pom.xml
|
||||||
|
index d490857..6fe0bc3 100644
|
||||||
|
--- a/ext/bean-validation/pom.xml
|
||||||
|
+++ b/ext/bean-validation/pom.xml
|
||||||
|
@@ -87,7 +87,7 @@
|
||||||
|
<artifactId>jakarta.validation-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
- <groupId>org.hibernate.validator</groupId>
|
||||||
|
+ <groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-validator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
diff --git a/ext/cdi/jersey-cdi1x-validation/pom.xml b/ext/cdi/jersey-cdi1x-validation/pom.xml
|
||||||
|
index 7991cef..a4436a8 100644
|
||||||
|
--- a/ext/cdi/jersey-cdi1x-validation/pom.xml
|
||||||
|
+++ b/ext/cdi/jersey-cdi1x-validation/pom.xml
|
||||||
|
@@ -41,7 +41,7 @@
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
- <groupId>org.hibernate.validator</groupId>
|
||||||
|
+ <groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
diff --git a/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java b/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java
|
||||||
|
index 1d3d9d9..5175ae9 100644
|
||||||
|
--- a/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java
|
||||||
|
+++ b/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java
|
||||||
|
@@ -27,8 +27,8 @@ import javax.interceptor.AroundInvoke;
|
||||||
|
import javax.interceptor.Interceptor;
|
||||||
|
import javax.interceptor.InvocationContext;
|
||||||
|
|
||||||
|
-import org.hibernate.validator.cdi.internal.interceptor.MethodValidated;
|
||||||
|
-import org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor;
|
||||||
|
+import org.hibernate.validator.internal.cdi.interceptor.MethodValidated;
|
||||||
|
+import org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JAX-RS wrapper for Hibernate CDI bean validation interceptor.
|
||||||
|
diff --git a/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java b/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java
|
||||||
|
index acd1b5c..0561d0e 100644
|
||||||
|
--- a/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java
|
||||||
|
+++ b/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java
|
||||||
|
@@ -43,7 +43,7 @@ import javax.interceptor.Interceptor;
|
||||||
|
import org.glassfish.jersey.internal.util.collection.Cache;
|
||||||
|
import org.glassfish.jersey.server.model.Resource;
|
||||||
|
|
||||||
|
-import org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor;
|
||||||
|
+import org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CDI extension to register {@link CdiInterceptorWrapper}.
|
||||||
|
diff --git a/pom.xml b/pom.xml
|
||||||
|
index d07459d..38eda41 100644
|
||||||
|
--- a/pom.xml
|
||||||
|
+++ b/pom.xml
|
||||||
|
@@ -1810,13 +1810,13 @@
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
- <groupId>org.hibernate.validator</groupId>
|
||||||
|
+ <groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-validator</artifactId>
|
||||||
|
<version>${validation.impl.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
- <groupId>org.hibernate.validator</groupId>
|
||||||
|
+ <groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
|
<version>${validation.impl.version}</version>
|
||||||
|
</dependency>
|
||||||
|
@@ -2136,7 +2136,7 @@
|
||||||
|
<spring4.version>4.3.20.RELEASE</spring4.version>
|
||||||
|
<spring5.version>5.1.5.RELEASE</spring5.version>
|
||||||
|
<surefire.version>3.0.0-M3</surefire.version>
|
||||||
|
- <validation.impl.version>6.0.17.Final</validation.impl.version>
|
||||||
|
+ <validation.impl.version>5.2.4.Final</validation.impl.version>
|
||||||
|
<weld.version>2.2.14.Final</weld.version> <!-- 2.4.1 doesn't work - bv tests -->
|
||||||
|
<weld3.version>3.0.0.Final</weld3.version>
|
||||||
|
<xerces.version>2.11.0</xerces.version>
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
38
0002-Port-to-glassfish-jsonp-1.0.patch
Normal file
38
0002-Port-to-glassfish-jsonp-1.0.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From 45c9f9249a863f46a85888679730c49f1b7f7bda Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mat Booth <mat.booth@redhat.com>
|
||||||
|
Date: Mon, 11 Mar 2019 13:50:10 +0000
|
||||||
|
Subject: [PATCH 2/3] Port to glassfish/jsonp 1.0
|
||||||
|
|
||||||
|
---
|
||||||
|
.../org/glassfish/jersey/jsonp/JsonProcessingFeature.java | 8 ++++----
|
||||||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/media/json-processing/src/main/java/org/glassfish/jersey/jsonp/JsonProcessingFeature.java b/media/json-processing/src/main/java/org/glassfish/jersey/jsonp/JsonProcessingFeature.java
|
||||||
|
index c065770..226dc59 100644
|
||||||
|
--- a/media/json-processing/src/main/java/org/glassfish/jersey/jsonp/JsonProcessingFeature.java
|
||||||
|
+++ b/media/json-processing/src/main/java/org/glassfish/jersey/jsonp/JsonProcessingFeature.java
|
||||||
|
@@ -22,8 +22,8 @@ import javax.ws.rs.core.FeatureContext;
|
||||||
|
|
||||||
|
import org.glassfish.jersey.CommonProperties;
|
||||||
|
|
||||||
|
-import org.glassfish.json.jaxrs.JsonValueBodyReader;
|
||||||
|
-import org.glassfish.json.jaxrs.JsonValueBodyWriter;
|
||||||
|
+import org.glassfish.json.jaxrs.JsonStructureBodyReader;
|
||||||
|
+import org.glassfish.json.jaxrs.JsonStructureBodyWriter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link Feature} used to register JSON-P providers.
|
||||||
|
@@ -41,8 +41,8 @@ public class JsonProcessingFeature implements Feature {
|
||||||
|
|
||||||
|
// Make sure JSON-P workers have higher priority than other Json providers (in case there is a need to use JSON-P and some
|
||||||
|
// other provider in an application).
|
||||||
|
- context.register(JsonValueBodyReader.class, Priorities.USER + 1000);
|
||||||
|
- context.register(JsonValueBodyWriter.class, Priorities.USER + 1000);
|
||||||
|
+ context.register(JsonStructureBodyReader.class, Priorities.USER + 1000);
|
||||||
|
+ context.register(JsonStructureBodyWriter.class, Priorities.USER + 1000);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
126
CVE-2021-28168.patch
Normal file
126
CVE-2021-28168.patch
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
From f3cadb38dcc5b20e515706fae68dce533ad6c737 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Maxim Nesen <24524084+senivam@users.noreply.github.com>
|
||||||
|
Date: Thu, 4 Mar 2021 11:36:50 +0100
|
||||||
|
Subject: [PATCH] switching to NIO tmp file creation approach (#4712)
|
||||||
|
|
||||||
|
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
|
||||||
|
---
|
||||||
|
.../jersey/message/internal/Utils.java | 26 +++++++++--
|
||||||
|
.../jersey/message/internal/UtilsTest.java | 45 +++++++++++++++++++
|
||||||
|
.../src/test/resources/surefire.policy | 4 +-
|
||||||
|
3 files changed, 70 insertions(+), 5 deletions(-)
|
||||||
|
create mode 100644 core-common/src/test/java/org/glassfish/jersey/message/internal/UtilsTest.java
|
||||||
|
|
||||||
|
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java
|
||||||
|
index c4f035ee10..dcae919502 100644
|
||||||
|
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java
|
||||||
|
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java
|
||||||
|
@@ -18,6 +18,10 @@
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
+import java.nio.file.Files;
|
||||||
|
+import java.security.AccessController;
|
||||||
|
+import java.security.PrivilegedAction;
|
||||||
|
+import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility class.
|
||||||
|
@@ -46,9 +50,23 @@ static void throwIllegalArgumentExceptionIfNull(final Object toCheck, final Stri
|
||||||
|
* @throws IOException if a file could not be created.
|
||||||
|
*/
|
||||||
|
public static File createTempFile() throws IOException {
|
||||||
|
- final File file = File.createTempFile("rep", "tmp");
|
||||||
|
- // Make sure the file is deleted when JVM is shutdown at last.
|
||||||
|
- file.deleteOnExit();
|
||||||
|
+ final AtomicReference<IOException> exceptionReference = new AtomicReference<>();
|
||||||
|
+ final File file = AccessController.doPrivileged(new PrivilegedAction<File>() {
|
||||||
|
+ public File run() {
|
||||||
|
+ File tempFile = null;
|
||||||
|
+ try {
|
||||||
|
+ tempFile = Files.createTempFile("rep", "tmp").toFile();
|
||||||
|
+ // Make sure the file is deleted when JVM is shutdown at last.
|
||||||
|
+ tempFile.deleteOnExit();
|
||||||
|
+ } catch (IOException e) {
|
||||||
|
+ exceptionReference.set(e);
|
||||||
|
+ }
|
||||||
|
+ return tempFile;
|
||||||
|
+ }
|
||||||
|
+ });
|
||||||
|
+ if (exceptionReference.get() != null) {
|
||||||
|
+ throw exceptionReference.get();
|
||||||
|
+ }
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/core-common/src/test/java/org/glassfish/jersey/message/internal/UtilsTest.java b/core-common/src/test/java/org/glassfish/jersey/message/internal/UtilsTest.java
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..e6baf4c404
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/core-common/src/test/java/org/glassfish/jersey/message/internal/UtilsTest.java
|
||||||
|
@@ -0,0 +1,45 @@
|
||||||
|
+/*
|
||||||
|
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
|
||||||
|
+ *
|
||||||
|
+ * This program and the accompanying materials are made available under the
|
||||||
|
+ * terms of the Eclipse Public License v. 2.0, which is available at
|
||||||
|
+ * http://www.eclipse.org/legal/epl-2.0.
|
||||||
|
+ *
|
||||||
|
+ * This Source Code may also be made available under the following Secondary
|
||||||
|
+ * Licenses when the conditions for such availability set forth in the
|
||||||
|
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
|
||||||
|
+ * version 2 with the GNU Classpath Exception, which is available at
|
||||||
|
+ * https://www.gnu.org/software/classpath/license.html.
|
||||||
|
+ *
|
||||||
|
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+package org.glassfish.jersey.message.internal;
|
||||||
|
+
|
||||||
|
+import org.junit.Assert;
|
||||||
|
+import org.junit.Test;
|
||||||
|
+
|
||||||
|
+import java.io.BufferedOutputStream;
|
||||||
|
+import java.io.ByteArrayInputStream;
|
||||||
|
+import java.io.File;
|
||||||
|
+import java.io.FileOutputStream;
|
||||||
|
+import java.io.IOException;
|
||||||
|
+import java.io.OutputStream;
|
||||||
|
+
|
||||||
|
+public class UtilsTest {
|
||||||
|
+
|
||||||
|
+ @Test
|
||||||
|
+ public void createTempFile() throws IOException {
|
||||||
|
+ final File file = Utils.createTempFile();
|
||||||
|
+ final OutputStream stream = new BufferedOutputStream(new FileOutputStream(file));
|
||||||
|
+
|
||||||
|
+ try {
|
||||||
|
+ final ByteArrayInputStream entityStream = new ByteArrayInputStream("Test stream byte input".getBytes());
|
||||||
|
+ ReaderWriter.writeTo(entityStream, stream);
|
||||||
|
+ } finally {
|
||||||
|
+ stream.close();
|
||||||
|
+ }
|
||||||
|
+ Assert.assertTrue(file.exists());
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+}
|
||||||
|
diff --git a/core-common/src/test/resources/surefire.policy b/core-common/src/test/resources/surefire.policy
|
||||||
|
index 77fa02af3b..27602ae4c0 100644
|
||||||
|
--- a/core-common/src/test/resources/surefire.policy
|
||||||
|
+++ b/core-common/src/test/resources/surefire.policy
|
||||||
|
@@ -30,6 +30,7 @@ grant codebase "file:${project.build.directory}/test-classes/-" {
|
||||||
|
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
|
||||||
|
permission java.lang.RuntimePermission "modifyThread";
|
||||||
|
permission java.util.PropertyPermission "*", "write";
|
||||||
|
+ permission java.io.FilePermission "${java.io.tmpdir}/-", "read,write,delete";
|
||||||
|
permission java.lang.RuntimePermission "getClassLoader";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc.*";
|
||||||
|
@@ -43,6 +44,7 @@ grant codebase "file:${project.build.directory}/classes/-" {
|
||||||
|
permission java.lang.RuntimePermission "modifyThread";
|
||||||
|
permission java.util.PropertyPermission "*", "read";
|
||||||
|
permission java.io.FilePermission "<<ALL FILES>>", "read";
|
||||||
|
+ permission java.io.FilePermission "${java.io.tmpdir}/-", "read,write,delete";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc.*";
|
||||||
|
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
|
||||||
202
LICENSE-2.0.txt
Normal file
202
LICENSE-2.0.txt
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
26
jersey-2.17-mvc-jsp-servlet31.patch
Normal file
26
jersey-2.17-mvc-jsp-servlet31.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
--- jersey-2.17/ext/mvc-jsp/src/main/java/org/glassfish/jersey/server/mvc/jsp/JspTemplateProcessor.java 2015-03-11 13:39:18.000000000 +0100
|
||||||
|
+++ jersey-2.17/ext/mvc-jsp/src/main/java/org/glassfish/jersey/server/mvc/jsp/JspTemplateProcessor.java.servlet31 2015-05-19 16:08:00.012125072 +0200
|
||||||
|
@@ -55,6 +55,7 @@
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
+import javax.servlet.WriteListener;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletResponseWrapper;
|
||||||
|
@@ -129,6 +130,15 @@
|
||||||
|
|
||||||
|
// OutputStream and Writer for HttpServletResponseWrapper.
|
||||||
|
final ServletOutputStream responseStream = new ServletOutputStream() {
|
||||||
|
+
|
||||||
|
+ public void setWriteListener(WriteListener listener) {
|
||||||
|
+ throw new UnsupportedOperationException("Not implemented yet.");
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public boolean isReady() {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
@Override
|
||||||
|
public void write(final int b) throws IOException {
|
||||||
|
out.write(b);
|
||||||
BIN
jersey-2.29.1.tar.gz
Normal file
BIN
jersey-2.29.1.tar.gz
Normal file
Binary file not shown.
236
jersey.spec
Normal file
236
jersey.spec
Normal file
@ -0,0 +1,236 @@
|
|||||||
|
%bcond_with jp_minimal
|
||||||
|
Name: jersey
|
||||||
|
Version: 2.29.1
|
||||||
|
Release: 3
|
||||||
|
Summary: JAX-RS (JSR 311) production quality Reference Implementation
|
||||||
|
License: (EPL-2.0 or GPLv2 with exceptions) and ASL 2.0
|
||||||
|
URL: https://github.com/eclipse-ee4j/jersey
|
||||||
|
Source0: https://github.com/eclipse-ee4j/jersey/archive/%{version}/%{name}-%{version}.tar.gz
|
||||||
|
Source1: http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||||
|
Patch0: jersey-2.17-mvc-jsp-servlet31.patch
|
||||||
|
Patch1: 0001-Patch-out-dependency-on-JMockit.patch
|
||||||
|
Patch2: 0002-Port-to-glassfish-jsonp-1.0.patch
|
||||||
|
Patch3: 0001-Port-to-hibernate-validation-5.x.patch
|
||||||
|
Patch4: CVE-2021-28168.patch
|
||||||
|
BuildRequires: maven-local mvn(com.fasterxml.jackson.core:jackson-annotations)
|
||||||
|
BuildRequires: mvn(com.fasterxml.jackson.core:jackson-databind)
|
||||||
|
BuildRequires: mvn(com.fasterxml.jackson.module:jackson-module-jaxb-annotations)
|
||||||
|
BuildRequires: mvn(com.google.guava:guava:18.0)
|
||||||
|
BuildRequires: mvn(com.sun.istack:istack-commons-maven-plugin) mvn(com.sun:tools)
|
||||||
|
BuildRequires: mvn(jakarta.ws.rs:jakarta.ws.rs-api) mvn(javax.annotation:javax.annotation-api)
|
||||||
|
BuildRequires: mvn(javax.inject:javax.inject) mvn(javax.xml.bind:jaxb-api)
|
||||||
|
BuildRequires: mvn(javax.validation:validation-api) mvn(org.apache.felix:maven-bundle-plugin)
|
||||||
|
BuildRequires: mvn(org.apache.httpcomponents:httpclient)
|
||||||
|
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin)
|
||||||
|
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
|
||||||
|
BuildRequires: mvn(org.eclipse.jetty:jetty-client) mvn(org.glassfish.hk2:hk2-bom:pom:)
|
||||||
|
BuildRequires: mvn(org.glassfish.hk2:hk2-locator) mvn(org.glassfish.hk2:osgi-resource-locator)
|
||||||
|
BuildRequires: mvn(org.osgi:org.osgi.core) mvn(org.ow2.asm:asm) mvn(xerces:xercesImpl)
|
||||||
|
%if %{without jp_minimal}
|
||||||
|
BuildRequires: mvn(com.github.spullara.mustache.java:compiler) mvn(io.reactivex:rxjava)
|
||||||
|
BuildRequires: mvn(javax.el:javax.el-api) mvn(javax.enterprise:cdi-api)
|
||||||
|
BuildRequires: mvn(javax.json:javax.json-api) mvn(javax.persistence:persistence-api)
|
||||||
|
BuildRequires: mvn(javax.servlet:javax.servlet-api) mvn(javax.servlet.jsp:jsp-api)
|
||||||
|
BuildRequires: mvn(javax.servlet:servlet-api) mvn(junit:junit)
|
||||||
|
BuildRequires: mvn(org.codehaus.jettison:jettison) mvn(org.eclipse.jetty:jetty-continuation)
|
||||||
|
BuildRequires: mvn(org.eclipse.jetty:jetty-server) mvn(org.eclipse.jetty:jetty-util)
|
||||||
|
BuildRequires: mvn(org.eclipse.jetty:jetty-webapp) mvn(org.freemarker:freemarker)
|
||||||
|
BuildRequires: mvn(org.glassfish.grizzly:grizzly-http-server)
|
||||||
|
BuildRequires: mvn(org.glassfish.grizzly:grizzly-http-servlet) mvn(org.glassfish:javax.el)
|
||||||
|
BuildRequires: mvn(org.glassfish:javax.json) mvn(org.glassfish:jsonp-jaxrs)
|
||||||
|
BuildRequires: mvn(org.hamcrest:hamcrest-library) mvn(org.hibernate:hibernate-validator)
|
||||||
|
BuildRequires: mvn(org.hibernate:hibernate-validator-cdi) mvn(org.jboss:jboss-vfs)
|
||||||
|
BuildRequires: mvn(org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.2_spec)
|
||||||
|
BuildRequires: mvn(org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec)
|
||||||
|
BuildRequires: mvn(org.jboss.weld.se:weld-se-core) mvn(org.jvnet.mimepull:mimepull)
|
||||||
|
BuildRequires: mvn(org.mockito:mockito-all) mvn(org.simpleframework:simple-common)
|
||||||
|
BuildRequires: mvn(org.simpleframework:simple-http) mvn(org.simpleframework:simple-transport)
|
||||||
|
BuildRequires: mvn(org.testng:testng) mvn(org.apache.maven.plugins:maven-antrun-plugin)
|
||||||
|
BuildRequires: mvn(org.glassfish.hk2:hk2) mvn(org.glassfish.hk2:spring-bridge) mvn(org.aspectj:aspectjrt) mvn(org.aspectj:aspectjweaver) mvn(org.springframework:spring-aop)
|
||||||
|
BuildRequires: mvn(org.springframework:spring-beans) mvn(org.springframework:spring-beans) mvn(org.springframework:spring-core) mvn(org.springframework:spring-web) mvn(org.springframework:spring-aop)
|
||||||
|
#BuildRequires: mvn(org.eclipse.microprofile.config:microprofile-config-api) mvn(org.eclipse.microprofile.rest.client:microprofile-rest-client-api) mvn(javax.json:javax.json-api)
|
||||||
|
#BuildRequires: mvn(org.eclipse.microprofile.config:microprofile-config-api) mvn(io.helidon.microprofile.config:helidon-microprofile-config)
|
||||||
|
%endif
|
||||||
|
BuildArch: noarch
|
||||||
|
%description
|
||||||
|
Jersey is the open source JAX-RS (JSR 311)
|
||||||
|
production quality Reference Implementation
|
||||||
|
for building RESTful Web services.
|
||||||
|
%if %{without jp_minimal}
|
||||||
|
|
||||||
|
%package test-framework
|
||||||
|
Summary: Jersey Test Framework
|
||||||
|
%description test-framework
|
||||||
|
%{summary}.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%package javadoc
|
||||||
|
Summary: Javadoc for %{name}
|
||||||
|
%description javadoc
|
||||||
|
This package contains javadoc for %{name}.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{name}-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
|
%patch4 -p1
|
||||||
|
find . -name "*.jar" -print -delete
|
||||||
|
find . -name "*.class" -print -delete
|
||||||
|
cp -p %{SOURCE1} .
|
||||||
|
sed -i 's/\r//' LICENSE-2.0.txt
|
||||||
|
#rm -r core-server/src/main/java/jersey
|
||||||
|
#find core-server -name "*.java" -exec sed -i "s|jersey.repackaged.||" {} +
|
||||||
|
#rm -r core-common/src/main/java/org/glassfish/jersey/internal/guava
|
||||||
|
#grep -rl --include=*.java org.glassfish.jersey.internal.guava | xargs sed -i "s|org\.glassfish\.jersey\.internal\.guava|com.google.common.base|"
|
||||||
|
find core-* containers/{grizzly2,jdk,jetty}-http media/sse ext/{entity-filtering,bean-validation,rx} -name "*.java" -exec sed -i \
|
||||||
|
-e "/base\.Cache/s/common\.base/common.cache/" \
|
||||||
|
-e "/base\.LoadingCache/s/common\.base/common.cache/" \
|
||||||
|
-e "/base\.Multimap/s/common\.base/common.collect/" \
|
||||||
|
-e "/base\.....Multimap/s/common\.base/common.collect/" \
|
||||||
|
-e "/base\.HashBasedTable/s/common\.base/common.collect/" \
|
||||||
|
-e "/base\.Table/s/common\.base/common.collect/" \
|
||||||
|
-e "/base\.ThreadFactoryBuilder/s/common\.base/common.util.concurrent/" \
|
||||||
|
-e "/base\.InetAddresses/s/common\.base/common.net/" \
|
||||||
|
-e "/base\.Primitives/s/common\.base/common.primitives/" {} +
|
||||||
|
%pom_add_dep 'com.google.guava:guava:${guava.version}' core-common inject/hk2
|
||||||
|
%pom_xpath_set "pom:dependency[pom:artifactId = 'guava']/pom:scope" provided containers/jdk-http
|
||||||
|
%pom_add_dep 'org.ow2.asm:asm:${asm.version}' core-server
|
||||||
|
%pom_remove_parent bom .
|
||||||
|
%pom_change_dep -r jakarta.servlet:jakarta.servlet-api javax.servlet:javax.servlet-api . test-framework
|
||||||
|
%pom_change_dep -r jakarta.servlet.jsp:jakarta.servlet.jsp-api javax.servlet.jsp:jsp-api
|
||||||
|
%pom_change_dep -r jakarta.xml.bind:jakarta.xml.bind-api javax.xml.bind:jaxb-api
|
||||||
|
%pom_change_dep -r jakarta.annotation:jakarta.annotation-api javax.annotation:javax.annotation-api
|
||||||
|
%pom_change_dep -r jakarta.persistence:jakarta.persistence-api javax.persistence:persistence-api
|
||||||
|
%pom_change_dep -r org.glassfish.hk2.external:jakarta.inject javax.inject:javax.inject
|
||||||
|
%pom_change_dep -r jakarta.el:jakarta.el-api javax.el:javax.el-api
|
||||||
|
%pom_change_dep -r org.glassfish:jakarta.el org.glassfish:javax.el
|
||||||
|
%pom_change_dep -r org.glassfish:jakarta.json org.glassfish:javax.json
|
||||||
|
%pom_change_dep -r jakarta.validation:jakarta.validation-api javax.validation:validation-api
|
||||||
|
%pom_change_dep -r jakarta.json:jakarta.json-api javax.json:javax.json-api
|
||||||
|
%pom_add_dep javax.json:javax.json-api:1.0 media/json-processing
|
||||||
|
%pom_change_dep javax:javaee-api javax.enterprise:cdi-api:'${cdi.api.version}':provided ext/cdi/jersey-cdi1x-transaction
|
||||||
|
%pom_add_dep org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Alpha3:provided ext/cdi/jersey-cdi1x-transaction
|
||||||
|
%pom_add_dep org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.2_spec:1.0.0.Alpha3:provided ext/cdi/jersey-cdi1x-validation
|
||||||
|
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:artifactId = 'tools']/pom:scope" ext/wadl-doclet
|
||||||
|
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:artifactId = 'tools']/pom:systemPath" ext/wadl-doclet
|
||||||
|
%pom_remove_dep -r org.mortbay.jetty:servlet-api-2.5
|
||||||
|
%pom_remove_dep -r org.jmockit:jmockit
|
||||||
|
%pom_xpath_remove pom:build/pom:extensions
|
||||||
|
%pom_remove_plugin :buildnumber-maven-plugin
|
||||||
|
%pom_remove_plugin :buildnumber-maven-plugin core-common
|
||||||
|
%pom_remove_plugin :findbugs-maven-plugin
|
||||||
|
%pom_remove_plugin :maven-checkstyle-plugin
|
||||||
|
%pom_remove_plugin :maven-source-plugin
|
||||||
|
%pom_remove_plugin :maven-jflex-plugin media/moxy
|
||||||
|
%pom_remove_plugin :maven-jflex-plugin media/jaxb
|
||||||
|
%pom_xpath_remove "pom:plugin[pom:artifactId = 'maven-javadoc-plugin' ]/pom:executions"
|
||||||
|
%pom_disable_module archetypes
|
||||||
|
%pom_disable_module incubator
|
||||||
|
%pom_disable_module netty-http containers
|
||||||
|
%pom_remove_dep :jersey-container-netty-http bom
|
||||||
|
%pom_disable_module netty-connector connectors
|
||||||
|
%pom_remove_dep :jersey-netty-connector bom
|
||||||
|
%pom_disable_module netty test-framework/providers
|
||||||
|
%pom_remove_dep :jersey-test-framework-provider-netty test-framework/providers/bundle
|
||||||
|
%pom_disable_module servlet-portability ext
|
||||||
|
%pom_remove_dep :jersey-servlet-portability bom
|
||||||
|
%pom_disable_module json-jackson1 media
|
||||||
|
%pom_remove_dep :jersey-media-json-jackson1 bom
|
||||||
|
%pom_disable_module json-binding media
|
||||||
|
%pom_remove_dep :jersey-media-json-binding bom
|
||||||
|
%pom_disable_module moxy media
|
||||||
|
%pom_remove_dep :jersey-media-moxy bom
|
||||||
|
%pom_disable_module spring4 ext
|
||||||
|
%pom_remove_dep :jersey-spring4 bom
|
||||||
|
%pom_disable_module grizzly-connector connectors
|
||||||
|
%pom_remove_dep :jersey-grizzly-connector bom
|
||||||
|
%pom_remove_dep org.glassfish.jersey.connectors:jersey-grizzly-connector media/multipart
|
||||||
|
%pom_disable_module mp-rest-client ext/microprofile
|
||||||
|
%pom_disable_module mp-config ext/microprofile
|
||||||
|
rm media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/MultiPartHeaderModificationTest.java
|
||||||
|
%pom_disable_module glassfish containers
|
||||||
|
%pom_remove_dep :jersey-gf-ejb bom
|
||||||
|
%pom_disable_module cdi2-se inject
|
||||||
|
%pom_remove_dep :jersey-cdi2-se bom
|
||||||
|
%pom_disable_module rx-client-rxjava2 ext/rx
|
||||||
|
%pom_remove_dep :jersey-rx-client-rxjava2 bom
|
||||||
|
%pom_disable_module maven test-framework
|
||||||
|
%pom_remove_plugin com.sun.tools.xjc.maven2: core-server
|
||||||
|
%if %{with jp_minimal}
|
||||||
|
%pom_disable_module bom
|
||||||
|
%pom_disable_module containers
|
||||||
|
%pom_disable_module security
|
||||||
|
%pom_disable_module json-jettison media
|
||||||
|
%pom_disable_module json-processing media
|
||||||
|
%pom_disable_module multipart media
|
||||||
|
%pom_disable_module sse media
|
||||||
|
%pom_disable_module bean-validation ext
|
||||||
|
%pom_disable_module cdi ext
|
||||||
|
%pom_disable_module metainf-services ext
|
||||||
|
%pom_disable_module mvc ext
|
||||||
|
%pom_disable_module mvc-bean-validation ext
|
||||||
|
%pom_disable_module mvc-freemarker ext
|
||||||
|
%pom_disable_module mvc-jsp ext
|
||||||
|
%pom_disable_module mvc-mustache ext
|
||||||
|
%pom_disable_module proxy-client ext
|
||||||
|
%pom_disable_module rx ext
|
||||||
|
%pom_disable_module microprofile ext
|
||||||
|
%endif
|
||||||
|
%pom_xpath_inject "pom:plugin/pom:configuration/pom:instructions" \
|
||||||
|
'<Require-Bundle>org.glassfish.jersey.inject.jersey-hk2;bundle-version="%{version}"</Require-Bundle>' core-common
|
||||||
|
cp -p inject/hk2/src/main/resources/META-INF/services/org.glassfish.jersey.internal.inject.InjectionManagerFactory \
|
||||||
|
core-common/src/main/resources/META-INF/services
|
||||||
|
sed -i -e 's/javax\.annotation\.\*;version="!"/javax.annotation.*/' $(find -name pom.xml)
|
||||||
|
sed -i -e 's/javax\.activation\.\*;/javax.activation.*;resolution:=optional;/' core-common/pom.xml
|
||||||
|
%mvn_file "org.glassfish.jersey.connectors:project" %{name}/connectors-project
|
||||||
|
%mvn_file "org.glassfish.jersey.containers:project" %{name}/containers-project
|
||||||
|
%mvn_file "org.glassfish.jersey.ext:project" %{name}/ext-project
|
||||||
|
%mvn_file "org.glassfish.jersey.ext.cdi:project" %{name}/ext-cdi-project
|
||||||
|
%mvn_file "org.glassfish.jersey.ext.rx:project" %{name}/ext-rx-project
|
||||||
|
%mvn_file "org.glassfish.jersey.inject:project" %{name}/inject-project
|
||||||
|
%mvn_file "org.glassfish.jersey.media:project" %{name}/media-project
|
||||||
|
%mvn_file "org.glassfish.jersey.security:project" %{name}/security-project
|
||||||
|
%mvn_file "org.glassfish.jersey.test-framework:project" %{name}/test-framework-project
|
||||||
|
%mvn_file "org.glassfish.jersey.test-framework.providers:project" %{name}/test-framework-providers-project
|
||||||
|
%mvn_file "org.glassfish.jersey.ext.microprofile:project" %{name}/ext-microprofile-project
|
||||||
|
%mvn_package "org.glassfish.jersey.test-framework*:" test-framework
|
||||||
|
|
||||||
|
%build
|
||||||
|
%if %{without jp_minimal}
|
||||||
|
%mvn_build -- -PsecurityOff -Dasm.version=6.2.1 -Dmaven.test.failure.ignore=true \
|
||||||
|
-Dexamples.excluded -Dtests.excluded -Dbundles.excluded -Dmaven.test.skip=true
|
||||||
|
%else
|
||||||
|
%mvn_build -f -- -PsecurityOff -Dasm.version=6.2.1 -Dmaven.test.failure.ignore=true \
|
||||||
|
-Dexamples.excluded -Dtests.excluded -Dbundles.excluded -Dtest-framework.excluded \
|
||||||
|
-Dmaven.test.skip=true
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%install
|
||||||
|
%mvn_install
|
||||||
|
|
||||||
|
%files -f .mfiles
|
||||||
|
%doc README.md CONTRIBUTING.md
|
||||||
|
%license LICENSE.md NOTICE.md LICENSE-2.0.txt
|
||||||
|
%if %{without jp_minimal}
|
||||||
|
|
||||||
|
%files test-framework -f .mfiles-test-framework
|
||||||
|
%license LICENSE.md NOTICE.md LICENSE-2.0.txt
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%files javadoc -f .mfiles-javadoc
|
||||||
|
%license LICENSE.md NOTICE.md LICENSE-2.0.txt
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Wed Jan 03 2024 wangkai <13474090681@163.com> - 2.29.1-3
|
||||||
|
- fix CVE-2021-28168
|
||||||
|
|
||||||
|
* Fri 17 Sep 2021 wuzhen <wuzhen36@huawei.com> - 2.29.1-2
|
||||||
|
- Add "-Dmaven.skip.test=true" to skip maven test.
|
||||||
|
|
||||||
|
* Tue May 18 2021 guoxiaoqi2 <guoxiaoqi2@huawei.com> - 2.29.1-1
|
||||||
|
- update to 2.29.1
|
||||||
|
|
||||||
|
* Tue Aug 25 2020 Shaoqiang Kang <kangshaoqiang1@huawei.com> - 2.28-1
|
||||||
|
- Package init
|
||||||
4
jersey.yaml
Normal file
4
jersey.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: eclipse-ee4j/jersey
|
||||||
|
tag_prefix: "^"
|
||||||
|
seperator: "."
|
||||||
Loading…
x
Reference in New Issue
Block a user