che icon indicating copy to clipboard operation
che copied to clipboard

Eclipse Che: Unable to add plug-in automatically in workspace using Devfile

Open debkantap opened this issue 2 years ago • 4 comments

Summary

I created a simple devfile and tried to add "redhat.java", plug-in in the dev workspace automatically while creating the workspace, but it is not added automatically. Any clue where I am doing wrong. I have installed eclipse che on vanilla k8s I have followed the below link: https://medium.com/eclipse-che-blog/devfile-v2-and-ide-plug-ins-in-eclipse-che-7a560ae724b1 and here is my simple devfile:

---*****----------------

schemaVersion: 2.2.0 metadata: name: helloworld-example attributes: .vscode/extensions.json: | { "recommendations": [ "redhat.java" ] } components:

  • name: dev-tooling container: image: quay.io/devfile/universal-developer-image:ubi8-latest endpoints: - name: http-3000 targetPort: 3000 commands:
  • id: install exec: commandLine: npm install component: dev-tooling workingDir: ${PROJECT_SOURCE} group: isDefault: true kind: build
  • id: run exec: commandLine: node app.js component: dev-tooling workingDir: ${PROJECT_SOURCE} group: isDefault: true kind: run

Relevant information

No response

debkantap avatar Jan 24 '24 10:01 debkantap

Also followed this link below: https://devfile.io/docs/2.0.0/adding-plugin-component

debkantap avatar Jan 24 '24 11:01 debkantap

@debkantap in order to install extensions automatically just add .vscode/extensions.json to the root of the repository e.g. https://github.com/che-incubator/quarkus-api-example/blob/main/.vscode/extensions.json

ibuziuk avatar Feb 02 '24 09:02 ibuziuk

@ibuziuk ..Thanks for your reply. I did added the extensions.json in my devfile repo, but not lucky. My devfile is very simple and attached. The devfile repo screenshot is also attached. May be doing some mistake, can you please help. Thanks Debkanta devfile-repo

----Devfile---

schemaVersion: 2.2.0 metadata: name: helloworld-example attributes: .vscode/extensions.json: | { "recommendations": [ "redhat.java" ] } components:

  • name: dev-tooling container: image: quay.io/devfile/universal-developer-image:ubi8-latest endpoints: - name: http-3000 targetPort: 3000
  • name: sonarlint-vscode plugin: reference: https://github.com/sainirijul/che-plugin-registry/blob/master/v3/plugins/sonarsource/sonarlint-vscode/1.13.0/meta.yaml commands:
  • id: install exec: commandLine: npm install component: dev-tooling workingDir: ${PROJECT_SOURCE} group: isDefault: true kind: build
  • id: run exec: commandLine: node app.js component: dev-tooling workingDir: ${PROJECT_SOURCE} group: isDefault: true kind: run

debkantap avatar Feb 07 '24 17:02 debkantap

@ibuziuk thanks for your help..Now I am able to install plug-in automatically in workspace. Not sure what the issue was, but just added one more plug-ins in the extensions.json and it started working!!

{ "recommendations": [ "github.vscode-pull-request-github", "redhat.java" ] }

Now adding plug-ins/extensions for Intellij based editor is same? pls guide.

Thanks & Regards Debkanta

debkantap avatar Feb 12 '24 15:02 debkantap

Closing the issue at it is resolved for VS Code Editor

debkantap avatar Feb 20 '24 11:02 debkantap