Skip to content

Commit

Permalink
antlr使用4.13.0,与quarkus3.14.4中使用版本一致
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Sep 17, 2024
1 parent 9381312 commit ae1fe93
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
9 changes: 9 additions & 0 deletions docs/dev-guide/graalvm/graalvm-compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,12 @@ solon.logging.logger:
```
mvn native:compile -DskipTests -Pnative
```
## 问题诊断
1. 报错找不到`/nop/schema/register-model.xdef`
必须先以调试模式启动应用,并在`bootstrap.yaml`中配置`"nop.codegen.trace.enabled: true`和`nop.debug:true`, 这样才会自动生成`nop-vfs-index.txt`,解决native编译后无法执行类扫描的问题。
* 只要以IDEA的调试模式启动,quarkus就会自动设置`quarkus.profile=dev`, Nop平台的QuarkusIntegration中就会自动强制设置`nop.debug=true`
* 启动程序后应该在界面上使用一下应用,从而让需要被记录的反射调用都能够被调用到。在IDEA中关闭应用时会自动生成graalvm配置文件到`src/main/resources`目录下
2. graalm编译报错
需要确保graalvm版本和程序中引用的quarks版本一致。目前quarkus3.14.4使用的是graalvm js 23.1.2,对应于graalvm版本为`GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)`
2 changes: 1 addition & 1 deletion nop-antlr4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>pom</packaging>

<properties>
<antlr.plugin.version>4.10.1</antlr.plugin.version>
<antlr.plugin.version>4.13.0</antlr.plugin.version>
</properties>

<dependencies>
Expand Down
7 changes: 0 additions & 7 deletions nop-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@
<!-- </dependency>-->


<!-- 覆盖quarkus中使用的版本 -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.10.1</version>
</dependency>

<dependency>
<groupId>io.github.entropy-cloud</groupId>
<artifactId>nop-cli-core</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion nop-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

<!-- <tcnative.version>2.0.52.Final</tcnative.version>-->

<antlr.version>4.10.1</antlr.version>
<!-- 与quarkus3.14.4中使用版本一致 -->
<antlr.version>4.13.0</antlr.version>

<graalvm.version>23.1.2</graalvm.version>
<!-- <jackson.version>2.10.2</jackson.version>-->
Expand Down
8 changes: 4 additions & 4 deletions nop-quarkus/nop-quarkus-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
<artifactId>quarkus-resteasy</artifactId>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>javax.annotation</groupId>-->
<!-- <artifactId>javax.annotation-api</artifactId>-->
<!-- </dependency>-->

<dependency>
<groupId>com.h2database</groupId>
Expand Down
1 change: 1 addition & 0 deletions nop-rpc/nop-rpc-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<scope>test</scope>
</dependency>

<!-- protobuf-maven-plugin插件生成的代码会用到 -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
Expand Down

0 comments on commit ae1fe93

Please sign in to comment.