OpenShift: Java maven build "Generic Build failure" 但日志显示没有错误

OpenShift: Java maven build "Generic Build failure" but log shows no error

我正在使用 S2I 在 OpenShift Dedicated 上构建 a maven project,但是构建失败并显示 "Generic Build failure - check logs for details."

但是,构建日志没有显示错误

为什么这个构建失败了?

按照@Graham 的建议检查限制,作者:

oc -n yourproject get limits -o yaml
oc -n yourproject get quota -o yaml

甚至直接编辑:

oc -n yourproject edit limits

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: LimitRange
metadata:
  creationTimestamp: 1999-08-11T13:58:34Z
  name: resource-limits
  namespace: yourproject
  resourceVersion: "61912526"
  selfLink: /api/v1/namespaces/betvictor/limitranges/resource-limits
  uid: 2a275347-7e9d-11e7-8242-005056957160
spec:
  limits:
  - max:
      memory: 3001Mi
    min:
      memory: 10Mi
    type: Pod
  - default:
      memory: 300Mi
    defaultRequest:
      memory: 250Mi
    max:
      memory: 3000Mi
    min:
      memory: 10Mi
    type: Container

注意单位,如果每个条目的单位相同就更好了。 Pod 最大值必须等于或大于容器最大值。

构建一个 java 应用程序的一半工作对于我所知道的来说并不多...

根据 ptrk 的回答诊断出问题所在: 当 运行:

时,有两种方法可以在 OpenShift 上为 wildfly pod 提供更多内存
  • 在控制台中:部署 -> select 部署 -> 编辑资源限制
  • in the template

构建内存,也可以在模板中指定:

  - kind: BuildConfig
    ...
    spec:
      ...
      resources:
        limits:
          cpu: 1
          memory: 1Gi
        # requests:
          # cpu: 1
          # memory: 1Gi