Skip to content

Commit

Permalink
fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.5.0 (
Browse files Browse the repository at this point in the history
#1718)

* fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.5.0

* workaround issue with AOT


---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Graeme Rocher <graeme.rocher@oracle.com>
  • Loading branch information
renovate[bot] and graemerocher authored May 31, 2024
1 parent 4c0a6e4 commit ba7af26
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
managed-nimbus-jose-jwt = "9.39.2"
managed-jjwt = "0.12.5"

micronaut = "4.4.10"
micronaut = "4.5.0"
micronaut-platform = "4.4.2"
micronaut-docs = "2.0.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.micronaut.aot.core.AOTContext;
import io.micronaut.aot.core.AOTModule;
import io.micronaut.aot.core.codegen.AbstractCodeGenerator;
import io.micronaut.context.ApplicationContext;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.util.StringUtils;
import io.micronaut.security.oauth2.client.OpenIdProviderMetadata;
Expand Down Expand Up @@ -58,6 +59,10 @@ public class JwksFetcherCodeGenerator extends AbstractCodeGenerator {

@Override
public void generate(@NonNull AOTContext context) {
ApplicationContext applicationContext = context.getAnalyzer().getApplicationContext();
if (!applicationContext.isRunning()) {
applicationContext.start();
}
List<GeneratedFile> files = generateJavaFiles(context);
if (!files.isEmpty()) {
context.registerStaticOptimization("AotJwksFetcher", DefaultJwkSetFetcher.Optimizations.class, body -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.micronaut.aot.core.AOTContext;
import io.micronaut.aot.core.AOTModule;
import io.micronaut.aot.core.codegen.AbstractCodeGenerator;
import io.micronaut.context.ApplicationContext;
import io.micronaut.context.Qualifier;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.annotation.Nullable;
Expand Down Expand Up @@ -61,6 +62,10 @@ public class OpenIdProviderMetadataFetcherCodeGenerator extends AbstractCodeGene

@Override
public void generate(@NonNull AOTContext context) {
ApplicationContext applicationContext = context.getAnalyzer().getApplicationContext();
if (!applicationContext.isRunning()) {
applicationContext.start();
}
List<GeneratedFile> files = generateJavaFiles(context);
if (!files.isEmpty()) {
context.registerStaticOptimization("AotOpenIdProviderMetadataFetcherCode", DefaultOpenIdProviderMetadataFetcher.Optimizations.class, body -> {
Expand Down

0 comments on commit ba7af26

Please sign in to comment.