前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用fabric8-maven-plugin插件的错误处理(No plugin found for prefix 'fabric8')

使用fabric8-maven-plugin插件的错误处理(No plugin found for prefix 'fabric8')

作者头像
程序员欣宸
发布2019-07-02 11:26:53
9600
发布2019-07-02 11:26:53
举报
文章被收录于专栏:实战docker

版权声明:欢迎转载,请注明出处,谢谢。 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解决问题,在此做个记录:

环境信息

  1. 操作系统:CentOS Linux release 7.6.1810
  2. Kubernetes:1.14.0
  3. Java:1.8.0_191
  4. Maven:3.6.0
  5. fabric8-maven-plugin插件:3.5.37

错误出现

构建部署命令如下:

代码语言:javascript
复制
mvn clean package fabric8:deploy -Pkubernetes

执行上述命令后,构建失败,错误信息如下:

代码语言:javascript
复制
[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

解决问题

  1. 需要修改maven的配置文件settings.xml,完整路径是apache-maven-3.6.0/conf/settings.xml;
  2. 在settings.xml文件内,找到pluginGroups节点,在里面增加两行,修改完成后效果如下:
代码语言:javascript
复制
<pluginGroups>
    <pluginGroup>io.fabric8</pluginGroup>
    <pluginGroup>org.springframework.boot</pluginGroup>
  </pluginGroups>
  1. 修改完毕保存退出;

问题解决:

再次执行mvn clean package fabric8:deploy -Pkubernetes,问题解决,如下:

代码语言:javascript
复制
[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,发现部署成功:

代码语言:javascript
复制
[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
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019年06月07日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 环境信息
  • 错误出现
  • 解决问题
  • 问题解决:
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档