This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 04abbb17b6 refactor: replace juneau-my-jetty-microservice template
with juneau-microservice-jetty module
04abbb17b6 is described below
commit 04abbb17b6a0020169d9aee2d69c05e1c781a901
Author: James Bognar <[email protected]>
AuthorDate: Sun Jun 7 08:34:54 2026 -0400
refactor: replace juneau-my-jetty-microservice template with
juneau-microservice-jetty module
---
juneau-distrib/pom.xml | 11 --
.../juneau-microservice-jetty/logs/.gitignore | 2 +
.../logs/jetty-requests.log.123132810} | 0
.../juneau-microservice-jetty/pom.xml | 6 +
.../microservice/jetty/JettyMicroservice.java | 145 +++++++++++++++
.../src/main/resources/jetty.xml | 70 ++++----
.../src/main/resources/juneau.cfg} | 194 +++++++++------------
.../microservice/jetty/JettyMicroservice_Test.java | 115 ++++++++++++
.../juneau-my-jetty-microservice/.gitignore | 6 -
.../build-overlay/.classpath.2 | 25 ---
.../build-overlay/.project.2 | 23 ---
.../build-overlay/my-jetty-microservice.launch.2 | 11 --
.../build-overlay/pom.xml.2 | 128 --------------
.../my-jetty-microservice.launch | 17 --
.../juneau-my-jetty-microservice/pom.xml | 83 ---------
.../src/assembly/bin.xml | 75 --------
.../juneau/microservice/jetty/template/App.java | 74 --------
.../jetty/template/HelloWorldResource.java | 47 -----
.../microservice/jetty/template/RootResources.java | 60 -------
.../jetty/template/nls/Messages.properties | 19 --
.../microservice/jetty/template/package-info.java | 20 ---
.../src/main/resources/htdocs/about.txt | 14 --
juneau-microservice/pom.xml | 1 -
juneau-utest/test-run-history.tsv | 1 +
24 files changed, 390 insertions(+), 757 deletions(-)
diff --git a/juneau-distrib/pom.xml b/juneau-distrib/pom.xml
index 234620b75d..3f242eb86d 100644
--- a/juneau-distrib/pom.xml
+++ b/juneau-distrib/pom.xml
@@ -916,17 +916,6 @@
<destFileName>apache-juneau-examples-rest-springboot-${project.version}.zip</destFileName>
</artifactItem>
- <!--
juneau-my-jetty-microservice -->
- <artifactItem>
-
<outputDirectory>${project.build.directory}/bin/projects</outputDirectory>
-
<groupId>org.apache.juneau</groupId>
-
<artifactId>juneau-my-jetty-microservice</artifactId>
-
<classifier>bin</classifier>
-
<type>zip</type>
-
<version>${project.version}</version>
-
<destFileName>apache-juneau-my-jetty-microservice-${project.version}.zip</destFileName>
- </artifactItem>
-
<!--
juneau-my-springboot-microservice -->
<artifactItem>
<outputDirectory>${project.build.directory}/bin/projects</outputDirectory>
diff --git a/juneau-microservice/juneau-microservice-jetty/logs/.gitignore
b/juneau-microservice/juneau-microservice-jetty/logs/.gitignore
new file mode 100644
index 0000000000..a851297308
--- /dev/null
+++ b/juneau-microservice/juneau-microservice-jetty/logs/.gitignore
@@ -0,0 +1,2 @@
+/jetty-requests.log
+/jetty-requests.log.173450004
diff --git a/juneau-microservice/juneau-my-jetty-microservice/logs/empty.txt
b/juneau-microservice/juneau-microservice-jetty/logs/jetty-requests.log.123132810
similarity index 100%
rename from juneau-microservice/juneau-my-jetty-microservice/logs/empty.txt
rename to
juneau-microservice/juneau-microservice-jetty/logs/jetty-requests.log.123132810
diff --git a/juneau-microservice/juneau-microservice-jetty/pom.xml
b/juneau-microservice/juneau-microservice-jetty/pom.xml
index 53da5cdc3c..c3ba8f95ea 100644
--- a/juneau-microservice/juneau-microservice-jetty/pom.xml
+++ b/juneau-microservice/juneau-microservice-jetty/pom.xml
@@ -70,6 +70,12 @@
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git
a/juneau-microservice/juneau-microservice-jetty/src/main/java/org/apache/juneau/microservice/jetty/JettyMicroservice.java
b/juneau-microservice/juneau-microservice-jetty/src/main/java/org/apache/juneau/microservice/jetty/JettyMicroservice.java
new file mode 100644
index 0000000000..6392786b05
--- /dev/null
+++
b/juneau-microservice/juneau-microservice-jetty/src/main/java/org/apache/juneau/microservice/jetty/JettyMicroservice.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.microservice.jetty;
+
+import jakarta.servlet.Servlet;
+
+import org.apache.juneau.commons.inject.BasicBeanStore;
+import org.apache.juneau.commons.inject.WritableBeanStore;
+import org.apache.juneau.microservice.Microservice;
+
+/**
+ * Zero-config convenience launcher for a Jetty-backed Juneau microservice.
+ *
+ * <p>
+ * Wraps the {@link Microservice} + {@link JettyConfiguration} bootstrap in a
single static call so
+ * a consumer can stand up a Jetty microservice with one Maven dependency and
one line of code:
+ *
+ * <p class='bjava'>
+ * <jc>// Boot Jetty + Juneau on the default port (10000) with the
interactive console enabled.</jc>
+ * <jk>public static void</jk> main(String[] args) <jk>throws</jk>
Exception {
+ * JettyMicroservice.<jsm>run</jsm>(args, <jk>new</jk>
RootResources());
+ * }
+ * </p>
+ *
+ * <p>
+ * Bundled defaults (all overridable):
+ * <ul>
+ * <li>Port <c>10000</c> (surfaced as <c>Jetty/port</c> in the bundled
<c>juneau.cfg</c>).
+ * <li>Interactive console enabled (use {@link #run(String[], Servlet,
boolean)} with
+ * {@code startConsole=false} to suppress).
+ * <li>Classpath defaults for <c>jetty.xml</c> and <c>juneau.cfg</c>
— a consumer-supplied
+ * copy on the working-directory or classpath wins via the existing
+ * {@link org.apache.juneau.microservice.Microservice} resolution
chain.
+ * </ul>
+ *
+ * <p>
+ * The supplied root servlet is registered as a {@code @Bean Servlet} in an
external bean store and
+ * auto-mounted by {@link
org.apache.juneau.microservice.jetty.JettyServerComponent JettyServerComponent}
+ * at the path declared by its {@link org.apache.juneau.rest.annotation.Rest
@Rest} annotation. Consumers
+ * who want full control over the bean store / configuration classes /
listener wiring should call
+ * {@link Microservice#create()} directly — this facade is a thin
convenience over that builder.
+ *
+ * @since 10.0.0
+ */
+public final class JettyMicroservice {
+
+ private JettyMicroservice() {}
+
+ /**
+ * Boots a Jetty microservice with the supplied root servlet and the
bundled defaults,
+ * with the interactive console enabled.
+ *
+ * <p>
+ * Equivalent to calling {@link #run(String[], Servlet, boolean)
run(args, rootServlet, true)}.
+ *
+ * @param args The {@code main(String[])} arguments. Forwarded
to {@link Microservice.Builder#args(String...)}.
+ * @param rootServlet The root REST servlet (typically annotated with
+ * {@link org.apache.juneau.rest.annotation.Rest
@Rest}).
+ * @return The started {@link Microservice} instance. Callers
typically chain {@link Microservice#join()}.
+ * @throws Exception Error occurred during bootstrap.
+ */
+ @SuppressWarnings({
+ "java:S112" // throws Exception intentional - mirrors
Microservice.start() lifecycle contract.
+ })
+ public static Microservice run(String[] args, Servlet rootServlet)
throws Exception {
+ return run(args, rootServlet, true);
+ }
+
+ /**
+ * Boots a Jetty microservice with the supplied root servlet and the
bundled defaults.
+ *
+ * <p>
+ * Constructs the {@link Microservice}, registers the supplied servlet
as a {@code @Bean Servlet} so
+ * {@link org.apache.juneau.microservice.jetty.JettyServerComponent
JettyServerComponent} auto-mounts
+ * it, applies {@link JettyConfiguration} so Jetty itself is wired, and
starts the lifecycle. The
+ * returned microservice has not yet been {@link Microservice#join()
joined}; callers wanting the
+ * standard "start and block forever" loop should chain {@code .join()}.
+ *
+ * @param args The {@code main(String[])} arguments.
Forwarded to {@link Microservice.Builder#args(String...)}.
+ * @param rootServlet The root REST servlet (typically annotated with
+ * {@link org.apache.juneau.rest.annotation.Rest
@Rest}).
+ * @param startConsole If <jk>true</jk>, also starts the interactive
console thread via
+ * {@link Microservice#startConsole()}.
+ * @return The started {@link Microservice} instance.
+ * @throws Exception Error occurred during bootstrap.
+ */
+ @SuppressWarnings({
+ "java:S112" // throws Exception intentional - mirrors
Microservice.start() lifecycle contract.
+ })
+ public static Microservice run(String[] args, Servlet rootServlet,
boolean startConsole) throws Exception {
+ var beanStore = new BasicBeanStore();
+ beanStore.addBean(Servlet.class, rootServlet);
+ return run(args, beanStore, startConsole,
JettyConfiguration.class);
+ }
+
+ /**
+ * Power-user form: boots a Jetty microservice with a caller-supplied
bean store and configuration
+ * class list.
+ *
+ * <p>
+ * Equivalent to writing the {@link Microservice} builder chain by
hand, but with the boilerplate
+ * collapsed. Use this when the simpler {@link #run(String[],
Servlet)} overloads are too
+ * restrictive — e.g. multiple {@code @Bean Servlet}
contributions, custom
+ * {@code MicroserviceListener}s, or a parent bean store.
+ *
+ * @param args The {@code main(String[])} arguments.
Forwarded to {@link Microservice.Builder#args(String...)}.
+ * @param beanStore The bean store to use for dependency
injection. Pre-populated bean entries
+ * ({@code @Bean Servlet}, {@code
MicroserviceListener}, etc.) are picked up by
+ * {@link JettyConfiguration} and the
microservice runtime.
+ * @param startConsole If <jk>true</jk>, also starts the interactive
console thread.
+ * @param configurations The {@code @Configuration}-annotated classes
to register. Always includes
+ * {@link JettyConfiguration}; pass an empty
list to use only that.
+ * @return The started {@link Microservice} instance.
+ * @throws Exception Error occurred during bootstrap.
+ */
+ @SuppressWarnings({
+ "java:S112" // throws Exception intentional - mirrors
Microservice.start() lifecycle contract.
+ })
+ public static Microservice run(String[] args, WritableBeanStore
beanStore, boolean startConsole, Class<?>... configurations) throws Exception {
+ var ms = Microservice
+ .create()
+ .args(args)
+ .beanStore(beanStore)
+ .configurations(configurations)
+ .build()
+ .start();
+ if (startConsole)
+ ms.startConsole();
+ return ms;
+ }
+}
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/src/main/resources/jetty.xml
b/juneau-microservice/juneau-microservice-jetty/src/main/resources/jetty.xml
similarity index 55%
rename from
juneau-microservice/juneau-my-jetty-microservice/src/main/resources/jetty.xml
rename to
juneau-microservice/juneau-microservice-jetty/src/main/resources/jetty.xml
index 7c16d52249..efa4ca51df 100644
---
a/juneau-microservice/juneau-my-jetty-microservice/src/main/resources/jetty.xml
+++ b/juneau-microservice/juneau-microservice-jetty/src/main/resources/jetty.xml
@@ -17,63 +17,68 @@
limitations under the License.
-->
-<Configure id="ExampleServer" class="org.eclipse.jetty.server.Server">
+<!--
+ Default jetty.xml shipped by juneau-microservice-jetty.
+
+ - Plain HTTP localhost dev default; one ServerConnector on
$S{availablePort,10000} (the value resolves
+ from the [Jetty] section of the bundled juneau.cfg, which defaults to
10000).
+ - No resourceBase / ResourceHandler / WebAppContext filesystem mount: no
static-file serving by
+ default (TODO-126 SAFE classification). Servlets are auto-mounted from
@Bean Servlet
+ contributions; consumers who need static content register their own
handler via a user-supplied
+ jetty.xml on the working directory or classpath.
+ - All defaults are overridable: a consumer-supplied jetty.xml on the working
directory or earlier on
+ the classpath wins, as does a @Bean JettyServerFactory in the consumer's
@Configuration.
+-->
+<Configure id="JuneauJettyServer" class="org.eclipse.jetty.server.Server">
<Set name="connectors">
<Array type="org.eclipse.jetty.server.Connector">
<Item>
<New
class="org.eclipse.jetty.server.ServerConnector">
<Arg>
- <Ref refid="ExampleServer" />
+ <Ref refid="JuneauJettyServer"
/>
</Arg>
- <Set
name="port">$S{availablePort,8080}</Set>
+ <Set
name="port">$S{availablePort,10000}</Set>
</New>
</Item>
</Array>
</Set>
- <!-- Juneau adds its servlets in this ServletContextHandler -->
- <New id="context"
class="org.eclipse.jetty.ee11.servlet.ServletContextHandler">
- <Set name="contextPath">/</Set>
- <!-- Optionally specify your servlets here -->
- <!--Call name="addServlet">
- <Arg>org.apache.juneau.microservice.jetty.template.RootResources</Arg>
- <Arg>/*</Arg>
- </Call-->
- <Set name="sessionHandler">
- <New class="org.eclipse.jetty.ee11.servlet.SessionHandler" />
- </Set>
- </New>
+ <!-- Juneau adds its servlets in this ServletContextHandler -->
+ <New id="context"
class="org.eclipse.jetty.ee11.servlet.ServletContextHandler">
+ <Set name="contextPath">/</Set>
+ <Set name="sessionHandler">
+ <New
class="org.eclipse.jetty.ee11.servlet.SessionHandler" />
+ </Set>
+ </New>
- <!-- Save ServletContextHandler for Juneau -->
- <Call name="setAttribute">
- <Arg>ServletContextHandler</Arg>
- <Arg><Ref refid="context" /></Arg>
- </Call>
+ <!-- Save ServletContextHandler for Juneau -->
+ <Call name="setAttribute">
+ <Arg>ServletContextHandler</Arg>
+ <Arg><Ref refid="context" /></Arg>
+ </Call>
<Set name="handler">
- <New id="collection"
class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
- <Arg>
+ <New id="collection"
class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
+ <Arg>
<Array
type="org.eclipse.jetty.server.handler.ContextHandler">
- <Item>
- <New
class="org.eclipse.jetty.server.handler.ContextHandler">
- <!-- This is setHandler(Supplier) -->
- <Set name="handler"><Ref refid="context" /></Set>
- </New>
- </Item>
<Item>
<New
class="org.eclipse.jetty.server.handler.ContextHandler">
- <New
class="org.eclipse.jetty.server.handler.DefaultHandler" />
- </New>
+ <Set
name="handler"><Ref refid="context" /></Set>
+ </New>
+ </Item>
+ <Item>
+ <New
class="org.eclipse.jetty.server.handler.ContextHandler">
+ <New
class="org.eclipse.jetty.server.handler.DefaultHandler" />
+ </New>
</Item>
- </Array>
+ </Array>
</Arg>
</New>
</Set>
<Set name="requestLog">
<New id="RequestLogImpl"
class="org.eclipse.jetty.server.CustomRequestLog">
- <!-- Param 0: org.eclipse.jetty.server.RequestLogWriter
-->
<Arg>
<New
class="org.eclipse.jetty.server.RequestLogWriter">
<Set name="append">false</Set>
@@ -83,7 +88,6 @@
<Set name="timeZone">GMT</Set>
</New>
</Arg>
- <!-- Param 1: String -->
<Arg>
<Get
class="org.eclipse.jetty.server.CustomRequestLog" name="EXTENDED_NCSA_FORMAT" />
</Arg>
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/my-jetty-microservice.cfg
b/juneau-microservice/juneau-microservice-jetty/src/main/resources/juneau.cfg
old mode 100755
new mode 100644
similarity index 55%
rename from
juneau-microservice/juneau-my-jetty-microservice/my-jetty-microservice.cfg
rename to
juneau-microservice/juneau-microservice-jetty/src/main/resources/juneau.cfg
index 020cc323ca..06eebe9e24
--- a/juneau-microservice/juneau-my-jetty-microservice/my-jetty-microservice.cfg
+++
b/juneau-microservice/juneau-microservice-jetty/src/main/resources/juneau.cfg
@@ -1,110 +1,84 @@
-#
***************************************************************************************************************************
-# * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file *
-# * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file *
-# * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance *
-# * with the License. You may obtain a copy of the License at
*
-# *
*
-# * http://www.apache.org/licenses/LICENSE-2.0
*
-# *
*
-# * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an *
-# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the *
-# * specific language governing permissions and limitations under the License.
*
-#
***************************************************************************************************************************
-
-#=======================================================================================================================
-# Basic configuration file for REST microservices
-# Subprojects can use this as a starting point.
-#=======================================================================================================================
-
-#=======================================================================================================================
-# Jetty settings
-#=======================================================================================================================
-[Jetty]
-
-# Path of the jetty.xml file used to configure the Jetty server.
-config = files/jetty.xml
-
-# Resolve Juneau variables in the jetty.xml file.
-resolveVars = true
-
-# Port to use for the jetty server.
-# You can specify multiple ports. The first available will be used. '0'
indicates to try a random port.
-# The resulting available port gets set as the system property "availablePort"
which can be referenced in the
-# jetty.xml file as "$S{availablePort}" (assuming resolveVars is enabled).
-port = 10000,0,0,0
-
-# Optionally specify your servlets here:
-#servlets = org.apache.juneau.microservice.jetty.template.RootResources
-
-#=======================================================================================================================
-# REST settings
-#=======================================================================================================================
-[REST]
-
-# Comma-delimited list of key-value pairs that represent locations of static
files that can be served up by your @Rest-annotated
-# classes. These are static files that are served up by the servlet under the
specified sub-paths.
-# For example, given the following setting...
-# staticFiles = htdocs:my-docs,styles/my-styles
-# ...the URI "/servletPath/htdocs/javadoc.css" resolves to the path
"/my-docs/javadoc.css".
-# This path can be relative to the working directory, classpath root, or
package of your resource class.
-# Used by the BasicRestConfig interface that defines the following value:
-# staticFiles="$C{REST/staticFiles}"
-staticFiles = htdocs:htdocs
-
-# Stylesheet to use for HTML views.
-# Used by the BasicRestConfig interface that defines the following value:
-# stylesheet="$C{REST/theme,servlet:/htdocs/themes/devops.css}"
-theme = servlet:/htdocs/themes/devops.css
-
-# Various look-and-feel settings used in the BasicRestConfig interface.
-headerIcon = servlet:/htdocs/images/juneau.png
-headerLink = http://juneau.apache.org
-footerIcon = servlet:/htdocs/images/asf.png
-footerLink = http://www.apache.org
-favicon = $C{REST/headerIcon}
-head = <link rel='icon' href='$U{$C{REST/favicon}}'/>
-header =
- <a href='$U{$C{REST/headerLink}}'>
- <img src='$U{$C{REST/headerIcon}}'
style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/>
- </a>
-footer =
- <a href='$U{$C{REST/footerLink}}'>
- <img src='$U{$C{REST/footerIcon}}'
style='float:right;padding-right:20px;height:32px'/>
- </a>
-
-#=======================================================================================================================
-# Console settings
-#=======================================================================================================================
-[Console]
-
-enabled = true
-
-# List of available console commands.
-# These are classes that implements ConsoleCommand that allow you to submit
commands to the microservice via
-# the console.
-# When listed here, the implementations must provide a no-arg constructor.
-# They can also be provided dynamically by overriding the
Microservice.createConsoleCommands() method.
-commands =
- org.apache.juneau.microservice.console.ExitCommand,
- org.apache.juneau.microservice.console.RestartCommand,
- org.apache.juneau.microservice.console.HelpCommand,
- org.apache.juneau.microservice.console.ConfigCommand
-
-#=======================================================================================================================
-# System properties
-#-----------------------------------------------------------------------------------------------------------------------
-# These are arbitrary system properties that are set during startup.
-#=======================================================================================================================
-[SystemProperties]
-
-# Configure Jetty for StdErrLog Logging
-# org.eclipse.jetty.util.log.class = org.eclipse.jetty.util.log.StrErrLog
-
-# Configure Jetty to log using java-util logging
-org.eclipse.jetty.util.log.class =
org.apache.juneau.microservice.jetty.template.JettyLogger
-
-# Jetty logging level
-# Possible values: ALL, DEBUG, INFO, WARN, OFF
-org.eclipse.jetty.LEVEL = WARN
-
-derby.stream.error.file = $C{Logging/logDir}/derby-errors.log
+#
***************************************************************************************************************************
+# * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file *
+# * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file *
+# * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance *
+# * with the License. You may obtain a copy of the License at
*
+# *
*
+# * http://www.apache.org/licenses/LICENSE-2.0
*
+# *
*
+# * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an *
+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the *
+# * specific language governing permissions and limitations under the License.
*
+#
***************************************************************************************************************************
+
+#=======================================================================================================================
+# Default configuration shipped by juneau-microservice-jetty.
+#
+# Loaded from the classpath by Microservice's config resolver when no
working-directory or earlier-classpath
+# *.cfg is found. Consumers can override any section by dropping their own
juneau.cfg (or another candidate
+# config name) on the working directory or earlier on the classpath.
+#=======================================================================================================================
+
+#=======================================================================================================================
+# Jetty settings
+#=======================================================================================================================
+[Jetty]
+
+# Path of the jetty.xml file used to configure the Jetty server.
+# JettyServerComponent searches the working directory first, then the
classpath, so the bundled jetty.xml
+# wins as the default but a consumer-supplied jetty.xml in the working dir
overrides it.
+config = jetty.xml
+
+# Resolve Juneau variables in the jetty.xml file.
+resolveVars = true
+
+# Port to use for the Jetty server.
+# Multiple ports may be specified; the first available wins. '0' indicates a
random port.
+# The resolved port gets set as the system property "availablePort",
referenced in jetty.xml as "$S{availablePort}".
+port = 10000,0,0,0
+
+#=======================================================================================================================
+# REST settings
+#=======================================================================================================================
+[REST]
+
+# Stylesheet to use for HTML views.
+# Used by BasicRestConfig:
+# stylesheet="$C{REST/theme,servlet:/htdocs/themes/devops.css}"
+theme = servlet:/htdocs/themes/devops.css
+
+#=======================================================================================================================
+# Console settings
+#=======================================================================================================================
+[Console]
+
+enabled = true
+
+# Built-in console commands (exit, restart, help, config). Implementations
require a no-arg constructor.
+# Override Microservice.createConsoleCommands() to contribute commands
programmatically.
+commands =
+ org.apache.juneau.microservice.console.ExitCommand,
+ org.apache.juneau.microservice.console.RestartCommand,
+ org.apache.juneau.microservice.console.HelpCommand,
+ org.apache.juneau.microservice.console.ConfigCommand
+
+#=======================================================================================================================
+# Logging settings
+#=======================================================================================================================
+[Logging]
+
+# Directory used for log files; referenced from jetty.xml's request-log
filename.
+logDir = logs
+
+#=======================================================================================================================
+# System properties
+#-----------------------------------------------------------------------------------------------------------------------
+# Arbitrary system properties set during microservice startup.
+#=======================================================================================================================
+[SystemProperties]
+
+# Route Jetty's logging through java-util logging via the bundled JettyLogger
SLF4J adapter.
+org.eclipse.jetty.util.log.class =
org.apache.juneau.microservice.jetty.JettyLogger
+
+# Jetty log level. Allowed values: ALL, DEBUG, INFO, WARN, OFF
+org.eclipse.jetty.LEVEL = WARN
diff --git
a/juneau-microservice/juneau-microservice-jetty/src/test/java/org/apache/juneau/microservice/jetty/JettyMicroservice_Test.java
b/juneau-microservice/juneau-microservice-jetty/src/test/java/org/apache/juneau/microservice/jetty/JettyMicroservice_Test.java
new file mode 100644
index 0000000000..1cdb338f93
--- /dev/null
+++
b/juneau-microservice/juneau-microservice-jetty/src/test/java/org/apache/juneau/microservice/jetty/JettyMicroservice_Test.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.microservice.jetty;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.ServerSocket;
+import java.net.URI;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.stream.Collectors;
+
+import org.apache.juneau.microservice.Microservice;
+import org.apache.juneau.rest.annotation.Rest;
+import org.apache.juneau.rest.annotation.RestGet;
+import org.apache.juneau.rest.servlet.BasicRestServlet;
+import org.eclipse.jetty.server.ServerConnector;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Boot-and-shutdown smoke test for {@link JettyMicroservice}.
+ *
+ * <p>
+ * Verifies that the bundled defaults (classpath {@code jetty.xml} + {@code
juneau.cfg}) plus a
+ * single {@code @Bean Servlet} are sufficient to stand up a Jetty-backed
Juneau microservice and serve a
+ * 200 from a {@link Rest @Rest}-annotated resource. Asserts both the facade
entry-point and a clean
+ * shutdown via {@link Microservice#stop()}.
+ *
+ * <p>
+ * The test pre-grabs a free ephemeral port via {@code ServerSocket(0)} and
publishes it as the
+ * {@code availablePort} system property before {@link JettyMicroservice#run}
is invoked. The bundled
+ * {@code jetty.xml} resolves {@code $S{availablePort,10000}} to that pre-set
value, so Jetty binds there
+ * deterministically — this avoids the bundled default port {@code
10000} colliding with whatever
+ * else is bound on the developer's machine.
+ *
+ * @since 10.0.0
+ */
+@SuppressWarnings({"serial"})
+class JettyMicroservice_Test {
+
+ @Rest(paths="/*")
+ public static class Root extends BasicRestServlet {
+ @RestGet(path="/hello")
+ public String hello() {
+ return "OK";
+ }
+ }
+
+ private static int reserveFreePort() throws Exception {
+ try (var ss = new ServerSocket(0)) {
+ return ss.getLocalPort();
+ }
+ }
+
+ @Test
+ void runStartsServerServesRequestAndStops() throws Exception {
+ // Pre-create the working-dir logs/ that the bundled
jetty.xml's CustomRequestLog writes to.
+ Files.createDirectories(Path.of("logs"));
+ // Pre-publish a free ephemeral port; JettyServerComponent's
@Value("${availablePort}") sentinel
+ // honors a pre-set value, and the bundled jetty.xml binds the
connector to $S{availablePort}.
+ var port = reserveFreePort();
+ System.setProperty("availablePort", String.valueOf(port));
+ var ms = JettyMicroservice.run(new String[0], new Root(),
false);
+ try {
+ var jsc =
ms.getBeanStore().getBean(JettyServerComponent.class).orElseThrow();
+ var localPort = -1;
+ for (var c : jsc.getServer().getConnectors()) {
+ if (c instanceof ServerConnector sc) {
+ localPort = sc.getLocalPort();
+ break;
+ }
+ }
+ assertEquals(port, localPort, "Jetty bound port did not
match pre-reserved availablePort");
+
+ var url = URI.create("http://localhost:" + localPort +
"/hello").toURL();
+ var conn = (HttpURLConnection)url.openConnection();
+ conn.setRequestMethod("GET");
+ conn.setRequestProperty("Accept", "text/plain");
+ conn.setConnectTimeout(5000);
+ conn.setReadTimeout(5000);
+ try {
+ assertEquals(200, conn.getResponseCode());
+ try (var r = new BufferedReader(new
InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
+ var body =
r.lines().collect(Collectors.joining());
+ assertTrue(body.contains("OK"),
"Expected body to contain 'OK' but got: " + body);
+ }
+ } finally {
+ conn.disconnect();
+ }
+ } finally {
+ ms.stop();
+ ms.stopConsole();
+ System.clearProperty("availablePort");
+ System.clearProperty("juneau.serverPort");
+ }
+ }
+}
diff --git a/juneau-microservice/juneau-my-jetty-microservice/.gitignore
b/juneau-microservice/juneau-my-jetty-microservice/.gitignore
deleted file mode 100644
index 34acf885cb..0000000000
--- a/juneau-microservice/juneau-my-jetty-microservice/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-/target/
-**/.DS_Store
-.classpath
-.project
-/.settings/
-/bin/
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/build-overlay/.classpath.2
b/juneau-microservice/juneau-my-jetty-microservice/build-overlay/.classpath.2
deleted file mode 100755
index 4975bcf746..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/build-overlay/.classpath.2
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/classes"
path="src/main/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con"
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/build-overlay/.project.2
b/juneau-microservice/juneau-my-jetty-microservice/build-overlay/.project.2
deleted file mode 100755
index 5490c5bf64..0000000000
--- a/juneau-microservice/juneau-my-jetty-microservice/build-overlay/.project.2
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>my-jetty-microservice</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/build-overlay/my-jetty-microservice.launch.2
b/juneau-microservice/juneau-my-jetty-microservice/build-overlay/my-jetty-microservice.launch.2
deleted file mode 100644
index 0746b3352e..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/build-overlay/my-jetty-microservice.launch.2
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN"
value="true"/>
-<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"
value="true"/>
-<booleanAttribute
key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"
value="org.eclipse.m2e.launchconfig.classpathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER"
value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.apache.juneau.microservice.jetty.template.App"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
value="my-jetty-microservice"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"
value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-</launchConfiguration>
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/build-overlay/pom.xml.2
b/juneau-microservice/juneau-my-jetty-microservice/build-overlay/pom.xml.2
deleted file mode 100644
index cab4693d17..0000000000
--- a/juneau-microservice/juneau-my-jetty-microservice/build-overlay/pom.xml.2
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance *
- * with the License. You may obtain a copy of the License at
*
- *
*
- * http://www.apache.org/licenses/LICENSE-2.0
*
- *
*
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the *
- * specific language governing permissions and limitations under the License.
*
-
***************************************************************************************************************************
--->
-<!--
- This project is meant to be used as a starting point for developers to
use in creating their own REST microservices.
- It creates a parent REST interface on port 10000 with a single child
hello-world resource.
- This POM is likewise meant to be used as a starting point for
developers. It creates an uber-jar
- to run the microservice from the command line.
-
- Copy the jar as well as the my-microservice.cfg file and start it with:
- java -jar my-jetty-microservice-1.0.jar
-
- The group/artifact/version information is meant to be overwritten by
developers to match their own needs.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>my-microservices</groupId>
- <artifactId>my-jetty-microservice</artifactId>
- <version>${version}</version>
- <name>Juneau REST start project using Jetty</name>
-
- <properties>
- <juneau.version>${version}</juneau.version>
-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-microservice-jetty</artifactId>
- <version>\${juneau.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>3.0.2</version>
- <executions>
- <execution>
- <id>package-config</id>
- <phase>package</phase>
- <goals>
-
<goal>copy-resources</goal>
- </goals>
- <configuration>
-
<outputDirectory>target</outputDirectory>
- <resources>
- <resource>
-
<directory>.</directory>
-
<includes>my-jetty-microservice.cfg</includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
-
<mainClass>org.apache.juneau.microservice.jetty.template.App
- </mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>3.0.0</version>
- <configuration>
-
<createDependencyReducedPom>false</createDependencyReducedPom>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <filters>
- <filter>
-
<artifact>*:*</artifact>
-
<excludes>
-
<exclude>META-INF/*.SF</exclude>
-
<exclude>META-INF/*.RSA</exclude>
-
<exclude>META-INF/*.INF</exclude> <!-- This one may not be required -->
-
</excludes>
- </filter>
- </filters>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/my-jetty-microservice.launch
b/juneau-microservice/juneau-my-jetty-microservice/my-jetty-microservice.launch
deleted file mode 100644
index b5848e732b..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/my-jetty-microservice.launch
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
- <listEntry
value="/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/App.java"/>
- </listAttribute>
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
- <listEntry value="1"/>
- </listAttribute>
- <booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN"
value="true"/>
- <booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"
value="true"/>
- <booleanAttribute
key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
- <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"
value="org.eclipse.m2e.launchconfig.classpathProvider"/>
- <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER"
value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
- <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.apache.juneau.microservice.jetty.template.App"/>
- <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
value="juneau-my-jetty-microservice"/>
- <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"
value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-</launchConfiguration>
diff --git a/juneau-microservice/juneau-my-jetty-microservice/pom.xml
b/juneau-microservice/juneau-my-jetty-microservice/pom.xml
deleted file mode 100644
index 48bf4645e5..0000000000
--- a/juneau-microservice/juneau-my-jetty-microservice/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!--
- This project is meant to be used as a starting point for developers to
use in creating their own REST microservices.
- It creates a parent REST interface on port 10000 with a single child
hello-world resource.
- This POM is likewise meant to be used as a starting point for
developers. It creates an uber-jar
- to run the microserice from the command line. Copy the jar as well as
the .cfg file and start it
- with java -jar juneau-microservice-template-1.0.0.jar microservice.cfg
- The group/artifact/version information is meant to be overwritten by
developers to match their own needs.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-microservice-parent</artifactId>
- <version>10.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>juneau-my-jetty-microservice</artifactId>
- <name>Apache Juneau My Jetty Microservice</name>
- <description>Apache Juneau Jetty Microservice Template</description>
-
- <properties>
- <juneau.version>10.0.0-SNAPSHOT</juneau.version>
-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-microservice-jetty</artifactId>
- <version>${juneau.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <source>17</source>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>juneau-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
-
<finalName>my-jetty-microservice-${project.version}</finalName>
- <descriptors>
-
<descriptor>src/assembly/bin.xml</descriptor>
- </descriptors>
-
<escapeString>\</escapeString>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/src/assembly/bin.xml
b/juneau-microservice/juneau-my-jetty-microservice/src/assembly/bin.xml
deleted file mode 100644
index ebb030ba34..0000000000
--- a/juneau-microservice/juneau-my-jetty-microservice/src/assembly/bin.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!--
- This assembly is used to create the template zip file that developers
use to import into Eclipse to start their
- own projects.
- -->
-<assembly
-
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3
https://maven.apache.org/xsd/assembly-1.1.3.xsd">
- <id>bin</id>
- <formats>
- <format>zip</format>
- </formats>
- <baseDirectory>/</baseDirectory>
- <includeBaseDirectory>true</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>${basedir}</directory>
- <includes>
- <include>src/main/**</include>
- <include>.settings/**</include>
- <include>*.cfg</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>${basedir}/build-overlay</directory>
- <outputDirectory>/</outputDirectory>
- <filtered>true</filtered>
- <excludes><exclude>**/*.2</exclude></excludes>
- </fileSet>
- </fileSets>
- <files>
- <file>
- <source>${basedir}/build-overlay/.classpath.2</source>
- <outputDirectory>/</outputDirectory>
- <filtered>true</filtered>
- <destName>.classpath</destName>
- </file>
- <file>
- <source>${basedir}/build-overlay/.project.2</source>
- <outputDirectory>/</outputDirectory>
- <filtered>true</filtered>
- <destName>.project</destName>
- </file>
- <file>
-
<source>${basedir}/build-overlay/my-jetty-microservice.launch.2</source>
- <outputDirectory>/</outputDirectory>
- <filtered>true</filtered>
- <destName>my-jetty-microservice.launch</destName>
- </file>
- <file>
- <source>${basedir}/build-overlay/pom.xml.2</source>
- <outputDirectory>/</outputDirectory>
- <filtered>true</filtered>
- <destName>pom.xml</destName>
- </file>
- </files>
-</assembly>
\ No newline at end of file
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/App.java
b/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/App.java
deleted file mode 100644
index ab3a899e00..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/App.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.microservice.jetty.template;
-
-import org.apache.juneau.commons.inject.*;
-import org.apache.juneau.microservice.*;
-import org.apache.juneau.microservice.jetty.*;
-
-import jakarta.servlet.*;
-
-/**
- * Entry-point for your microservice.
- *
- * <p>
- * The {@link Microservice} class will locate the
<code>my-microservice.cfg</code> file in the home directory and initialize
- * the resources and commands defined in that file.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='link'><a class="doclink"
href="https://juneau.apache.org/docs/topics/MyJettyMicroserviceBasics">My Jetty
Microservice Basics</a>
- * </ul>
- */
-public class App {
-
- /**
- * Entry point method.
- *
- * @param args Command line arguments.
- * @throws Exception Error occurred.
- */
- public static void main(String[] args) throws Exception {
- // @formatter:off
- Microservice
- .create()
- .args(args)
- .configurations(JettyConfiguration.class,
AppConfig.class)
- .build()
- .start()
- .startConsole()
- .join();
- // @formatter:on
- }
-
- /**
- * Application-specific configuration class contributing the top-level
REST servlet.
- */
- @Configuration
- public static class AppConfig {
-
- /**
- * Provides the top-level REST servlet, auto-mounted by {@link
JettyServerComponent} at
- * {@link org.apache.juneau.rest.annotation.Rest#path()}.
- *
- * @return The root servlet.
- */
- @Bean
- public Servlet rootResources() {
- return new RootResources();
- }
- }
-}
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/HelloWorldResource.java
b/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/HelloWorldResource.java
deleted file mode 100755
index 1a0fc4ddc1..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/HelloWorldResource.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.microservice.jetty.template;
-
-import org.apache.juneau.rest.annotation.*;
-import org.apache.juneau.rest.servlet.*;
-
-/**
- * Sample REST resource that prints out a simple "Hello world!" message.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='link'><a class="doclink"
href="https://juneau.apache.org/docs/topics/MyJettyMicroserviceBasics">My Jetty
Microservice Basics</a>
- * </ul>
- *
- * @serial exclude
- */
-@Rest(
- title="Hello World example",
- path="/helloworld",
- description="Simplest possible REST resource"
-)
-public class HelloWorldResource extends BasicRestServlet {
- private static final long serialVersionUID = 1L;
-
- /**
- * GET request handler.
- * @return The string "Hello world!"
- */
- @RestGet("/*")
- public String sayHello() {
- return "Hello world!";
- }
-}
\ No newline at end of file
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/RootResources.java
b/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/RootResources.java
deleted file mode 100755
index d1dbf7cd57..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/RootResources.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.microservice.jetty.template;
-
-import org.apache.juneau.html.annotation.*;
-import org.apache.juneau.microservice.jetty.resources.*;
-import org.apache.juneau.microservice.resources.*;
-import org.apache.juneau.rest.annotation.*;
-import org.apache.juneau.rest.servlet.*;
-import org.apache.juneau.rest.widget.*;
-
-/**
- * Root microservice page.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='link'><a class="doclink"
href="https://juneau.apache.org/docs/topics/MyJettyMicroserviceBasics">My Jetty
Microservice Basics</a>
- * </ul>
- *
- * @serial exclude
- */
-@Rest(
- path="/*",
- title="My Microservice",
- description="Top-level resources page",
- children={
- HelloWorldResource.class,
- ConfigResource.class,
- DebugResource.class
- }
-)
-@HtmlDocConfig(
- widgets={
- ContentTypeMenuItem.class,
- ThemeMenuItem.class
- },
- navlinks={
- "api: servlet:/api",
- "stats: servlet:/stats"
- }
-)
-@SuppressWarnings({
- "java:S110" // Inheritance depth acceptable for microservice hierarchy
-})
-public class RootResources extends BasicRestServletGroup {
- private static final long serialVersionUID = 1L;
-}
\ No newline at end of file
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/nls/Messages.properties
b/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/nls/Messages.properties
deleted file mode 100755
index d4a7d067e2..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/nls/Messages.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-#
***************************************************************************************************************************
-# * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
-# * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
-# * with the License. You may obtain a copy of the License at
-# *
-# * http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
-# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the
-# * specific language governing permissions and limitations under the License.
-# *
-#
***************************************************************************************************************************
-
-#--------------------------------------------------------------------------------
-# RootResources
-#--------------------------------------------------------------------------------
-RootResources.title = Juneau Microservice Template
-RootResources.description = Template for creating REST microservices
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/package-info.java
b/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/package-info.java
deleted file mode 100755
index 0b21e5c9fd..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/src/main/java/org/apache/juneau/microservice/jetty/template/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Microservice Samples
- */
-package org.apache.juneau.microservice.jetty.template;
diff --git
a/juneau-microservice/juneau-my-jetty-microservice/src/main/resources/htdocs/about.txt
b/juneau-microservice/juneau-my-jetty-microservice/src/main/resources/htdocs/about.txt
deleted file mode 100644
index 880c2aa250..0000000000
---
a/juneau-microservice/juneau-my-jetty-microservice/src/main/resources/htdocs/about.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-
***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance *
- * with the License. You may obtain a copy of the License at
*
- *
*
- * http://www.apache.org/licenses/LICENSE-2.0
*
- *
*
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the *
- * specific language governing permissions and limitations under the License.
*
-
***************************************************************************************************************************
-
-This directory can be used to hold static files served up under the
<servlet-path>/htdocs URI.
\ No newline at end of file
diff --git a/juneau-microservice/pom.xml b/juneau-microservice/pom.xml
index 31b428a247..35a2b993cc 100644
--- a/juneau-microservice/pom.xml
+++ b/juneau-microservice/pom.xml
@@ -34,7 +34,6 @@
<module>juneau-microservice</module>
<module>juneau-microservice-jetty</module>
<module>juneau-microservice-tomcat</module>
- <module>juneau-my-jetty-microservice</module>
<module>juneau-my-tomcat-microservice</module>
<module>juneau-my-springboot-microservice</module>
</modules>
diff --git a/juneau-utest/test-run-history.tsv
b/juneau-utest/test-run-history.tsv
index 705f441c21..4069a88ff4 100644
--- a/juneau-utest/test-run-history.tsv
+++ b/juneau-utest/test-run-history.tsv
@@ -70,3 +70,4 @@ timestamp git_sha branch tests_run failures
errors skipped surefire_sec wall_sec
2026-06-02T17:40:25Z 6af512998c4f master 126206 0 0 21
162
2026-06-02T23:01:10Z e5b375140cab master 126206 0 0 21
162
2026-06-06T12:42:52Z 4afccfee24c0 master 130520 0 0 26
198
+2026-06-07T12:33:51Z 057a440be6e9 master 130520 0 0 26
206