This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Add Java Web devfiles #18
Merged
sleshchenko
merged 10 commits into
eclipse-che:master
from
sleshchenko:moreJavaDevfiles
Jul 16, 2019
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fa9c8a7
Add java-web-spring devfile
sleshchenko 6db0048
Add Java MySQL devfile
sleshchenko 8887085
Add Java Web Vert.x devfile
sleshchenko 3e293bc
Merge remote-tracking branch 'upstream/master' into moreJavaDevfiles
metlos bac1103
Vert.x example now works.
metlos 131280f
Convert the java-web-spring example to use the spring-petclinic project.
metlos 7dd6a70
Update the java-mysql sample to use the spring-petclinic project
metlos bacad06
updated java samples metadata
sparkoo f7d3b06
updated java options in java vertx devfile
sparkoo 319ae68
Increase memory for java-mysql since otherwise build command is killed
sleshchenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
apiVersion: 1.0.0 | ||
metadata: | ||
name: java-mysql | ||
projects: | ||
- | ||
name: web-java-spring-petclinic | ||
source: | ||
type: git | ||
location: "https://github.com/spring-projects/spring-petclinic.git" | ||
components: | ||
- | ||
type: chePlugin | ||
id: redhat/java/latest | ||
- | ||
type: dockerimage | ||
alias: tools | ||
image: registry.centos.org/che-stacks/centos-jdk8 | ||
command: ['sleep'] | ||
args: ['infinity'] | ||
env: | ||
- name: JAVA_OPTS | ||
value: "-XX:MaxRAMPercentage=50.0 -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 | ||
-Duser.home=/home/user" | ||
- name: MAVEN_OPTS | ||
value: $(JAVA_OPTS) | ||
- name: PS1 | ||
value: $(echo ${0})\\$ | ||
memoryLimit: 512Mi | ||
endpoints: | ||
- name: '8080/tcp' | ||
port: 8080 | ||
mountSources: true | ||
volumes: | ||
- name: m2 | ||
containerPath: /home/user/.m2 | ||
- | ||
type: dockerimage | ||
alias: mysql | ||
image: centos/mysql-57-centos7 | ||
env: | ||
- name: MYSQL_USER | ||
value: petclinic | ||
- name: MYSQL_PASSWORD | ||
value: password | ||
- name: MYSQL_DATABASE | ||
value: petclinic | ||
- name: PS1 | ||
value: $(echo ${0})\\$ | ||
memoryLimit: 256Mi | ||
endpoints: | ||
- name: 'db' | ||
port: 3306 | ||
attributes: | ||
discoverable: "true" | ||
public: "false" | ||
mountSources: false | ||
commands: | ||
- | ||
name: maven build | ||
actions: | ||
- | ||
type: exec | ||
component: tools | ||
command: "./mvnw clean install" | ||
workdir: "${CHE_PROJECTS_ROOT}/web-java-spring-petclinic" | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: run webapp | ||
actions: | ||
- | ||
type: exec | ||
component: tools | ||
command: | | ||
SPRING_DATASOURCE_URL=jdbc:mysql://db/petclinic SPRING_DATASOURCE_USERNAME=petclinic SPRING_DATASOURCE_PASSWORD=password java -jar target/*.jar --spring.profile.active=mysql | ||
workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-petclinic | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
displayName: Java MySQL | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
description: Default Java MySQL | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tags: ["Java", "Maven", "Spring Boot v2", "MySQL"] | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
globalMemoryLimit: 2930Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
apiVersion: 1.0.0 | ||
metadata: | ||
name: java-web-spring | ||
projects: | ||
- | ||
name: java-web-spring | ||
source: | ||
type: git | ||
location: "https://github.com/spring-projects/spring-petclinic.git" | ||
components: | ||
- | ||
type: chePlugin | ||
id: redhat/java/latest | ||
- | ||
type: dockerimage | ||
alias: tools | ||
image: registry.centos.org/che-stacks/centos-jdk8 | ||
command: ['sleep'] | ||
args: ['infinity'] | ||
env: | ||
- name: JAVA_OPTS | ||
value: "-XX:MaxRAMPercentage=50.0 -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 | ||
-Duser.home=/home/user" | ||
- name: MAVEN_OPTS | ||
value: $(JAVA_OPTS) | ||
- name: PS1 | ||
value: $(echo ${0})\\$ | ||
memoryLimit: 1024Mi | ||
endpoints: | ||
- name: '8080/tcp' | ||
port: 8080 | ||
mountSources: true | ||
volumes: | ||
- name: m2 | ||
containerPath: /home/user/.m2 | ||
commands: | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- | ||
name: maven build | ||
actions: | ||
- | ||
type: exec | ||
component: tools | ||
command: "./mvnw clean install" | ||
workdir: ${CHE_PROJECTS_ROOT}/java-web-spring | ||
- name: run webapp | ||
actions: | ||
- | ||
type: exec | ||
component: tools | ||
command: "java -jar target/*.jar" | ||
workdir: ${CHE_PROJECTS_ROOT}/java-web-spring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
displayName: Java Web Spring | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
description: Default Java Spring Stack | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tags: ["Java", "Maven", "Spring Boot v2"] | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
globalMemoryLimit: 2674Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
apiVersion: 1.0.0 | ||
metadata: | ||
name: java-web-vertx | ||
projects: | ||
- | ||
name: java-web-vertx | ||
source: | ||
type: git | ||
location: "https://github.com/che-samples/web-java-vertx" | ||
components: | ||
- | ||
type: chePlugin | ||
id: redhat/java/latest | ||
- | ||
type: dockerimage | ||
alias: maven | ||
image: registry.centos.org/che-stacks/centos-jdk8 | ||
command: ['sleep'] | ||
args: ['infinity'] | ||
env: | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: MAVEN_CONFIG | ||
value: /home/user/.m2 | ||
- name: MAVEN_OPTS | ||
value: "-XX:MaxRAMPercentage=50.0 -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 | ||
-Duser.home=/home/user" | ||
- name: JAVA_OPTS | ||
value: "-XX:MaxRAMPercentage=50.0 -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" | ||
- name: JAVA_TOOL_OPTIONS | ||
value: "-XX:MaxRAMPercentage=50.0 -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" | ||
- name: PS1 | ||
value: $(echo ${0})\\$ | ||
- name: HOME | ||
value: /home/user | ||
memoryLimit: 512Mi | ||
endpoints: | ||
- name: '8080/tcp' | ||
port: 8080 | ||
mountSources: true | ||
volumes: | ||
- name: m2 | ||
containerPath: /home/user/.m2 | ||
commands: | ||
- | ||
name: maven build | ||
actions: | ||
- | ||
type: exec | ||
component: maven | ||
command: "mvn -Duser.home=${HOME} clean install" | ||
workdir: "${CHE_PROJECTS_ROOT}/java-web-vertx" | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- | ||
name: run app | ||
actions: | ||
- | ||
type: exec | ||
component: maven | ||
command: "JDBC_URL=jdbc:h2:/tmp/db java -jar ./target/*fat.jar" | ||
workdir: "${CHE_PROJECTS_ROOT}/java-web-vertx" | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
displayName: Vertx Web | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
description: Default Vertx Web Stack | ||
sleshchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tags: ["Java", "Maven", "Spring Boot v2", "Vertx"] | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
globalMemoryLimit: 2674Mi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say command to run server in debug mode is missed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. It's a nice way to improve this and other java stacks, I'm going to merge as is and create a separate issue to improve it. I think except Debug it also needs command to stop the application, because probably user starts his app, sees that something is wrong, stops app and rerun it in debug mode.