最近在编译thingsboard-gateway时,碰到一个报错信息:“org.fortasoft:gradle-maven-plugin:1.0.8:invoke failed: Could not determine java version from '11.0.18”
D:\tb-gateway\thingsboard-gateway>mvn clean install -Dmaven.test.skip=true
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< org.thingsboard:gateway >-----------------------
[INFO] Building Thingsboard Gateway 2.2.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ gateway ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (copy-service-conf) @ gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (copy-win-conf) @ gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (copy-control) @ gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (copy-windows-control) @ gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ gateway ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 125 source files to D:\tb-gateway\thingsboard-gateway\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ gateway ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ gateway ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ gateway ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ gateway ---
[INFO] Building jar: D:\tb-gateway\thingsboard-gateway\target\tb-gateway-2.2.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-dependency-plugin:2.8:copy (copy) @ gateway ---
[INFO] Configured Artifact: com.sun.winsw:winsw:bin:?:exe
[INFO] Copying winsw-2.0.1-bin.exe to D:\tb-gateway\thingsboard-gateway\target\windows\service.exe
[INFO]
[INFO] --- spring-boot-maven-plugin:1.4.3.RELEASE:repackage (default) @ gateway ---
[INFO] Layout: ZIP
[INFO] Attaching archive: D:\tb-gateway\thingsboard-gateway\target\tb-gateway-2.2.1-SNAPSHOT-boot.jar, with classifier: boot
[INFO]
[INFO] --- gradle-maven-plugin:1.0.8:invoke (default) @ gateway ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.846 s
[INFO] Finished at: 2023-04-19T14:21:17+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke (default) on project gateway: Execution default of goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke failed: Could not determine java version from '11.0.18'. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
原本以为是oracle的java11版本不对;更换了java8还是不行;又更换了openjdk11.0.18。行不通
网上说是镜像问题,更换镜像还是一样没解决。
都是在报同样的错误
有了解过这块的吗?求帮助!
这可能是因为该插件可能不支持Java 11.0.18这个特定的版本号,或者插件在解析版本号时存在bug。解决这个问题的方法可能包括以下几步:
检查thingsboard-gateway项目的构建配置,确认是否指定了正确的Java版本。可以查看项目的构建脚本(例如build.gradle或pom.xml文件),确认Java版本号是否设置为合适的值(例如11.0.18)。
检查org.fortasoft:gradle-maven-plugin插件的版本是否为最新版本。如果不是最新版本,尝试升级插件版本到最新版,看看是否解决了问题。
检查org.fortasoft:gradle-maven-plugin插件的文档和发布说明,确认它是否支持Java 11.0.18这个版本号。如果不支持,考虑降低Java版本到插件支持的范围内。
如果上述方法无效,可以尝试使用其他类似功能的插件替代org.fortasoft:gradle-maven-plugin,或者尝试与插件作者或社区联系,报告这个问题,看看是否可以得到解决或者有其他解决方案。
另外,还可以尝试更新Java安装或运行环境,确保使用的Java版本是正式发布的稳定版本,以避免可能存在的版本号解析问题。
如果以上方法仍无法解决问题,建议进一步检查项目的构建配置、插件版本和Java环境,并查找相关的文档和资源,或者向相关社区或开发者寻求帮助。
不知道你这个问题是否已经解决, 如果还没有解决的话: