Andrey Hihlovskiy

Professional blog on groovy, gradle, Java, Javascript and other stuff.

Tag Archives: jetty

Gretty version 0.0.11 is out!

Gretty is a feature-rich gradle plugin for running web-applications under jetty.

New in version 0.0.11: now it’s possible to specify logback configuration file (.groovy or .xml) via plugin extension property “logbackConfigFile”.

Full sources, documentation and examples: https://github.com/akhikhl/gretty

Gretty 0.0.11 is also available on maven central under group “org.akhikhl.gretty”.

Advertisements

Gretty version 0.0.9 is out! Long live gradle and jetty!

I released Gretty (gradle jetty) version 0.0.9!

New: support of JEE annotations.

https://github.com/akhikhl/gretty

Also in maven central!

Gretty 0.0.8 is out!

I released Gretty version 0.0.8!

New: support of “jetty.xml” and “jetty-env.xml”.

Gretty is gradle plugin for running web-applications under jetty 7, 8 and 9 and servlet API 2.5, 3.0.1 and 3.1.0. It greatly simplifies and accelerates web-application development by providing:

  • hot-deployment
  • war-overlays
  • java debugger support
  • jetty security realms support
  • jetty.xml and jetty-env.xml support
  • slf4j/logback support

The complete sources and documentation are available at https://github.com/akhikhl/gretty

The compiled jars are in maven central under group 'org.akhikhl.gretty'

Gretty 0.0.7 is out!

Gretty 0.0.7 (gradle jetty plugin) is out! New: logback re-init on hot-deployment.

https://github.com/akhikhl/gretty

Gretty 0.0.6 is out!

gretty 0.0.6 (gradle plugin) is out!
News: support of jetty 7/8/9, servlet-api 2.5/3.0.1/3.1.0.
https://github.com/akhikhl/gretty
Merry Christmas! 🙂

Gretty Plugin 0.0.5 is out

Gretty Plugin 0.0.5 is out and soon will be in maven central.

Gretty Plugin home: https://github.com/akhikhl/gretty

Gretty Plugin is now on Maven Central

I published Gretty Plugin to maven central, coordinates: org.akhikhl.gretty:gretty-plugin:0.0.4.
Project home: https://github.com/akhikhl/gretty
scm: https://github.com/akhikhl/gretty.git, git@github.com:akhikhl/gretty.git

Gretty Plugin is actually gradle plugin for running web-applications under jetty 8.1.8 and servlet API 3.0.1.

groovy script for running jetty server

The following script starts jetty server and opens the folder, specified on command line, for http access (read-only):

#!/usr/bin/env groovy

@Grab('javax.servlet:javax.servlet-api:3.0.1')
@Grab(group='org.eclipse.jetty', module='jetty-webapp', version='8.1.8.v20121106')
@Grab(group='org.eclipse.jetty', module='jetty-server', version='8.1.8.v20121106', transitive=false)
@Grab(group='org.eclipse.jetty', module='jetty-servlet', version='8.1.8.v20121106', transitive=false)
@GrabExclude('org.eclipse.jetty.orbit:javax.servlet')

import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.*
import groovy.servlet.*

def publishedFolder = args ? args[0] : '.'

def server = new Server(8080)
def context = new ServletContextHandler(server, '/', ServletContextHandler.SESSIONS)
def webappContext = new org.eclipse.jetty.webapp.WebAppContext(publishedFolder, '/jetty')
context.setHandler(webappContext)
server.start()
println 'Jetty server started. Press Ctrl+C to stop.'

Usage:

  1. Save this script to file “jetty.groovy”
  2. Invoke on command-line:
    groovy jetty.groovy /path/to/some/folder"
  3. Enter address in web-browser:
    http://localhost:8080/jetty

Expected result: you see the content of the folder “/path/to/some/folder” in the web-browser.

Meet Gretty: advanced gradle plugin for running web-applications under Jetty and Tomcat

I created little gradle plugin for running web-applications under Jetty 8.1.8.

The main advantage for a programmer is that now it’s possible to use servlet-api 3.0 and higher (under standard gradle-jetty plugin it was not possible, because jetty was too old).

Full sources, documentation and examples here:

https://github.com/akhikhl/gretty

Update 24.02.2014:

Now gretty supports jetty 7, 8 and 9 and servlet API 2.5, 3.0.1 and 3.1.0, as well as it brings many new interesting features!

Update 07.10.2014

Now Gretty supports Tomcat 7 and 8, as well as SpringBoot, spring-reloaded and jacoco!