diff --git a/docs/dev-guide/graalvm/graalvm-compile.md b/docs/dev-guide/graalvm/graalvm-compile.md index 4ab4b6544..e9468895d 100644 --- a/docs/dev-guide/graalvm/graalvm-compile.md +++ b/docs/dev-guide/graalvm/graalvm-compile.md @@ -18,12 +18,46 @@ nop: 在nop-commons, nop-auth-core等模块中,对于用到的第三方库如caffeine,jsonwebtoken等增加了`reflect-config.json`配置 ## 版本兼容性 +https://www.graalvm.org/release-notes/JDK_21/ + +https://github.com/graalvm/graalvm-ce-builds/releases 下载graalvm 21.0.2 + +`quarkus-bom`模块的pom文件中定义了quarkus所依赖的graalvm js的版本,然后再在上面的releases页面查找对应graalvm的版本。 + Truffle languages and other components version 23.1.2 are designed for use with GraalVM for JDK 21.0.2 GraalJS version 24.0.2 is designed for use with Oracle GraalVM for JDK 22.0.2 or GraalVM Community Edition for JDK 22.0.2, GraalJS version 23.1.2 is designed for use with Oracle GraalVM for JDK 21.0.2 or GraalVM Community Edition for JDK 21.0.2, +## 类初始化 + + +## reflect-config.json +会自动收集如下目录中的配置 `src/main/resources/META-INF/native-image//` + +``` +[ + { + "name" : "com.acme.MyClass", + "allDeclaredConstructors" : true, + "allPublicConstructors" : true, + "allDeclaredMethods" : true, + "allPublicMethods" : true, + "allDeclaredFields" : true, + "allPublicFields" : true + } +] +``` + +## 配置说明 +指定以下选项以分别启用基于 Chrome DevTools 调试器、采样探查器、跟踪探查器和内存分析器的调试器: + +--inspect +--cpusampler +--cputracer +--memsampler + ## Solon框架 ### 1. 在pom文件中引入aot支持,引入solon-logging-logback依赖, diff --git a/nop-all-for-spring/pom.xml b/nop-all-for-spring/pom.xml index 66c08fc96..bf147e9d2 100644 --- a/nop-all-for-spring/pom.xml +++ b/nop-all-for-spring/pom.xml @@ -14,7 +14,7 @@ 11 true 2.0.0-SNAPSHOT - 3.14.2 + 3.14.4 diff --git a/nop-cli-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud/nop-cli-core/reflect-config.json b/nop-cli-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud/nop-cli-core/reflect-config.json index 208b8f6ff..51c12825a 100644 --- a/nop-cli-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud/nop-cli-core/reflect-config.json +++ b/nop-cli-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud/nop-cli-core/reflect-config.json @@ -7429,6 +7429,12 @@ "name": "getTreeLevel", "parameterTypes": [] }, + { + "name": "getUrlForXmlns", + "parameterTypes": [ + "java.lang.String" + ] + }, { "name": "getXmlnsForUrl", "parameterTypes": [ @@ -7887,6 +7893,12 @@ "name": "removeJsonPrefix", "parameterTypes": [] }, + { + "name": "removeJsonPrefix", + "parameterTypes": [ + "boolean" + ] + }, { "name": "removeNextSiblings", "parameterTypes": [] @@ -18906,6 +18918,10 @@ "name": "isKvTable", "parameterTypes": [] }, + { + "name": "isNoPrimaryKey", + "parameterTypes": [] + }, { "name": "isReadonly", "parameterTypes": [] @@ -20686,6 +20702,10 @@ "name": "isKvTable", "parameterTypes": [] }, + { + "name": "isNoPrimaryKey", + "parameterTypes": [] + }, { "name": "isNotGenCode", "parameterTypes": [] @@ -20906,6 +20926,12 @@ "java.lang.String" ] }, + { + "name": "setNoPrimaryKey", + "parameterTypes": [ + "boolean" + ] + }, { "name": "setNotGenCode", "parameterTypes": [ @@ -25455,6 +25481,12 @@ "boolean" ] }, + { + "name": "loadDslModelFromPath", + "parameterTypes": [ + "java.lang.String" + ] + }, { "name": "newExcelModelLoader", "parameterTypes": [ diff --git a/nop-cli-core/src/main/resources/nop-vfs-index.txt b/nop-cli-core/src/main/resources/nop-vfs-index.txt index 4cca1c017..ad556aff0 100644 --- a/nop-cli-core/src/main/resources/nop-vfs-index.txt +++ b/nop-cli-core/src/main/resources/nop-vfs-index.txt @@ -133,6 +133,7 @@ /nop/schema/orm/orm-interceptor.xdef /nop/schema/orm/orm.xdef /nop/schema/orm/sql-lib.xdef +/nop/schema/orm/view-entity.xdef /nop/schema/query/filter.xdef /nop/schema/query/group-by.xdef /nop/schema/query/order-by.xdef diff --git a/nop-cli/pom.xml b/nop-cli/pom.xml index 32f4d556d..111b31d51 100644 --- a/nop-cli/pom.xml +++ b/nop-cli/pom.xml @@ -58,7 +58,7 @@ 3.11.0 1.1.0 - 3.14.2 + 3.14.4 3.0.0-M5 3.0.0-M1 diff --git a/nop-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud.nop-core/native-image.properties b/nop-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud.nop-core/native-image.properties new file mode 100644 index 000000000..4087f5620 --- /dev/null +++ b/nop-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud.nop-core/native-image.properties @@ -0,0 +1 @@ +Args=-H:ResourceConfigurationResources=${.}/resource-config.json diff --git a/nop-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud.nop-core/resource-config.json b/nop-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud.nop-core/resource-config.json new file mode 100644 index 000000000..faa24b86b --- /dev/null +++ b/nop-core/src/main/resources/META-INF/native-image/io.github.entropy-cloud.nop-core/resource-config.json @@ -0,0 +1,34 @@ +{ + "resources": [ + { + "pattern": ".*\\.xml$" + }, + { + "pattern": ".*\\.yaml$" + }, + { + "pattern": ".*\\.json5$" + }, + { + "pattern": ".*\\.json$" + }, + { + "pattern": ".*\\.properties$" + }, + { + "pattern": ".*\\.xdef$" + }, + { + "pattern": ".*\\.txt$" + }, + { + "pattern": "META-INF/services/*.*" + }, + { + "pattern": "_vfs/*.*" + }, + { + "pattern": "_conf/*.*" + } + ] +} \ No newline at end of file diff --git a/nop-demo/nop-quarkus-demo/build-native.bat b/nop-demo/nop-quarkus-demo/build-native.bat index f442d0bca..83935e10a 100644 --- a/nop-demo/nop-quarkus-demo/build-native.bat +++ b/nop-demo/nop-quarkus-demo/build-native.bat @@ -1,4 +1,4 @@ set GRAALVM_HOME=C:\Software\graalvm set JAVA_HOME=%GRAALVM_HOME% set Path=%GRAALVM_HOME%\bin;%Path% -"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" && mvn package -DskipTests -Pnative +"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" && mvn package -Dnative diff --git a/nop-demo/nop-quarkus-demo/pom.xml b/nop-demo/nop-quarkus-demo/pom.xml index f5f1c49ee..c627e666d 100644 --- a/nop-demo/nop-quarkus-demo/pom.xml +++ b/nop-demo/nop-quarkus-demo/pom.xml @@ -250,7 +250,7 @@ - io.quarkus + io.quarkus.platform quarkus-maven-plugin ${quarkus.platform.version} true @@ -260,10 +260,12 @@ build generate-code generate-code-tests + native-image-agent + org.codehaus.mojo exec-maven-plugin @@ -280,12 +282,22 @@ - native + false + true - org.apache.maven.plugins + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + maven-failsafe-plugin ${surefire-plugin.version} @@ -294,18 +306,15 @@ integration-test verify - - - - ${project.build.directory}/${project.build.finalName}-runner - - org.jboss.logmanager.LogManager - - ${maven.home} - - + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + diff --git a/nop-demo/nop-quarkus-demo/src/main/java/io/nop/demo/quarkus/QuarkusDemoMain.java b/nop-demo/nop-quarkus-demo/src/main/java/io/nop/demo/quarkus/QuarkusDemoMain.java index 67e525a3c..0c30a99ad 100644 --- a/nop-demo/nop-quarkus-demo/src/main/java/io/nop/demo/quarkus/QuarkusDemoMain.java +++ b/nop-demo/nop-quarkus-demo/src/main/java/io/nop/demo/quarkus/QuarkusDemoMain.java @@ -10,10 +10,12 @@ import io.nop.boot.NopApplication; import io.nop.core.initialize.CoreInitialization; import io.nop.quarkus.core.QuarkusIntegration; +import io.quarkus.runtime.IOThreadDetector; import io.quarkus.runtime.Quarkus; import io.quarkus.runtime.ShutdownEvent; import io.quarkus.runtime.StartupEvent; import io.quarkus.runtime.annotations.QuarkusMain; +import io.vertx.core.Context; import jakarta.enterprise.event.Observes; @QuarkusMain @@ -31,6 +33,13 @@ public void stop(@Observes ShutdownEvent event) { } public static void main(String... args) { + new IOThreadDetector() { + @Override + public boolean isInIOThread() { + return Context.isOnEventLoopThread(); + } + }; + globalArgs = args; Quarkus.run(args); } diff --git a/nop-demo/nop-quarkus-demo/src/main/resources/META-INF/native-image/io.nop.demo/nop-quarkus-demo/native-image.properties b/nop-demo/nop-quarkus-demo/src/main/resources/META-INF/native-image/io.nop.demo/nop-quarkus-demo/native-image.properties index 5f3ff1c28..3eabd6c7e 100644 --- a/nop-demo/nop-quarkus-demo/src/main/resources/META-INF/native-image/io.nop.demo/nop-quarkus-demo/native-image.properties +++ b/nop-demo/nop-quarkus-demo/src/main/resources/META-INF/native-image/io.nop.demo/nop-quarkus-demo/native-image.properties @@ -5,5 +5,4 @@ Args=--enable-http \ -H:-CheckToolchain \ -H:ReflectionConfigurationResources=${.}/reflect-config.json \ -H:JNIConfigurationResources=${.}/jni-config.json \ --H:ResourceConfigurationResources=${.}/resource-config.json \ ---trace-object-instantiation=java.security.SecureRandom +-H:ResourceConfigurationResources=${.}/resource-config.json diff --git a/nop-demo/nop-quarkus-demo/src/main/resources/nop-vfs-index.txt b/nop-demo/nop-quarkus-demo/src/main/resources/nop-vfs-index.txt index 1a7754698..de6660f47 100644 --- a/nop-demo/nop-quarkus-demo/src/main/resources/nop-vfs-index.txt +++ b/nop-demo/nop-quarkus-demo/src/main/resources/nop-vfs-index.txt @@ -421,7 +421,6 @@ /nop/dyn/model/NopDynFunctionMeta/_NopDynFunctionMeta.xbiz /nop/dyn/model/NopDynFunctionMeta/_NopDynFunctionMeta.xmeta /nop/dyn/model/NopDynModule/NopDynModule.xbiz -/nop/dyn/model/NopDynModule/NopDynModule.xbiz.rej /nop/dyn/model/NopDynModule/NopDynModule.xmeta /nop/dyn/model/NopDynModule/_NopDynModule.xbiz /nop/dyn/model/NopDynModule/_NopDynModule.xmeta @@ -1067,7 +1066,6 @@ /nop/web/xlib/view-gen.xlib /nop/web/xlib/view-gen/impl_GenFromMeta.xpl /nop/web/xlib/web.xlib -/nop/web/xlib/web.xlib.rej /nop/web/xlib/web/grid_crud.xpl /nop/web/xlib/web/impl_GenForm.xpl /nop/web/xlib/web/impl_GenGrid.xpl diff --git a/nop-demo/nop-spring-demo/src/main/resources/META-INF/native-image/io.github.entropy-cloud/nop-spring-demo/reflect-config.json b/nop-demo/nop-spring-demo/src/main/resources/META-INF/native-image/io.github.entropy-cloud/nop-spring-demo/reflect-config.json index ab2945d59..ed4282a25 100644 --- a/nop-demo/nop-spring-demo/src/main/resources/META-INF/native-image/io.github.entropy-cloud/nop-spring-demo/reflect-config.json +++ b/nop-demo/nop-spring-demo/src/main/resources/META-INF/native-image/io.github.entropy-cloud/nop-spring-demo/reflect-config.json @@ -24613,6 +24613,12 @@ "name": "getTreeLevel", "parameterTypes": [] }, + { + "name": "getUrlForXmlns", + "parameterTypes": [ + "java.lang.String" + ] + }, { "name": "getXmlnsForUrl", "parameterTypes": [ @@ -25071,6 +25077,12 @@ "name": "removeJsonPrefix", "parameterTypes": [] }, + { + "name": "removeJsonPrefix", + "parameterTypes": [ + "boolean" + ] + }, { "name": "removeNextSiblings", "parameterTypes": [] @@ -40001,6 +40013,10 @@ "name": "isKvTable", "parameterTypes": [] }, + { + "name": "isNoPrimaryKey", + "parameterTypes": [] + }, { "name": "isReadonly", "parameterTypes": [] @@ -42145,6 +42161,10 @@ "name": "isKvTable", "parameterTypes": [] }, + { + "name": "isNoPrimaryKey", + "parameterTypes": [] + }, { "name": "isNotGenCode", "parameterTypes": [] @@ -42365,6 +42385,12 @@ "java.lang.String" ] }, + { + "name": "setNoPrimaryKey", + "parameterTypes": [ + "boolean" + ] + }, { "name": "setNotGenCode", "parameterTypes": [ diff --git a/nop-demo/nop-spring-demo/src/main/resources/nop-vfs-index.txt b/nop-demo/nop-spring-demo/src/main/resources/nop-vfs-index.txt index 4bb56720b..16dd58667 100644 --- a/nop-demo/nop-spring-demo/src/main/resources/nop-vfs-index.txt +++ b/nop-demo/nop-spring-demo/src/main/resources/nop-vfs-index.txt @@ -382,6 +382,7 @@ /nop/schema/orm/orm-interceptor.xdef /nop/schema/orm/orm.xdef /nop/schema/orm/sql-lib.xdef +/nop/schema/orm/view-entity.xdef /nop/schema/query/filter.xdef /nop/schema/query/group-by.xdef /nop/schema/query/order-by.xdef @@ -714,7 +715,6 @@ /nop/web/xlib/view-gen.xlib /nop/web/xlib/view-gen/impl_GenFromMeta.xpl /nop/web/xlib/web.xlib -/nop/web/xlib/web.xlib.rej /nop/web/xlib/web/grid_crud.xpl /nop/web/xlib/web/impl_GenForm.xpl /nop/web/xlib/web/impl_GenGrid.xpl diff --git a/nop-dependencies/pom.xml b/nop-dependencies/pom.xml index bb19445c7..605d1fe49 100644 --- a/nop-dependencies/pom.xml +++ b/nop-dependencies/pom.xml @@ -22,7 +22,7 @@ UTF-8 3.11.0 - 3.14.2 + 3.14.4 3.1.2 @@ -33,7 +33,7 @@ 4.10.1 - 23.0.1 + 23.1.2 3.1.12 @@ -50,7 +50,7 @@ 2023.0.3 0.43.1 - 9.9.2 + 9.7.0 @@ -61,7 +61,7 @@ - io.quarkus + io.quarkus.platform quarkus-bom ${quarkus.platform.version} pom diff --git a/nop-orm/src/test/resources/io/nop/orm/pdman/pdman.result.json b/nop-orm/src/test/resources/io/nop/orm/pdman/pdman.result.json index c7e0fde20..0021b2973 100644 --- a/nop-orm/src/test/resources/io/nop/orm/pdman/pdman.result.json +++ b/nop-orm/src/test/resources/io/nop/orm/pdman/pdman.result.json @@ -81,6 +81,7 @@ "tableName": "sims_college", "displayName": "学院", "kvTable": false, + "noPrimaryKey": false, "useLogicalDelete": false, "registerShortName": false, "useRevision": false, @@ -302,6 +303,7 @@ "tableName": "sims_major", "displayName": "专业", "kvTable": false, + "noPrimaryKey": false, "useLogicalDelete": false, "registerShortName": false, "useRevision": false, @@ -505,6 +507,7 @@ "tableName": "v_class_student", "displayName": "班级学生", "kvTable": false, + "noPrimaryKey": false, "useTenant": false, "useLogicalDelete": false, "registerShortName": false, @@ -729,6 +732,7 @@ "tableName": "sims_class", "displayName": "班级", "kvTable": false, + "noPrimaryKey": false, "useLogicalDelete": false, "registerShortName": false, "useRevision": false, @@ -992,6 +996,7 @@ "tableName": "sims_student", "displayName": "学生", "kvTable": false, + "noPrimaryKey": false, "useLogicalDelete": false, "registerShortName": false, "useRevision": false, @@ -1510,6 +1515,7 @@ "tableName": "sims_teacher", "displayName": "教师", "kvTable": false, + "noPrimaryKey": false, "useLogicalDelete": false, "registerShortName": false, "useRevision": false, @@ -1793,6 +1799,7 @@ "tableName": "sims_lesson", "displayName": "课程", "kvTable": false, + "noPrimaryKey": false, "useLogicalDelete": false, "registerShortName": false, "useRevision": false, @@ -1984,6 +1991,7 @@ "tableName": "sims_instruct", "displayName": "授课", "kvTable": false, + "noPrimaryKey": false, "useLogicalDelete": false, "registerShortName": false, "useRevision": false, @@ -2162,6 +2170,7 @@ "tableName": "sims_exam", "displayName": "考试", "kvTable": false, + "noPrimaryKey": false, "useLogicalDelete": false, "registerShortName": false, "useRevision": false, @@ -2360,4 +2369,4 @@ "indexes": [] } ] -} \ No newline at end of file +} diff --git a/nop-quarkus/nop-quarkus-core-starter/src/main/resources/META-INF/native-image/io.nop/nop-quarks-core-starter/reflect-config.json b/nop-quarkus/nop-quarkus-core-starter/src/main/resources/META-INF/native-image/io.nop/nop-quarks-core-starter/reflect-config.json index 783f13d9a..93eebc359 100644 --- a/nop-quarkus/nop-quarkus-core-starter/src/main/resources/META-INF/native-image/io.nop/nop-quarks-core-starter/reflect-config.json +++ b/nop-quarkus/nop-quarkus-core-starter/src/main/resources/META-INF/native-image/io.nop/nop-quarks-core-starter/reflect-config.json @@ -6,5 +6,14 @@ { "name": "io.agroal.pool.ConnectionHandler", "unsafeAllocated": true + }, + { + "name": "io.quarkus.runtime.IOThreadDetector", + "allDeclaredConstructors" : true, + "allPublicConstructors" : true, + "allDeclaredMethods" : true, + "allPublicMethods" : true, + "allDeclaredFields" : true, + "allPublicFields" : true } -] \ No newline at end of file +] diff --git a/nop-quarkus/nop-quarkus-web-starter/pom.xml b/nop-quarkus/nop-quarkus-web-starter/pom.xml index ee9a6b193..93cb62cb4 100644 --- a/nop-quarkus/nop-quarkus-web-starter/pom.xml +++ b/nop-quarkus/nop-quarkus-web-starter/pom.xml @@ -53,16 +53,16 @@ - - io.quarkus - quarkus-vertx-graphql-deployment - - - quarkus-core-deployment - io.quarkus - - - + + + + + + + + + + io.github.entropy-cloud @@ -100,11 +100,6 @@ nop-graphql-gateway - - io.quarkus - quarkus-resteasy - - diff --git a/pom.xml b/pom.xml index 9e69bf665..054868aa2 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 2.0.0-SNAPSHOT - 3.14.2 + 3.14.4 3.0.0-M5 UTF-8