Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sidecar based maven and gradle Java stacks #12898

Merged
merged 8 commits into from
Mar 29, 2019
154 changes: 112 additions & 42 deletions ide/che-core-ide-stacks/src/main/resources/stacks.json
Original file line number Diff line number Diff line change
Expand Up @@ -739,91 +739,161 @@
{
"id": "java-default",
"creator": "ide",
"name": "Java",
"description": "Default Java Stack with JDK 8, Maven and Tomcat.",
"name": "Java Maven",
"description": "Default Java Stack with OpenJKD 11 and Maven 3.6",
"scope": "general",
"tags": [
"Java",
"JDK",
"OpenJDK",
"Maven",
"Tomcat"
"spring boot v2",
l0rd marked this conversation as resolved.
Show resolved Hide resolved
"vert.x",
l0rd marked this conversation as resolved.
Show resolved Hide resolved
"Debian"
],
"components": [
{
"name": "Ubuntu",
"version": "16.04"
"name": "Debian",
"version": "9.8"
},
{
"name": "JDK",
"version": "1.8.0_162"
"name": "OpenJDK",
"version": "11.0.2"
},
{
"name": "Maven",
"version": "3.3.9"
},
{
"name": "Tomcat",
"version": "8.0.24"
"version": "3.6.0"
}
],
"workspaceConfig": {
"environments": {
"default": {
"machines": {
"dev-machine": {
"installers": [
"org.eclipse.che.exec",
"org.eclipse.che.terminal",
"org.eclipse.che.ws-agent",
"org.eclipse.che.ls.java"
],
"maven-container": {
"servers": {
"tomcat8": {
"8080/tcp": {
"port": "8080",
"protocol": "http"
},
"tomcat8-debug": {
"port": "8000",
"protocol": "http"
},
"codeserver": {
"port": "9876",
"protocol": "http"
}
},
"attributes": {
"memoryLimitBytes": "2147483648"
"memoryLimitBytes": "512000000",
"containerCommand": "['sleep']",
"containerArgs": "['infinity']"
},
"volumes": {
"m2": {
"path": "/home/user/.m2"
},
"javadata": {
"path": "/home/user/jdtls/data"
"projects": {
"path": "/projects"
}
},
"env": {
"MAVEN_CONFIG": "/home/user/.m2",
"MAVEN_OPTS": "-XX:MaxRAM=150m -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom",
"JAVA_OPTS": "-XX:MaxRAM=150m -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom",
"PS1": "$(echo ${0})\\$",
"HOME": "/home/user"
}
}
},
"recipe": {
"content": "eclipse/ubuntu_jdk8",
"content": "maven:3.6.0-jdk-11",
"type": "dockerimage"
}
}
},
"name": "default",
"defaultEnv": "default",
"description": null,
"commands": [
{
"commandLine": "mvn clean install -f ${current.project.path}",
"name": "build",
"type": "mvn",
"attributes": {
"previewUrl": "",
"goal": "Build"
"attributes": {
"plugins": "che-machine-exec-plugin:0.0.1,org.eclipse.che.vscode-redhat.java:0.38.0",
"editor": "org.eclipse.che.editor.theia:next",
"sidecar.org.eclipse.che.vscode-redhat.java.memory_limit": "1024Mi",
"sidecar.org.eclipse.che.editor.theia.memory_limit": "512Mi"
},
"commands": []
},
"stackIcon": {
"name": "type-java.svg",
"mediaType": "image/svg+xml"
}
},
{
"id": "java-gradle",
"creator": "ide",
"name": "Java Gradle",
"description": "Java Stack with OpenJDK 11 and Gradle 5.2.1",
"scope": "general",
"tags": [
"Java",
"OpenJDK",
"Gradle",
"spring boot v2",
l0rd marked this conversation as resolved.
Show resolved Hide resolved
"Debian"
],
"components": [
{
"name": "Debian",
"version": "9.8"
},
{
"name": "OpenJDK",
"version": "11.0.2"
},
{
"name": "Gradle",
"version": "5.2.1"
}
],
"workspaceConfig": {
"environments": {
"default": {
"machines": {
"gradle-container": {
"servers": {
"8080/tcp": {
"port": "8080",
"protocol": "http"
}
},
"attributes": {
"memoryLimitBytes": "512000000",
"containerCommand": "['sleep']",
"containerArgs": "['infinity']"
},
"volumes": {
"gradle": {
"path": "/home/user/.gradle"
},
"projects": {
"path": "/projects"
}
},
"env": {
"GRADLE_USER_HOME": "/home/user/.gradle",
"JAVA_OPTS": "-XX:MaxRAM=150m -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom",
"PS1": "$(echo ${0})\\$",
"HOME": "/home/user"
}
}
},
"recipe": {
"content": "gradle:5.2.1-jdk11",
"type": "dockerimage"
}
}
]
},
"name": "default",
"defaultEnv": "default",
"description": null,
"attributes": {
"plugins": "che-machine-exec-plugin:0.0.1,org.eclipse.che.vscode-redhat.java:0.38.0",
"editor": "org.eclipse.che.editor.theia:next",
"sidecar.org.eclipse.che.vscode-redhat.java.memory_limit": "1024Mi",
"sidecar.org.eclipse.che.editor.theia.memory_limit": "512Mi"
},
"commands": []
},
"stackIcon": {
"name": "type-java.svg",
Expand Down
138 changes: 128 additions & 10 deletions ide/che-core-ide-templates/src/main/resources/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,7 @@
"links": [],
"category": "Samples",
"tags": [
"maven",
"spring",
"java"
"tomcat"
]
},
{
Expand Down Expand Up @@ -762,18 +760,36 @@
},
"commands": [
{
"name": "build",
"name": "maven build",
"type": "mvn",
"commandLine": "mvn -f ${current.project.path} clean install",
"commandLine": "mvn -Duser.home=${HOME} -f ${CHE_PROJECTS_ROOT}/console-java-simple clean install",
"attributes": {
"previewUrl": "",
"goal": "Build"
}
},
{
"name": "run",
"name": "maven build and run",
"type": "mvn",
"commandLine": "mvn -f ${current.project.path} clean install \njava -jar ${current.project.path}/target/*.jar",
"commandLine": "mvn -Duser.home=${HOME} -f ${CHE_PROJECTS_ROOT}/console-java-simple clean install \njava -jar ${CHE_PROJECTS_ROOT}/console-java-simple/target/*.jar",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "gradle build",
"type": "gralde",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/console-java-simple; gradle build",
"attributes": {
"previewUrl": "",
"goal": "Build"
}
},
{
"name": "gradle run",
"type": "gradle",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/console-java-simple; gradle run",
"attributes": {
"previewUrl": "",
"goal": "Run"
Expand All @@ -784,7 +800,8 @@
"category": "Samples",
"tags": [
"java",
"maven"
"maven",
"gradle"
]
},
{
Expand Down Expand Up @@ -904,7 +921,26 @@
"location": "https://github.com/openshiftio-vertx-boosters/vertx-http-booster",
"parameters": {}
},
"commands": [],
"commands": [
{
"name": "build",
"type": "mvn",
"commandLine": "mvn -Duser.home=${HOME} -f ${CHE_PROJECTS_ROOT}/vertx-http-booster clean package",
"attributes": {
"previewUrl": "",
"goal": "Build"
}
},
{
"name": "run",
"type": "mvn",
"commandLine": "mvn -Duser.home=${HOME} -f ${CHE_PROJECTS_ROOT}/vertx-http-booster vertx:run",
"attributes": {
"previewUrl": "${server.8080/tcp}",
"goal": "Run"
}
}
],
"links": [],
"category": "Samples",
"tags": [
Expand All @@ -930,7 +966,26 @@
"location": "https://github.com/openshiftio-vertx-boosters/vertx-health-checks-booster",
"parameters": {}
},
"commands": [],
"commands": [
{
"name": "build",
"type": "mvn",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/vertx-health-checks-booster; mvn -Duser.home=${HOME} clean package",
"attributes": {
"previewUrl": "",
"goal": "Build"
}
},
{
"name": "run",
"type": "mvn",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/vertx-health-checks-booster; mvn -Duser.home=${HOME} vertx:run",
"attributes": {
"previewUrl": "${server.8080/tcp}",
"goal": "Run"
}
}
],
"links": [],
"category": "Samples",
"tags": [
Expand Down Expand Up @@ -989,6 +1044,69 @@
"spring boot"
]
},
{
"name": "spring-boot-gs-rest-service",
"displayName": "spring-boot-gs-rest-service",
"path": "/gs-rest-service",
"description": "Spring Boot Guide to build a RESTful web service ",
l0rd marked this conversation as resolved.
Show resolved Hide resolved
"projectType": "maven",
"mixins": [],
"attributes": {
"language": [
"java"
]
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/spring-guides/gs-rest-service",
"parameters": {}
},
"commands": [
{
"name": "mvn build",
"type": "mvn",
"commandLine": "mvn -Duser.home=${HOME} -f ${CHE_PROJECTS_ROOT}/gs-rest-service/complete clean package",
"attributes": {
"previewUrl": "",
"goal": "Build"
}
},
{
"name": "mvn run",
"type": "mvn",
"commandLine": "mvn -Duser.home=${HOME} -f ${CHE_PROJECTS_ROOT}/gs-rest-service/complete spring-boot:run",
"attributes": {
"previewUrl": "${server.8080/tcp}/greeting",
"goal": "Run"
}
},
{
"name": "gradle build",
"type": "gralde",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/gs-rest-service/complete; gradle build",
"attributes": {
"previewUrl": "",
"goal": "Build"
}
},
{
"name": "gradle run",
"type": "gradle",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/gs-rest-service/complete; gradle bootRun",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
}
],
"links": [],
"category": "Samples",
"tags": [
"spring boot v2"
l0rd marked this conversation as resolved.
Show resolved Hide resolved
]
},
{
"name": "wfswarm-rest-http",
"displayName": "wfswarm-rest-http",
Expand Down