avaje-jetty-runner


Лицензия

Лицензия

Категории

Категории

Jetty Контейнер Application Servers
Группа

Группа

org.avaje.jetty
Идентификатор

Идентификатор

avaje-jetty-runner
Последняя версия

Последняя версия

2.3.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

avaje-jetty-runner
avaje-jetty-runner
Ссылка на сайт

Ссылка на сайт

http://avaje.org
Система контроля версий

Система контроля версий

https://github.com/avaje-common/avaje-jetty-runner.git

Скачать avaje-jetty-runner

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.avaje.jetty/avaje-jetty-runner/ -->
<dependency>
    <groupId>org.avaje.jetty</groupId>
    <artifactId>avaje-jetty-runner</artifactId>
    <version>2.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.avaje.jetty/avaje-jetty-runner/
implementation 'org.avaje.jetty:avaje-jetty-runner:2.3.1'
// https://jarcasting.com/artifacts/org.avaje.jetty/avaje-jetty-runner/
implementation ("org.avaje.jetty:avaje-jetty-runner:2.3.1")
'org.avaje.jetty:avaje-jetty-runner:jar:2.3.1'
<dependency org="org.avaje.jetty" name="avaje-jetty-runner" rev="2.3.1">
  <artifact name="avaje-jetty-runner" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.avaje.jetty', module='avaje-jetty-runner', version='2.3.1')
)
libraryDependencies += "org.avaje.jetty" % "avaje-jetty-runner" % "2.3.1"
[org.avaje.jetty/avaje-jetty-runner "2.3.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.eclipse.jetty : jetty-webapp jar [9.3.11.v20160721]

provided (1)

Идентификатор библиотеки Тип Версия
org.eclipse.jetty.websocket : javax-websocket-server-impl jar [9.3.11.v20160721]

Модули Проекта

Данный проект не имеет модулей.

avaje-jetty-runner

  • avaje-jetty-runner : Maven Central : avaje-jetty-runner

Jetty webapp runner for a war file (aka runnable war) or expanded webapp (aka IDE development mode).

It is literally 3 classes (11k as a jar) and provides convenience for using Jetty to run standard war format webapps. Jetty comes with WebAppContext and this "Jetty runner" is fairly lightweight configuring an underlying jetty WebAppContext and server.

What it does

  • Configures the WebAppContext (port, context path, tmp directory, cookie handler etc)
  • Detects if WebSocket support is in the classpath and if so sets up WebSocket support
  • Sets up a shutdown hook
  • RunWar handles extract/expand war (by default not expanded)
  • RunWar handles runnable jar format (i.e. Spring boot loader war format)

Runnable wars with Spring boot loader

Spring boot loader provides both jar and war packaging with the associated class loader support. We can use this along with Jetty runner to create a runnable war.

  • Package a web application using Spring boot loader
  • Include appropriate Jetty dependencies (webapp + optional websocket support)
  • Use the Spring boot loader class loader
  • Jetty runner provides a main() method to configure and run a Jetty WebAppContext

Using JettyRun for development

JettyRun provides a run() method that launches Jetty. This by default expects an expanded webapp to located in the src/main/webapp directory.

The main benefit of using JettyRun to run the webapp via the IDE is that it will use the classpath from the IDE.

package example.main;

import org.avaje.jettyrunner.JettyRun;

/**
 * Run the webapp using Jetty. 
 * 
 * This uses the IDE classpath, debugger etc.
 */
public class RunJettyWebappInIDE {

  public static void main(String[] args) {
    
    
    JettyRun jettyRun = new JettyRun();
    jettyRun.setHttpPort(8090);                    // default to 8080
    jettyRun.setContextPath("/hello");             // defaults to "/"
    jettyRun.setResourceBase("src/main/webapp");   // defaults to "src/main/webapp"
    
    jettyRun.runServer();
  }
}
org.avaje.jetty

avaje

Версии библиотеки

Версия
2.3.1
2.2.1
2.1.2
2.1.1
1.2.2
1.2.1
1.1.0
1.0.1