4 Commits

Author SHA1 Message Date
a2f80820eb jdk 11.0.15 2023-09-05 15:09:03 -04:00
69701fba42 upgrade from fabric8 to jkube 2023-09-05 15:06:38 -04:00
fd6866da82 fixed typo 2021-06-02 14:27:20 -04:00
4850fe8183 added hotswap plugin disable parameterization 2021-06-01 13:31:11 -04:00
6 changed files with 24 additions and 21 deletions

View File

@@ -9,6 +9,7 @@ ENV JRE_HOME=/usr/local/lib/jvm/java-openjdk-dcevm
ENV JAVA_OPTS=
ENV ENABLE_HOTSWAP=true
ENV ENABLE_JDWP=true
ENV DISABLE_HOTSWAP_PLUGINS=
# Install curl
RUN apt update && \
@@ -32,12 +33,12 @@ RUN mkdir -p /var/lib/jvm && cd /var/lib/jvm && \
mkdir lib lib-extra1 lib-extra2 lib-extra3 lib-extra4 lib-extra5 lib-extra6 lib-extra7
# Add our Docker container initialization scripts
ADD setenv.sh /usr/local/bin/${project.artifactId}-setenv.sh
ADD docker-entrypoint.sh /usr/local/bin
ADD maven/target/setenv.sh /usr/local/bin/${dcevm.prefix}-setenv.sh
ADD maven/target/docker-entrypoint.sh /usr/local/bin
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh
# Add our default hotswap configuration; may be overwritten in dev/classes* volumes
ADD hotswap-agent.properties /var/lib/jvm/lib
ADD maven/target/hotswap-agent.properties /var/lib/jvm/lib
# Listening for Java debugger traffic
EXPOSE 8000

View File

@@ -28,10 +28,11 @@ You may include your own `hotswap-agent.properties` in any of the `classes` fold
You can specify the following environment variables when running the container.
| Environment Variable | Default Value | Description |
| -------------------- | ------------- | ----------- |
| `JAVA_MEMORY_INIT` | `128m` | The initial and minimum JVM memory. |
| `JAVA_MEMORY_MAX` | `512m` | The maximum JVM memory allowed. |
| `ENABLE_HOTSWAP` | `true` | Set to `false` to disable the HotSwap agent. |
| `ENABLE_JDWP` | `true` | Set to `false` to disable the Java debugger. |
| `JAVA_OPTS` | | Set to extend the standard `JAVA_OPTS` environment variable. |
| Environment Variable | Default Value | Description |
| ------------------------- | ------------- | ----------- |
| `JAVA_MEMORY_INIT` | `128m` | The initial and minimum JVM memory. |
| `JAVA_MEMORY_MAX` | `512m` | The maximum JVM memory allowed. |
| `ENABLE_HOTSWAP` | `true` | Set to `false` to disable the HotSwap agent. |
| `DISABLE_HOTSWAP_PLUGINS` | | Provide a comma-delimited list of HotSwap plugins to disable. You can find a list of those plugins here: https://github.com/HotswapProjects/HotswapAgent/tree/master/plugin. The name is only specified in the source, like [*Spring*](https://github.com/HotswapProjects/HotswapAgent/blob/master/plugin/hotswap-agent-spring-plugin/src/main/java/org/hotswap/agent/plugin/spring/SpringPlugin.java). |
| `ENABLE_JDWP` | `true` | Set to `false` to disable the Java debugger. |
| `JAVA_OPTS` | | Set to extend the standard `JAVA_OPTS` environment variable. |

View File

@@ -1,5 +1,5 @@
#!/bin/sh
. /usr/local/bin/java-dcevm-hotswap-setenv.sh
. /usr/local/bin/${dcevm.prefix}-setenv.sh
JAVA_CP="/var/lib/jvm/lib:/var/lib/jvm/lib/*"
JAVA_CP="${JAVA_CP}:/var/lib/jvm/dev/classes:/var/lib/jvm/dev/classes-extra1:/var/lib/jvm/dev/classes-extra2:/var/lib/jvm/dev/classes-extra3:/var/lib/jvm/dev/classes-extra4:/var/lib/jvm/dev/classes-extra5:/var/lib/jvm/dev/classes-extra6:/var/lib/jvm/dev/classes-extra7"

View File

@@ -45,7 +45,7 @@ webappDir=
# Comma separated list of disabled plugins
# Use plugin name - e.g. Hibernate, Spring, ZK, Hotswapper, AnonymousClassPatch, Tomcat, Logback ....
disabledPlugins=
disabledPlugins=${hotswap.disablePlugins}
# Watch for changed class files on watchResources path and reload class definition in the running application.
#

18
pom.xml
View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8</groupId>
<artifactId>java-dcevm-hotswap</artifactId>
<version>11.0.11-1.4.1</version>
<version>11.0.15-1.4.1</version>
<name>Java DCEVM for Rapid Application Development</name>
<packaging>pom</packaging>
@@ -12,10 +12,11 @@
<!-- See: https://hub.docker.com/_/ubuntu -->
<!-- This has very little impact and may be replaced -->
<ubuntu.version>20.04</ubuntu.version>
<dcevm.prefix>${project.artifactId}</dcevm.prefix>
<!-- The version of Java DCEVM to use for executing Apache Tomcat -->
<!-- See: https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases -->
<dcevm.version>11.0.11+1</dcevm.version>
<dcevm.version>11.0.15+1</dcevm.version>
<dcevm.majorVersion>11</dcevm.majorVersion>
<dcevm.os-arch>linux-x64</dcevm.os-arch>
<!-- v11.0.10
@@ -48,7 +49,7 @@
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-resources</id>
@@ -63,9 +64,9 @@
</plugin>
<!-- This plugin build and pushes the Docker image -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>4.4.0</version>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>1.14.0</version>
<configuration>
<images>
<image>
@@ -74,7 +75,6 @@
</image>
</images>
<contextDir>${project.build.directory}</contextDir>
<buildStrategy>docker</buildStrategy>
<verbose>true</verbose>
</configuration>
<executions>
@@ -95,7 +95,7 @@
<!-- This plugin prevents the project from deploying to the Maven Repository, as it is pointless -->
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.1.1</version>
<configuration>
<skip>true</skip>
</configuration>
@@ -107,7 +107,7 @@
<profile>
<id>no-docker</id>
<properties>
<fabric8.build.jib>true</fabric8.build.jib>
<jkube.build.strategy>jib</jkube.build.strategy>
</properties>
</profile>
</profiles>

View File

@@ -3,6 +3,7 @@ JAVA_OPTS="${JAVA_OPTS} -Xms${JAVA_MEMORY_INIT} -Xmx${JAVA_MEMORY_MAX}"
if [ "${ENABLE_HOTSWAP}" = "true" ]; then
JAVA_OPTS="${JAVA_OPTS} -XX:HotswapAgent=external -javaagent:/usr/local/lib/jvm/hotswap-agent.jar"
JAVA_OPTS="${JAVA_OPTS} -Dhotswap.disablePlugins=${DISABLE_HOTSWAP_PLUGINS}"
fi
if [ "${ENABLE_JDWP}" = "true" ]; then