写文章就是为了帮助更多的人!顺便留下自己的成长轨迹。。。
如果对你有用 记得收藏+点赞+关注额 !!!---- Nick.Peng
一、编译镜像报错
报错信息
[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project app: Unable to resolve artifact: Missing:
[ERROR] ----------
[ERROR] 1) com.google.protobuf:protoc:exe:osx-aarch_64:3.9.1
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.9.1 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.9.1 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) funenc.flowable_java:app:jar:0.0.1-SNAPSHOT
[ERROR] 2) com.google.protobuf:protoc:exe:osx-aarch_64:3.9.1
解决方案
- 原因时目前M1 对protobuf不支持,这里直接修改maven的settings.xml 来解决;
- 打开
~/.m2/settings.xml
配置文件,添加以下内容即可,如图所示:<profile> <id>apple-silicon</id> <properties> <os.detected.classifier>osx-x86_64</os.detected.classifier> </properties> </profile> <activeProfiles> <activeProfile> apple-silicon </activeProfile> </activeProfiles>
- 重新编译,问题解决
二、同步仓库报错
报错信息
java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate. Use build process “jps.track.ap.dependencies” VM flag to enable/disable incremental annotation processing environment.
解决方案
- 打开idea设置,在以下位置增加这个配置:
-Djps.track.ap.dependencies=false
- 清除缓存