Skip to content

Commit

Permalink
更新quarkus为3.14.4, 修正单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Sep 16, 2024
1 parent a06eccf commit 9381312
Show file tree
Hide file tree
Showing 19 changed files with 199 additions and 43 deletions.
34 changes: 34 additions & 0 deletions docs/dev-guide/graalvm/graalvm-compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<group-id>/<artifact-id>`

```
[
{
"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依赖,
Expand Down
2 changes: 1 addition & 1 deletion nop-all-for-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<maven.compiler.compilerVersion>11</maven.compiler.compilerVersion>
<maven.deploy.skip>true</maven.deploy.skip>
<nop-entropy.version>2.0.0-SNAPSHOT</nop-entropy.version>
<quarkus.platform.version>3.14.2</quarkus.platform.version>
<quarkus.platform.version>3.14.4</quarkus.platform.version>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7429,6 +7429,12 @@
"name": "getTreeLevel",
"parameterTypes": []
},
{
"name": "getUrlForXmlns",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "getXmlnsForUrl",
"parameterTypes": [
Expand Down Expand Up @@ -7887,6 +7893,12 @@
"name": "removeJsonPrefix",
"parameterTypes": []
},
{
"name": "removeJsonPrefix",
"parameterTypes": [
"boolean"
]
},
{
"name": "removeNextSiblings",
"parameterTypes": []
Expand Down Expand Up @@ -18906,6 +18918,10 @@
"name": "isKvTable",
"parameterTypes": []
},
{
"name": "isNoPrimaryKey",
"parameterTypes": []
},
{
"name": "isReadonly",
"parameterTypes": []
Expand Down Expand Up @@ -20686,6 +20702,10 @@
"name": "isKvTable",
"parameterTypes": []
},
{
"name": "isNoPrimaryKey",
"parameterTypes": []
},
{
"name": "isNotGenCode",
"parameterTypes": []
Expand Down Expand Up @@ -20906,6 +20926,12 @@
"java.lang.String"
]
},
{
"name": "setNoPrimaryKey",
"parameterTypes": [
"boolean"
]
},
{
"name": "setNotGenCode",
"parameterTypes": [
Expand Down Expand Up @@ -25455,6 +25481,12 @@
"boolean"
]
},
{
"name": "loadDslModelFromPath",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "newExcelModelLoader",
"parameterTypes": [
Expand Down
1 change: 1 addition & 0 deletions nop-cli-core/src/main/resources/nop-vfs-index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nop-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<compiler-plugin.version>3.11.0</compiler-plugin.version>
<maven-flatten-version>1.1.0</maven-flatten-version>
<quarkus.platform.version>3.14.2</quarkus.platform.version>
<quarkus.platform.version>3.14.4</quarkus.platform.version>
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>

<maven-release-plugin.version>3.0.0-M1</maven-release-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Args=-H:ResourceConfigurationResources=${.}/resource-config.json
Original file line number Diff line number Diff line change
@@ -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/*.*"
}
]
}
2 changes: 1 addition & 1 deletion nop-demo/nop-quarkus-demo/build-native.bat
Original file line number Diff line number Diff line change
@@ -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
35 changes: 22 additions & 13 deletions nop-demo/nop-quarkus-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
</plugin>

<plugin>
<groupId>io.quarkus</groupId>
<groupId>io.quarkus.platform</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
Expand All @@ -260,10 +260,12 @@
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
<goal>native-image-agent</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand All @@ -280,12 +282,22 @@
</property>
</activation>
<properties>
<quarkus.package.type>native</quarkus.package.type>
<skipITs>false</skipITs>
<quarkus.native.enabled>true</quarkus.native.enabled>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
Expand All @@ -294,18 +306,15 @@
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>
${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager
</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24613,6 +24613,12 @@
"name": "getTreeLevel",
"parameterTypes": []
},
{
"name": "getUrlForXmlns",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "getXmlnsForUrl",
"parameterTypes": [
Expand Down Expand Up @@ -25071,6 +25077,12 @@
"name": "removeJsonPrefix",
"parameterTypes": []
},
{
"name": "removeJsonPrefix",
"parameterTypes": [
"boolean"
]
},
{
"name": "removeNextSiblings",
"parameterTypes": []
Expand Down Expand Up @@ -40001,6 +40013,10 @@
"name": "isKvTable",
"parameterTypes": []
},
{
"name": "isNoPrimaryKey",
"parameterTypes": []
},
{
"name": "isReadonly",
"parameterTypes": []
Expand Down Expand Up @@ -42145,6 +42161,10 @@
"name": "isKvTable",
"parameterTypes": []
},
{
"name": "isNoPrimaryKey",
"parameterTypes": []
},
{
"name": "isNotGenCode",
"parameterTypes": []
Expand Down Expand Up @@ -42365,6 +42385,12 @@
"java.lang.String"
]
},
{
"name": "setNoPrimaryKey",
"parameterTypes": [
"boolean"
]
},
{
"name": "setNotGenCode",
"parameterTypes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 9381312

Please sign in to comment.