Skip to content

Commit

Permalink
4.7.0 (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo authored Nov 22, 2024
1 parent 1256fb7 commit 6622a26
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
java-version: '21'
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
Expand All @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ["17", "21"]
java: ["21"]
group: ${{ fromJson(needs.test_matrix.outputs.matrix).group_test_tasks }}
env:
JDK_VERSION: ${{ matrix.java }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
JDK_VERSION: '17'
JDK_VERSION: '21'
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
java-version: 21
- name: Build with Gradle
run: ./gradlew build
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
java-version: '21'
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ["17", "21"]
java: ["21"]
group: ${{ fromJson(needs.test_matrix.outputs.matrix).group_test_tasks }}
env:
JDK_VERSION: ${{ matrix.java }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class GuideAsciidocGenerator {
private static final String CLI_FUNCTION = 'create-function-app'
private static final String CLI_CLI = 'create-cli-app'

public static final int DEFAULT_MIN_JDK = 17
public static final int DEFAULT_MIN_JDK = 21
public static final String EXCLUDE_FOR_LANGUAGES = ':exclude-for-languages:'
public static final String EXCLUDE_FOR_JDK_LOWER_THAN = ':exclude-for-jdk-lower-than:'
public static final String EXCLUDE_FOR_BUILD = ':exclude-for-build:'
Expand Down Expand Up @@ -164,7 +164,7 @@ class GuideAsciidocGenerator {
text = text.replace("@languageextension@", guidesOption.language.extension)
text = text.replace("@testsuffix@", guidesOption.testFramework == SPOCK ? 'Spec' : 'Test')
text = text.replace("@sourceDir@", projectName)
text = text.replace("@minJdk@", metadata.minimumJavaVersion()?.toString() ?: "17")
text = text.replace("@minJdk@", metadata.minimumJavaVersion()?.toString() ?: "21")
text = text.replace("@api@", 'https://docs.micronaut.io/latest/api')

text = text.replaceAll(~/@([\w-]*):?cli-command@/) { List<String> matches ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import static groovy.io.FileType.FILES
import static io.micronaut.core.util.StringUtils.EMPTY_STRING
import static io.micronaut.starter.api.TestFramework.JUNIT
import static io.micronaut.starter.api.TestFramework.SPOCK
import static io.micronaut.starter.options.JdkVersion.JDK_17
import static io.micronaut.starter.options.JdkVersion.JDK_21
import static io.micronaut.starter.options.Language.GROOVY
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
Expand All @@ -48,7 +47,7 @@ class GuideProjectGenerator implements AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(this)
private static final String APP_NAME = 'micronautguide'
private static final String BASE_PACKAGE = 'example.micronaut'
private static final List<JdkVersion> JDK_VERSIONS_SUPPORTED_BY_GRAALVM = [JDK_17, JDK_21]
private static final List<JdkVersion> JDK_VERSIONS_SUPPORTED_BY_GRAALVM = [JDK_21]
public static final String LICENSEHEADER = "LICENSEHEADER"

private final ApplicationContext applicationContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import static io.micronaut.starter.options.BuildTool.MAVEN
class GuidesPlugin implements Plugin<Project> {

private static final String TASK_SUFFIX_GENERATE_PROJECTS = "GenerateProjects"
private static final List<Integer> JAVA_MATRIX = [8, 11, 17]
private static final List<Integer> JAVA_MATRIX = [21]
private static final List<String> FINALIZED_TASKS = ['generateTestScript',
'generateGuidesIndex',
'generateGuidesJsonMetadata',
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/io/micronaut/guides/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import io.micronaut.starter.options.JdkVersion
import org.gradle.api.GradleException
import org.gradle.api.JavaVersion

import static io.micronaut.starter.options.JdkVersion.JDK_17
import static io.micronaut.starter.options.JdkVersion.JDK_21

@CompileStatic
class Utils {

private static final String SYS_PROP_MICRONAUT_GUIDE = 'micronaut.guide'
private static final String ENV_JDK_VERSION = 'JDK_VERSION'
private static final JdkVersion DEFAULT_JAVA_VERSION = JDK_17
private static final JdkVersion DEFAULT_JAVA_VERSION = JDK_21

static String singleGuide() {
System.getProperty(SYS_PROP_MICRONAUT_GUIDE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import io.micronaut.starter.options.JdkVersion;

import java.util.List;

import static io.micronaut.starter.options.JdkVersion.JDK_17;
import static io.micronaut.starter.options.JdkVersion.JDK_21;

@ConfigurationProperties(GuidesConfigurationProperties.PREFIX)
Expand All @@ -17,12 +15,12 @@ public class GuidesConfigurationProperties implements GuidesConfiguration {
private static final String DEFAULT_APP_NAME = "default";
private static final String HOMEPAGE_URL = "https://micronaut.io";
private static final String LAUNCHER_URL = HOMEPAGE_URL + "/launch";
private static final int DEFAULT_MIN_JDK = 17;
private static final int DEFAULT_MIN_JDK = 21;
private static final String API_URL = "https://docs.micronaut.io/latest/api";
private static final String DEFAULT_VERSION = "classpath:version.txt";
private static final String DEFAULT_ENV_JDK_VERSION = "JDK_VERSION";
private static final JdkVersion DEFAULT_JAVA_VERSION = JDK_17;
private static final List<JdkVersion> DEFAULT_JDK_VERSIONS_SUPPORTED_BY_GRAALVM = List.of(JDK_17, JDK_21);
private static final JdkVersion DEFAULT_JAVA_VERSION = JDK_21;
private static final List<JdkVersion> DEFAULT_JDK_VERSIONS_SUPPORTED_BY_GRAALVM = List.of(JDK_21);
private static final String GITHUB_WORKFLOW_JAVA_CI = "Java CI";
private static final String ENV_GITHUB_WORKFLOW = "GITHUB_WORKFLOW";
private static final String SYS_PROP_MICRONAUT_GUIDE = "micronaut.guide";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import io.micronaut.starter.build.dependencies.CoordinateResolver;
import jakarta.inject.Singleton;

import io.micronaut.starter.feature.graallanguages.Graalpy;
import java.util.Collections;
import java.util.List;

@Singleton
class MicronautGraalpyPygal extends MicronautGraalpy {
class MicronautGraalpyPygal extends Graalpy {

MicronautGraalpyPygal(CoordinateResolver coordinateResolver) {
super(coordinateResolver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ public void apply(GeneratorContext generatorContext) {
.versionProperty(MICRONAUT_VERSION)
.compile()
.pom());

generatorContext.addDependency(MicronautDependencyUtils.platformDependency()
.artifactId("micronaut-platform")
.version(micronautVersion)
.versionProperty(MICRONAUT_VERSION)
.annotationProcessor()
.pom());



generatorContext.addDependency(MicronautDependencyUtils.dataDependency()
.artifactId("micronaut-data-processor")
.version(VersionInfo.getBomVersion("micronaut.data"))
Expand Down Expand Up @@ -93,6 +103,10 @@ public void apply(GeneratorContext generatorContext) {
.artifactId("micronaut-jdbc-hikari")
.compile());

generatorContext.addDependency(Dependency.builder().groupId("com.zaxxer")
.artifactId("HikariCP")
.version(VersionInfo.getDependencyVersions().get("hikari.version"))
.compile());
if (generatorContext.getFeatures().isFeaturePresent(H2.class)) {
generatorContext.getConfiguration().addNested(Map.of(
"datasources.default.url", "jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ void testGenerate() {
}"""));
String javaVersion = JavaVersion.current().getMajorVersion();

System.out.println(result);
assertTrue(result.contains("""
application {
mainClass = "example.micronaut.CliCommand"
}
java {
sourceCompatibility = JavaVersion.toVersion("17")
targetCompatibility = JavaVersion.toVersion("17")
}""".replace("17", javaVersion)));
sourceCompatibility = JavaVersion.toVersion("21")
targetCompatibility = JavaVersion.toVersion("21")
}""".replace("21", javaVersion)));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void testSubstitute() {
Test Framework: junit
Minimum JDK: 17
Minimum JDK: 21
API: https://docs.micronaut.io/latest/api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import io.micronaut.http.client.annotation.Client
import io.micronaut.http.client.exceptions.HttpClientResponseException
import io.micronaut.security.authentication.Authentication
import io.micronaut.security.authentication.UsernamePasswordCredentials
import io.micronaut.security.token.jwt.validator.ReactiveJsonWebTokenValidator
import io.micronaut.security.token.render.AccessRefreshToken
import io.micronaut.security.token.jwt.validator.JwtTokenValidator
import io.micronaut.test.extensions.spock.annotation.MicronautTest
import reactor.core.publisher.Flux
import spock.lang.Shared
Expand All @@ -43,7 +43,7 @@ class LoginControllerSpec extends Specification {

@Shared
@Inject
JwtTokenValidator tokenValidator
ReactiveJsonWebTokenValidator tokenValidator

@Inject
UserJdbcRepository userGormService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import io.micronaut.http.client.HttpClient
import io.micronaut.http.client.annotation.Client
import io.micronaut.http.client.exceptions.HttpClientResponseException
import io.micronaut.security.authentication.UsernamePasswordCredentials
import io.micronaut.security.token.jwt.validator.ReactiveJsonWebTokenValidator
import io.micronaut.security.token.render.AccessRefreshToken
import io.micronaut.security.token.jwt.validator.JwtTokenValidator
import io.micronaut.security.token.Claims;
import io.micronaut.test.extensions.spock.annotation.MicronautTest
import reactor.core.publisher.Flux
Expand All @@ -45,7 +45,7 @@ class LoginLdapSpec extends Specification {

@Shared
@Inject
JwtTokenValidator tokenValidator // <3>
ReactiveJsonWebTokenValidator tokenValidator // <3>

void '/login with valid credentials returns 200 and access token and refresh token'() {
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ common:gcloud-delete-project[]

== Next steps

You will probably want to deploy to Google Cloud Run from your CI server. https://launch.micronaut.io[Micronaut Launch] contains feature https://micronaut.io/launch?type=DEFAULT&name=demo&package=com.example&javaVersion=JDK_17&lang=JAVA&build=GRADLE&test=JUNIT&features=github-workflow-google-cloud-run&version=3.0.3[github-workflow-google-cloud-run], which adds a https://github.com/features/actions[GitHub Actions] Workflow that deploys an application to Google Cloud Run from Google Container Registry.
You will probably want to deploy to Google Cloud Run from your CI server. https://launch.micronaut.io[Micronaut Launch] contains feature https://micronaut.io/launch?type=DEFAULT&name=demo&package=com.example&javaVersion=JDK_21&lang=JAVA&build=GRADLE&test=JUNIT&features=github-workflow-google-cloud-run&version=3.0.3[github-workflow-google-cloud-run], which adds a https://github.com/features/actions[GitHub Actions] Workflow that deploys an application to Google Cloud Run from Google Container Registry.

Read more about:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"categories": ["AWS Lambda", "GraalVM"],
"languages": ["java", "kotlin"],
"publicationDate": "2020-08-29",
"maximumJavaVersion": 17,
"maximumJavaVersion": 21,
"env": { "AWS_ACCESS_KEY_ID": "XXX", "AWS_SECRET_ACCESS_KEY": "YYY", "AWS_REGION": "us-east-1" },
"apps": [
{
Expand Down
3 changes: 2 additions & 1 deletion guides/spring-boot-micronaut-data/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
{
"framework": "Spring Boot",
"name": "default",
"features": ["spring-boot-starter-web", "spring-boot-micronaut-data", "h2"]
"features": ["spring-boot-starter-web", "spring-boot-micronaut-data", "h2"],
"excludeTest": ["ApplicationTest"]
}
]
}
15 changes: 0 additions & 15 deletions src/docs/common/snippets/common-install-graalvm-sdkman.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@ The easiest way to install https://www.graalvm.org[GraalVM] on Linux or Mac is t
sdk install java 21.0.5-graal
----

[source, bash]
.Java 21
----
sdk use java 21.0.5-graal
----

For installation on Windows, or for manual installation on Linux or Mac, see the https://www.graalvm.org/latest/docs/getting-started/[GraalVM Getting Started] documentation.


The previous command installs Oracle GraalVM, which is free to use in production and free to redistribute, at no cost, under the https://www.oracle.com/downloads/licenses/graal-free-license.html[GraalVM Free Terms and Conditions].

Alternatively, you can use the https://github.com/graalvm/graalvm-ce-builds/releases/[GraalVM Community Edition]:
Expand All @@ -24,11 +17,3 @@ Alternatively, you can use the https://github.com/graalvm/graalvm-ce-builds/rele
----
sdk install java 21.0.2-graalce
----

[source, bash]
.Java 21
----
sdk use java 21.0.2-graalce
----


2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.6.3
4.7.0

0 comments on commit 6622a26

Please sign in to comment.