Recent Posts
Recent Comments
Stefan on groovy XmlParser and XmlS… | |
akhikhl on Meet Gretty: advanced gradle p… | |
akhikhl on Meet Gretty: advanced gradle p… | |
nick on Meet Gretty: advanced gradle p… | |
SutoCom on AngularJS + JSTree = awes… |
Professional blog on groovy, gradle, Java, Javascript and other stuff.
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!
Hi Andrey – I’d like to try this out, but it doesn’t look like you’ve released a build to Maven yet?
Hi Michael,
Yes, please, feel free trying it. Please, have a look at the examples – they are easily compilable and show different aspects of gretty at work.
No, I’m not planning to port gretty to maven. Quite reverse – I move most of my projects from maven to gradle, in order to reduce development/maintenance costs. For example, I was able to get rid of Eclipse Tycho and replace it with far simpler build configuration, which works like a charm and does not require huge efforts to implement.
From technical point of view: there is so-called Jetty Maven Plugin, which already provides adequate functionality for maven projects ( http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html ). What I understood from their documentation, latest Jetty Maven Plugin also supports WAR overlays.
So, think of it as follows: gretty is the same, as Jetty Maven Plugin, but for gradle builds.
I wish you a nice day!
Hi Andrey – Sorry, I wasn’t clear, I meant that you haven’t released a version to the Maven Central Repository, so I can’t just add it as a buildscript.dependency to my Gradle config – instead I have to clone your Git repository, tweak it and push a release to a local Maven repository (ie Sonatype Nexus) to use it.
Ah, now I got it 🙂
Yes, I will push things to maven central.
As a temporary solution, please add the following to your gradle project:
and then you can test gretty.
Important: please make sure that this repository is added both to buildscript and to project. The reason for it is the following: gretty introduces compile-time extensions (gretty element in build.gradle), as well as runtime dependencies (so that jettyRun, jettyStop etc. can be started). Also it is worth mentioning that gretty does not modify the target project with jetty-specific compile-dependencies. Gretty adds only one new compile-dependency, this is providedCompile ‘javax.servlet:javax.servlet-api:3.0.1’.
Hi Michael,
If you still have interest in Gretty – it is now on maven central!
The sources and documentation here: https://github.com/akhikhl/gretty
Script for include or copy to gradle is here: https://raw2.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin
Wish you all the best!
i got this message:logback config file is not detected, gretty will configure logback,why?
Hi Bruce,
It’s not a bug, it’s a feature 🙂
This means the following: Gretty tried finding one of two files – “logback.xml” and “logback.groovy” – in the folders designated by project.sourceSets.main.output.files (typically these would be “build/classes/main” and “build/resources/main”) and did not find them.
The purpose of this message is the following: to notify a programmer, that, since logback configuration wasn’t found, Gretty will try to configure it itself.
The message does not affect functionality of Gretty or of your program – it is related to logging only.
Does your project contain “logback.xml” or “logback.groovy”? If so, then in which folder?
Hi Michael,
One area where the existing jetty plugin is weak is when doing code coverage with jacoco.
Do you know if gretty interoperates well with jacoco, and if so, maybe could you add an example showing this?
Thx
Hi,
I have no experience (yet) with jacoco, but I am curious in trying this.
If I integrate jacoco support in Gretty, can you contribute with the feedback/experience using it?
Greetings from Germany,
Nick, would you be so kind as to move discussion from here to gretty issue tracker?
https://github.com/akhikhl/gretty/issues
I find the topic of jococo and gretty integration being very interesting. I think I can implement it quickly.