#
# Copyright (c) 2012-2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
#   Red Hat, Inc. - initial API and implementation
#

---
apiVersion: 1.0.0
metadata:
  name: petclinic-dev-environment
  generateName: petclinic-
projects:
  - name: petclinic
    source:
      type: git
      location: 'git@github.com:spring-projects/spring-petclinic.git'
components:
  - alias: mvn-stack
    type: chePlugin
    id: eclipse/chemaven-jdk8/1.0.0
  - type: cheEditor
    id: eclipse/che-theia/0.0.3
  - alias: jdt.ls
    type: chePlugin
    id: org.eclipse.chetheia-jdtls:0.0.3
    preferences:
      java.home: '/home/user/jdk11'
      java.jdt.ls.vmargs: '-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication'
      java.jtg.memory: 12345
      java.boolean: true
  - type: openshift
    reference: petclinic.yaml
    selector:
      app.kubernetes.io/name: mysql
      app.kubernetes.io/component: database
      app.kubernetes.io/part-of: petclinic
commands:
  - name: build
    actions:
      - type: exec
        component: mvn-stack
        command: mvn package
        workdir: /projects/spring-petclinic
  - name: run
    attributes:
      runType: sequential
    actions:
      - type: exec
        component: mvn-stack
        command: mvn spring-boot:run
        workdir: /projects/spring-petclinic
  - name: other
    actions:
      - type: exec
        component: jdt.ls
        command: run.sh
