ThingsBoard初体验
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project netty-mqtt: Fatal error compiling: 无效的标记: --release ->[Help 1]
编辑.bash_profile ,把java_home指向11,然后执行mvn clean install,提示如下:
thingsboard % mvn clean install
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
编辑~/.zshrc文件,把JAVA_HOME也改成11对应的jdk目录,
source ~/.zshrc
再次执行mvn -v,提示正确
然后执行mvn clean install -Dmaven.test.skip=true 报错如下
[ERROR] Failed to execute goal org.thingsboard:gradle-maven-plugin:1.0.11:invoke (default) on project http: org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.1.1-bin.zip'
以下段原文链接:https://blog.csdn.net/NightHulk/article/details/107182412
报错如上,这是编译3.0遇到的问题
Failed to execute goal org.thingsboard:gradle-maven-plugin:1.0.10:invoke (default) on project http: Execution default of goal org.thingsboard:gradle-maven-plugin:1.0.10:invoke failed: Plugin org.thingsboard:gradle-maven-plugin:1.0.10 or one of its dependencies could not be resolved: Could not find artifact org.gradle:gradle-tooling-api:jar:6.3 in nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public)
刚解决过来回答一波。镜像的问题,还是要用阿里云镜像,但是url不同,下面这个实测可以
切换到maven安装目录下的conf文件下,修改setting.xml
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
<mirrors>
这样改过以后我编译就不报错了,顺便贴一下报错的代码,告诫一下
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirrors>
以上段原文链接:https://blog.csdn.net/NightHulk/article/details/107182412
以上仍然没有解决问题,再次运行mvn clean install -Dmaven.test.skip=true,再次报错如下
[ERROR] Failed to execute goal org.thingsboard:gradle-maven-plugin:1.0.11:invoke (default) on project http: org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.1.1-bin.zip'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.thingsboard:gradle-maven-plugin:1.0.11:invoke (default) on project http: org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.1.1-bin.zip'.

[ERROR] Failed to execute goal on project application: Could not resolve dependencies for project org.thingsboard:application:jar:3.5.1-SNAPSHOT: Failure to find org.thingsboard:rest-client:jar:3.5.1-SNAPSHOT in http://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus-aliyun has elapsed or updates are forced -> [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.
无奈升级了maven 版本,从3.6.3到3.9.2,跨度蛮大的,蛮长时间么有升级了
升级后还是报一样的错误
The requested profile "jdk1.8" could not be activated because it does not exist