Skip to content

Commit ea4d1e8

Browse files
authored
Use Non-Deprecated Inject Plugin (#491)
* Use non-deprecated Inject Plugin * fix module * restore EA * Update jdk-ea-stable.yml * Revert "Disable EA stable build (as download broken)" This reverts commit 62e717e. * Update DefaultResolverProvider.java * correctly register the spis * Update module-info.java
1 parent f0a46c0 commit ea4d1e8

File tree

11 files changed

+36
-19
lines changed

11 files changed

+36
-19
lines changed

.github/workflows/jdk-ea-stable.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
name: JDK EA Stable
33

44
on:
5+
push:
6+
pull_request:
57
workflow_dispatch:
6-
# push:
7-
# pull_request:
8-
# schedule:
9-
# - cron: '39 1 * * 1,3,5'
8+
schedule:
9+
- cron: '39 1 * * 1,3,5'
1010

1111
jobs:
1212
build:

htmx-nima-jstache/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,12 @@
4343
<scope>provided</scope>
4444
<optional>true</optional>
4545
</dependency>
46+
<dependency>
47+
<groupId>io.avaje</groupId>
48+
<artifactId>avaje-spi-service</artifactId>
49+
<version>2.5</version>
50+
<scope>provided</scope>
51+
<optional>true</optional>
52+
</dependency>
4653
</dependencies>
4754
</project>

htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
import io.avaje.htmx.nima.TemplateContentCache;
44
import io.avaje.htmx.nima.TemplateRender;
55
import io.avaje.inject.BeanScopeBuilder;
6-
import io.avaje.inject.spi.Plugin;
6+
import io.avaje.inject.spi.InjectPlugin;
7+
import io.avaje.spi.ServiceProvider;
78

89
/**
910
* Plugin for avaje inject that provides a default TemplateRender instance.
1011
*/
11-
public final class DefaultTemplateProvider implements Plugin {
12+
@ServiceProvider
13+
public final class DefaultTemplateProvider implements InjectPlugin {
1214

1315
@Override
1416
public Class<?>[] provides() {

htmx-nima-jstache/src/main/java/module-info.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
requires transitive io.avaje.htmx.nima;
66
requires transitive io.helidon.webserver;
77
requires transitive io.jstach.jstachio;
8-
requires io.avaje.inject;
8+
requires transitive io.avaje.inject;
9+
requires static io.avaje.spi;
910

10-
provides io.avaje.inject.spi.Plugin with io.avaje.htmx.nima.jstache.DefaultTemplateProvider;
11+
provides io.avaje.inject.spi.InjectExtension with io.avaje.htmx.nima.jstache.DefaultTemplateProvider;
1112
}

htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin

Lines changed: 0 additions & 1 deletion
This file was deleted.

http-inject-plugin/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@
2626
<dependency>
2727
<groupId>io.avaje</groupId>
2828
<artifactId>avaje-http-api</artifactId>
29-
<version>1.37</version>
29+
<version>2.7</version>
3030
<optional>true</optional>
3131
<scope>provided</scope>
3232
</dependency>
33+
<dependency>
34+
<groupId>io.avaje</groupId>
35+
<artifactId>avaje-spi-service</artifactId>
36+
<version>2.5</version>
37+
<scope>provided</scope>
38+
<optional>true</optional>
39+
</dependency>
3340
</dependencies>
3441

3542
<build>

http-inject-plugin/src/main/java/io/avaje/http/inject/DefaultResolverProvider.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import io.avaje.http.api.context.RequestContextResolver;
44
import io.avaje.http.api.context.ThreadLocalRequestContextResolver;
55
import io.avaje.inject.BeanScopeBuilder;
6-
import io.avaje.inject.spi.Plugin;
6+
import io.avaje.inject.spi.InjectPlugin;
7+
import io.avaje.spi.ServiceProvider;
78

89
/** Plugin for avaje inject that provides a default RequestContextResolver instance. */
9-
public final class DefaultResolverProvider implements Plugin {
10+
@ServiceProvider
11+
public final class DefaultResolverProvider implements InjectPlugin {
1012

1113
@Override
1214
public Class<?>[] provides() {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module io.avaje.http.plugin {
22

3-
requires io.avaje.http.api;
4-
requires io.avaje.inject;
5-
6-
provides io.avaje.inject.spi.Plugin with io.avaje.http.inject.DefaultResolverProvider;
3+
requires io.avaje.http.api;
4+
requires io.avaje.inject;
5+
requires static io.avaje.spi;
76

7+
provides io.avaje.inject.spi.InjectExtension with io.avaje.http.inject.DefaultResolverProvider;
88
}

http-inject-plugin/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin

Lines changed: 0 additions & 1 deletion
This file was deleted.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<profile>
6262
<id>jdk21plus</id>
6363
<activation>
64-
<jdk>[21,22]</jdk>
64+
<jdk>[21,)</jdk>
6565
</activation>
6666
<modules>
6767
<module>htmx-nima</module>

tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<profile>
3434
<id>jdk21plus</id>
3535
<activation>
36-
<jdk>[21,22]</jdk>
36+
<jdk>[21,)</jdk>
3737
</activation>
3838
<modules>
3939
<module>test-nima</module>

0 commit comments

Comments
 (0)