You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2020/06/25 12:57:37 UTC
[tomcat] branch master updated: Move AOT compilation packaging to a
new module
This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new a1a4457 Move AOT compilation packaging to a new module
a1a4457 is described below
commit a1a445749526a4497908270e3b2bfbff15066b8a
Author: remm <re...@apache.org>
AuthorDate: Thu Jun 25 14:56:54 2020 +0200
Move AOT compilation packaging to a new module
Also cleanup and improvements based on newest changes.
---
{res/tomcat-maven => modules/stuffed}/Dockerfile | 6 +++---
{res/tomcat-maven => modules/stuffed}/DockerfileGraal | 5 +++--
{res/tomcat-maven => modules/stuffed}/README.md | 8 ++++----
{res/tomcat-maven => modules/stuffed}/pom.xml | 17 ++++++++++++++---
{res/tomcat-maven => modules/stuffed}/tomcat-jni.json | 0
.../stuffed}/tomcat-reflection.json | 0
.../stuffed}/tomcat-resource.json | 0
{res/tomcat-maven => modules/stuffed}/tomcat.yaml | 2 +-
.../stuffed/webapp-jspc.ant.xml | 6 +++---
9 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/res/tomcat-maven/Dockerfile b/modules/stuffed/Dockerfile
similarity index 91%
rename from res/tomcat-maven/Dockerfile
rename to modules/stuffed/Dockerfile
index 512f232..83e5b6e 100644
--- a/res/tomcat-maven/Dockerfile
+++ b/modules/stuffed/Dockerfile
@@ -14,13 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM openjdk:8-jre-alpine
+FROM openjdk:8-jre
VOLUME /tmp
USER root
RUN mkdir -m 777 -p /deployments
-ADD target/tomcat-maven-1.0.jar /deployments/app.jar
+ADD target/tomcat-stuffed-1.0.jar /deployments/app.jar
ADD conf /deployments/conf
ADD webapps /deployments/webapps
RUN chmod 777 /deployments/webapps
@@ -48,7 +48,7 @@ RUN mkdir -p /opt
# EXPOSE $jolokiaport
# Optional: Add Prometheus agent for JMX monitoring
-# RUN mkdir /opt/prometheus && wget https://repo.maven.apache.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.12.0/jmx_prometheus_javaagent-0.12.0.jar -O /opt/prometheus/prometheus.jar && wget https://raw.githubusercontent.com/prometheus/jmx_exporter/master/example_configs/tomcat.yml -O conf/prometheus.yaml
+# RUN mkdir /opt/prometheus && wget https://repo.maven.apache.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.13.0/jmx_prometheus_javaagent-0.13.0.jar -O /opt/prometheus/prometheus.jar && wget https://raw.githubusercontent.com/prometheus/jmx_exporter/master/example_configs/tomcat.yml -O conf/prometheus.yaml
# ARG prometheusport=9404
# ENV JAVA_OPTS="-javaagent:/opt/prometheus/prometheus.jar=$prometheusport:conf/prometheus.yaml ${JAVA_OPTS}"
# EXPOSE $prometheusport
diff --git a/res/tomcat-maven/DockerfileGraal b/modules/stuffed/DockerfileGraal
similarity index 88%
rename from res/tomcat-maven/DockerfileGraal
rename to modules/stuffed/DockerfileGraal
index b801aa3..19e2353 100644
--- a/res/tomcat-maven/DockerfileGraal
+++ b/modules/stuffed/DockerfileGraal
@@ -21,7 +21,7 @@ VOLUME /tmp
USER root
RUN mkdir -m 777 -p /deployments
-ADD tomcat-maven-1.0 /deployments/app
+ADD tomcat-stuffed-1.0 /deployments/app
ADD conf /deployments/conf
ADD webapps /deployments/webapps
@@ -33,8 +33,9 @@ ARG port=8080
EXPOSE $port
ENV JAVA_OPTS="-Dcatalina.base=. -Djava.security.egd=file:/dev/urandom"
+ENV CATALINA_OPTS="--catalina -useGeneratedCode"
# Add JULI logging configuration
ENV JAVA_OPTS="${JAVA_OPTS} -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=conf/logging.properties"
-ENTRYPOINT [ "sh", "-c", "/deployments/app $JAVA_OPTS" ]
+ENTRYPOINT [ "sh", "-c", "/deployments/app $JAVA_OPTS $CATALINA_OPTS" ]
diff --git a/res/tomcat-maven/README.md b/modules/stuffed/README.md
similarity index 93%
rename from res/tomcat-maven/README.md
rename to modules/stuffed/README.md
index b5e54f7..7e50576 100644
--- a/res/tomcat-maven/README.md
+++ b/modules/stuffed/README.md
@@ -19,7 +19,7 @@
-->
-# Apache Tomcat distribution for Apache Maven
+# Apache Tomcat distribution for container platforms
## Configuration
@@ -37,7 +37,7 @@ mvn clean; mvn package
### Docker build
```
-docker build -t apache/tomcat-maven:1.0 -f ./Dockerfile .
+docker build -t apache/tomcat-stuffed:1.0 -f ./Dockerfile .
```
Docker build arguments include `namepsace` (default is `tomcat`) and `port` which should match the Tomcat port in `server.xml` (default is `8080`). Other ports that need to be exposed can be added in the `Dockerfile` as needed. Webapps should be added to the `webapps` folder where they will be auto deployed by the host if using the defaults. Otherwise, the `Dockerfile` command line can be edited like below to include the necesary resources and command line arguments to run a single or mu [...]
@@ -56,13 +56,13 @@ The default JULI configuration uses `catalina.base`, so specifying the system pr
### Command line example with a single root webapp
```
-java -Dcatalina.base=. -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=conf/logging.properties -jar target/tomcat-maven-1.0.jar --war myrootwebapp
+java -Dcatalina.base=. -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=conf/logging.properties -jar target/tomcat-stuffed-1.0.jar --war myrootwebapp
```
### Command line example with three webapps
```
-java -Dcatalina.base=. -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=conf/logging.properties -jar target/tomcat-maven-1.0.jar --war myrootwebapp --path /path1 --war mywebapp1 --path /path2 --war mywebapp2
+java -Dcatalina.base=. -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=conf/logging.properties -jar target/tomcat-stuffed-1.0.jar --war myrootwebapp --path /path1 --war mywebapp1 --path /path2 --war mywebapp2
```
## Cloud
diff --git a/res/tomcat-maven/pom.xml b/modules/stuffed/pom.xml
similarity index 81%
rename from res/tomcat-maven/pom.xml
rename to modules/stuffed/pom.xml
index 9b37614..f1c84a3 100644
--- a/res/tomcat-maven/pom.xml
+++ b/modules/stuffed/pom.xml
@@ -22,14 +22,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-maven</artifactId>
+ <artifactId>tomcat-stuffed</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>org.apache.catalina.startup.Tomcat</mainClass>
- <tomcat.version>10.0.0-M3</tomcat.version>
+ <tomcat.version>10.0.0-M7</tomcat.version>
+ <!-- <tomcat.version>9.0.37</tomcat.version> -->
</properties>
<dependencies>
@@ -85,7 +86,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
- <version>3.2.1</version>
+ <version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
@@ -95,12 +96,22 @@
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/jakarta.servlet.ServletContainerInitializer</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
+ <resources>
+ <resource>.RSA</resource>
+ <resource>.SF</resource>
+ <resource>META-INF/MANIFEST.MF</resource>
+ <resource>META-INF/web-fragment.xml</resource>
+ </resources>
+ </transformer>
</transformers>
</configuration>
</execution>
diff --git a/res/tomcat-maven/tomcat-jni.json b/modules/stuffed/tomcat-jni.json
similarity index 100%
rename from res/tomcat-maven/tomcat-jni.json
rename to modules/stuffed/tomcat-jni.json
diff --git a/res/tomcat-maven/tomcat-reflection.json b/modules/stuffed/tomcat-reflection.json
similarity index 100%
rename from res/tomcat-maven/tomcat-reflection.json
rename to modules/stuffed/tomcat-reflection.json
diff --git a/res/tomcat-maven/tomcat-resource.json b/modules/stuffed/tomcat-resource.json
similarity index 100%
rename from res/tomcat-maven/tomcat-resource.json
rename to modules/stuffed/tomcat-resource.json
diff --git a/res/tomcat-maven/tomcat.yaml b/modules/stuffed/tomcat.yaml
similarity index 97%
rename from res/tomcat-maven/tomcat.yaml
rename to modules/stuffed/tomcat.yaml
index d15a7f3..a85f4ad 100644
--- a/res/tomcat-maven/tomcat.yaml
+++ b/modules/stuffed/tomcat.yaml
@@ -33,7 +33,7 @@ spec:
spec:
containers:
- name: tomcat
- image: apache/tomcat-maven:1.0
+ image: apache/tomcat-stuffed:1.0
ports:
- containerPort: 8080
- containerPort: 8778
diff --git a/res/tomcat-maven/graal-webapp.ant.xml b/modules/stuffed/webapp-jspc.ant.xml
similarity index 91%
rename from res/tomcat-maven/graal-webapp.ant.xml
rename to modules/stuffed/webapp-jspc.ant.xml
index 8a0d502..07a5184 100644
--- a/res/tomcat-maven/graal-webapp.ant.xml
+++ b/modules/stuffed/webapp-jspc.ant.xml
@@ -15,13 +15,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project name="Webapp packaging for GraalVM" default="package" basedir=".">
+<project name="Webapp JSP precompilation and packaging for Maven shade plugin" default="package" basedir=".">
<property name="webapp.name" value="examples" />
<typedef name="jasper" classname="org.apache.jasper.JspC">
<classpath>
- <fileset file="${basedir}/target/tomcat-maven-1.0.jar" />
+ <fileset file="${basedir}/target/tomcat-stuffed-1.0.jar" />
<fileset dir="${basedir}/webapps/${webapp.name}/WEB-INF/lib" includes="*.jar" erroronmissingdir="false" />
</classpath>
</typedef>
@@ -47,4 +47,4 @@
</target>
-</project>
\ No newline at end of file
+</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org