Skip to content

Commit 4fd2129

Browse files
authored
Native image fixes for new Jersey version. (helidon-io#1910)
* Native image fixes for new Jersey version. * Jersey client now works without additional dependencies. * Fix for modularized runtime. Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
1 parent a80c900 commit 4fd2129

14 files changed

Lines changed: 73 additions & 69 deletions

File tree

dependencies/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,21 @@
128128
<groupId>org.glassfish.jersey.core</groupId>
129129
<artifactId>jersey-server</artifactId>
130130
<version>${version.lib.jersey}</version>
131+
<exclusions>
132+
<exclusion>
133+
<groupId>org.glassfish.hk2.external</groupId>
134+
<artifactId>jakarta.inject</artifactId>
135+
</exclusion>
136+
<exclusion>
137+
<groupId>org.glassfish.jersey.media</groupId>
138+
<artifactId>jersey-media-jaxb</artifactId>
139+
</exclusion>
140+
</exclusions>
141+
</dependency>
142+
<dependency>
143+
<groupId>org.glassfish.jersey.core</groupId>
144+
<artifactId>jersey-client</artifactId>
145+
<version>${version.lib.jersey}</version>
131146
<exclusions>
132147
<exclusion>
133148
<groupId>org.glassfish.hk2.external</groupId>
@@ -950,6 +965,10 @@
950965
<groupId>jakarta.json</groupId>
951966
<artifactId>jakarta.json-api</artifactId>
952967
</exclusion>
968+
<exclusion>
969+
<groupId>com.sun.activation</groupId>
970+
<artifactId>jakarta.activation</artifactId>
971+
</exclusion>
953972
</exclusions>
954973
</dependency>
955974
<dependency>

examples/security/attribute-based-access-control/src/main/java/module-info.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
requires io.helidon.security.abac.policy;
3232
requires io.helidon.security.abac.scope;
3333

34-
// needed for jersey to start without a lot of errors (hk2 actually)
35-
requires java.xml.bind;
36-
3734
// java util logging
3835
requires java.logging;
3936

examples/security/webserver-digest-auth/pom.xml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2017, 2020 Oracle and/or its affiliates.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -66,13 +66,8 @@
6666
<artifactId>helidon-config-yaml</artifactId>
6767
</dependency>
6868
<dependency>
69-
<groupId>org.glassfish.jersey.core</groupId>
70-
<artifactId>jersey-client</artifactId>
71-
<scope>test</scope>
72-
</dependency>
73-
<dependency>
74-
<groupId>org.glassfish.jersey.inject</groupId>
75-
<artifactId>jersey-hk2</artifactId>
69+
<groupId>io.helidon.jersey</groupId>
70+
<artifactId>helidon-jersey-client</artifactId>
7671
<scope>test</scope>
7772
</dependency>
7873
<dependency>

jersey/client/pom.xml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
3+
Copyright (c) 2019, 2020 Oracle and/or its affiliates.
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -36,27 +36,19 @@
3636
<dependency>
3737
<groupId>org.glassfish.jersey.core</groupId>
3838
<artifactId>jersey-client</artifactId>
39-
<version>${version.lib.jersey}</version>
40-
<exclusions>
41-
<exclusion>
42-
<groupId>org.glassfish.hk2.external</groupId>
43-
<artifactId>jakarta.inject</artifactId>
44-
</exclusion>
45-
</exclusions>
4639
</dependency>
4740
<dependency>
4841
<groupId>org.glassfish.jersey.inject</groupId>
4942
<artifactId>jersey-hk2</artifactId>
5043
</dependency>
5144
<dependency>
45+
<!-- this module is required by Jakarta JAX-RS (requires transitive in module-info.java) -->
5246
<groupId>jakarta.xml.bind</groupId>
5347
<artifactId>jakarta.xml.bind-api</artifactId>
54-
<exclusions>
55-
<exclusion>
56-
<groupId>jakarta.activation</groupId>
57-
<artifactId>jakarta.activation-api</artifactId>
58-
</exclusion>
59-
</exclusions>
48+
</dependency>
49+
<dependency>
50+
<groupId>jakarta.inject</groupId>
51+
<artifactId>jakarta.inject-api</artifactId>
6052
</dependency>
6153
</dependencies>
6254

jersey/client/src/main/java/module-info.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@
2121
requires transitive java.ws.rs;
2222
requires transitive jersey.common;
2323
requires transitive jersey.client;
24-
25-
requires java.xml.bind;
2624
}

jersey/server/pom.xml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
3+
Copyright (c) 2019, 2020 Oracle and/or its affiliates.
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -37,30 +37,21 @@
3737
<groupId>org.glassfish.jersey.core</groupId>
3838
<artifactId>jersey-server</artifactId>
3939
<version>${version.lib.jersey}</version>
40-
<exclusions>
41-
<exclusion>
42-
<groupId>org.glassfish.jersey.media</groupId>
43-
<artifactId>jersey-media-jaxb</artifactId>
44-
</exclusion>
45-
<exclusion>
46-
<groupId>org.glassfish.hk2.external</groupId>
47-
<artifactId>jakarta.inject</artifactId>
48-
</exclusion>
49-
</exclusions>
5040
</dependency>
5141
<dependency>
5242
<groupId>org.glassfish.jersey.inject</groupId>
5343
<artifactId>jersey-hk2</artifactId>
5444
</dependency>
55-
<dependency>
56-
<groupId>jakarta.xml.bind</groupId>
57-
<artifactId>jakarta.xml.bind-api</artifactId>
58-
</dependency>
5945
<dependency>
6046
<!-- needed for proper module name in module-info.java -->
6147
<groupId>jakarta.inject</groupId>
6248
<artifactId>jakarta.inject-api</artifactId>
6349
</dependency>
50+
<dependency>
51+
<!-- this module is required by Jakarta JAX-RS (requires transitive in module-info.java) -->
52+
<groupId>jakarta.xml.bind</groupId>
53+
<artifactId>jakarta.xml.bind-api</artifactId>
54+
</dependency>
6455
</dependencies>
6556

6657
<profiles>

jersey/server/src/main/java/module-info.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,4 @@
2525
requires transitive jakarta.inject.api;
2626
requires transitive jakarta.activation;
2727
requires transitive java.annotation;
28-
29-
requires transitive java.xml.bind;
3028
}

microprofile/access-log/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2019, 2020 Oracle and/or its affiliates.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@
3434
<dependency>
3535
<groupId>io.helidon.microprofile.server</groupId>
3636
<artifactId>helidon-microprofile-server</artifactId>
37+
<scope>provided</scope>
3738
</dependency>
3839
<dependency>
3940
<groupId>io.helidon.webserver</groupId>

tests/apps/bookstore/bookstore-mp/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@
5353
<dependency>
5454
<groupId>org.glassfish.jersey.media</groupId>
5555
<artifactId>jersey-media-json-binding</artifactId>
56-
<exclusions>
57-
<exclusion>
58-
<groupId>jakarta.activation</groupId>
59-
<artifactId>jakarta.activation-api</artifactId>
60-
</exclusion>
61-
<exclusion>
62-
<groupId>com.sun.activation</groupId>
63-
<artifactId>jakarta.activation</artifactId>
64-
</exclusion>
65-
</exclusions>
6656
</dependency>
6757
<dependency>
6858
<groupId>io.helidon.tests.apps.bookstore.common</groupId>

tracing/tests/it-tracing-client-zipkin/pom.xml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
3+
Copyright (c) 2018, 2020 Oracle and/or its affiliates.
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -63,18 +63,8 @@
6363
<scope>test</scope>
6464
</dependency>
6565
<dependency>
66-
<groupId>org.glassfish.jersey.core</groupId>
67-
<artifactId>jersey-client</artifactId>
68-
<scope>test</scope>
69-
</dependency>
70-
<dependency>
71-
<groupId>org.glassfish.jersey.inject</groupId>
72-
<artifactId>jersey-hk2</artifactId>
73-
<scope>test</scope>
74-
</dependency>
75-
<dependency>
76-
<groupId>jakarta.activation</groupId>
77-
<artifactId>jakarta.activation-api</artifactId>
66+
<groupId>io.helidon.jersey</groupId>
67+
<artifactId>helidon-jersey-client</artifactId>
7868
<scope>test</scope>
7969
</dependency>
8070
</dependencies>

0 commit comments

Comments
 (0)