使用fabric8-maven-plugin插件的错误处理(No plugin found for prefix 'fabric8')
时间:2022-06-24
本文章向大家介绍使用fabric8-maven-plugin插件的错误处理(No plugin found for prefix 'fabric8'),主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
版权声明:欢迎转载,请注明出处,谢谢。 https://blog.csdn.net/boling_cavalry/article/details/91132345
使用maven插件fabric8-maven-plugin部署springboot应用到kubernetes时遇到构建失败的问题,错误信息是No plugin found for prefix ‘fabric8’ in the current project,通过修改maven的settings.xml解决问题,在此做个记录:
环境信息
- 操作系统:CentOS Linux release 7.6.1810
- Kubernetes:1.14.0
- Java:1.8.0_191
- Maven:3.6.0
- fabric8-maven-plugin插件:3.5.37
错误出现
构建部署命令如下:
mvn clean package fabric8:deploy -Pkubernetes
执行上述命令后,构建失败,错误信息如下:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Spring Cloud Kubernetes :: Examples 1.1.0.BUILD-SNAPSHOT:
[INFO]
[INFO] Spring Cloud Kubernetes :: Examples ................ SKIPPED
[INFO] Spring Cloud Kubernetes :: Examples :: Reload ConfigMap SKIPPED
[INFO] Spring Cloud Kubernetes :: Examples :: Hello World . SKIPPED
[INFO] Spring Cloud Kubernetes :: Examples :: Leader Election SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 59.089 s
[INFO] Finished at: 2019-06-07T19:15:14+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'fabric8' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/root/.m2/repository), spring-snapshots (https://repo.spring.io/libs-snapshot-local), spring-milestones (https://repo.spring.io/libs-milestone-local), spring-releases (https://repo.spring.io/libs-release-local), central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException
解决问题
- 需要修改maven的配置文件settings.xml,完整路径是apache-maven-3.6.0/conf/settings.xml;
- 在settings.xml文件内,找到pluginGroups节点,在里面增加两行,修改完成后效果如下:
<pluginGroups>
<pluginGroup>io.fabric8</pluginGroup>
<pluginGroup>org.springframework.boot</pluginGroup>
</pluginGroups>
- 修改完毕保存退出;
问题解决:
再次执行mvn clean package fabric8:deploy -Pkubernetes,问题解决,如下:
[INFO] --- fabric8-maven-plugin:3.5.37:deploy (default-cli) @ kubernetes-leader-election-example ---
[INFO] F8: Using Kubernetes at https://192.168.121.128:6443/ in namespace default with manifest /usr/local/work/k8s/spring-cloud-kubernetes-master/spring-cloud-kubernetes-examples/kubernetes-leader-election-example/target/classes/META-INF/fabric8/kubernetes.yml
[INFO] Using namespace: default
[INFO] Creating a Service from kubernetes.yml namespace default name kubernetes-leader-election-example
[INFO] Created Service: spring-cloud-kubernetes-examples/kubernetes-leader-election-example/target/fabric8/applyJson/default/service-kubernetes-leader-election-example.json
[INFO] Using namespace: default
[INFO] Creating a Deployment from kubernetes.yml namespace default name kubernetes-leader-election-example
[INFO] Created Deployment: spring-cloud-kubernetes-examples/kubernetes-leader-election-example/target/fabric8/applyJson/default/deployment-kubernetes-leader-election-example.json
[INFO] F8: HINT: Use the command `kubectl get pods -w` to watch your pods start up
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Spring Cloud Kubernetes :: Examples 1.1.0.BUILD-SNAPSHOT:
[INFO]
[INFO] Spring Cloud Kubernetes :: Examples ................ SUCCESS [02:44 min]
[INFO] Spring Cloud Kubernetes :: Examples :: Reload ConfigMap SUCCESS [ 55.511 s]
[INFO] Spring Cloud Kubernetes :: Examples :: Hello World . SUCCESS [ 13.684 s]
[INFO] Spring Cloud Kubernetes :: Examples :: Leader Election SUCCESS [02:07 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:04 min
[INFO] Finished at: 2019-06-07T19:28:34+08:00
[INFO] ------------------------------------------------------------------------
查看kubernetes的service,发现部署成功:
[root@maven spring-cloud-kubernetes-examples]# kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 18h
kubernetes-hello-world NodePort 10.100.204.21 <none> 8080:30134/TCP 5m39s
kubernetes-leader-election-example NodePort 10.102.68.119 <none> 8080:30642/TCP 3m32s
spring-cloud-reload NodePort 10.98.2.101 <none> 8080:31993/TCP 5m53s
- 你真的会玩SQL吗?玩爆你的数据报表之存储过程编写(下)
- 你真的会玩SQL吗?透视转换的艺术
- 你真的会玩SQL吗?玩爆你的数据报表之存储过程编写(上)
- 你真的会玩SQL吗?实用函数方法汇总
- 你真的会玩SQL吗?冷落的Top和Apply
- 你真的会玩SQL吗?你所不知道的 数据聚合
- 你真的会玩SQL吗?简单的数据修改
- 将Error异常日志从普通日志中剥离
- 一步一步在Windows中使用MyCat负载均衡 下篇
- Android实现TCP断点上传,后台C#服务实现接收
- Android如何制作漂亮的自适布局的键盘
- 实用收藏Linux命令备忘
- 0基础搭建Hadoop大数据处理-环境
- 如何实现两台服务器间无密码的传输数据和操作
- java教程
- Java快速入门
- Java 开发环境配置
- Java基本语法
- Java 对象和类
- Java 基本数据类型
- Java 变量类型
- Java 修饰符
- Java 运算符
- Java 循环结构
- Java 分支结构
- Java Number类
- Java Character类
- Java String类
- Java StringBuffer和StringBuilder类
- Java 数组
- Java 日期时间
- Java 正则表达式
- Java 方法
- Java 流(Stream)、文件(File)和IO
- Java 异常处理
- Java 继承
- Java 重写(Override)与重载(Overload)
- Java 多态
- Java 抽象类
- Java 封装
- Java 接口
- Java 包(package)
- Java 数据结构
- Java 集合框架
- Java 泛型
- Java 序列化
- Java 网络编程
- Java 发送邮件
- Java 多线程编程
- Java Applet基础
- Java 文档注释
- 带你体验Apache NIFI新建数据同步流程(NIFI入门)
- Spring JPA 存储库接口定义
- 如何给Apache开源项目贡献代码
- 深入解析Apache NIFI的调度策略
- Linux 帮助命令及工具(tldr,man,help,info)
- Json Jolt教程
- Linux 日常操作
- 回顾|腾讯云 CFS 文件存储给 Serverless 云函数带来的业务新场景
- Apache NIFI Run Duration深入理解
- Controller services are daemons
- 动手体验JVM中Class对象的唯一性
- Java SPI机制
- Apache NIFI项目结构的类资源隔离机制
- Java类加载器
- Java反射原理