Andrey Hihlovskiy

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

Review of Gretty plugin at JAXenter

My open-source project Gretty got a review at JAXenter portal:

http://jaxenter.de/software/Gretty-173718

Is it only me or from now on the sun is shining brighter and birds are signing louder 🙂

Advertisements

Adding an optional internal artifactory repository to Gradle to speed up builds

Tomás Lin's Programming Brain Dump

For Asgard 2, we’re developing heavily with Spring Boot, Groovy and Gradle.

For our jenkins jobs, we found that our internal artifactory repository is much faster than Bintray’s jcenter. Due to the large number of dependencies in the project, a project that takes 30 minutes downloading and building with jcenter only takes 3 minutes using an internal artifactory.

Since our internal repository is only available to us within our network, we don’t really want to expose those credentials in the project we eventually want to open source.

In this post, I will show you how we add an optional internal artifactory repository to our open source builds.

View original post 176 more words

Killer feature in Gretty version 0.0.18 – multiple web-apps support

Let’s assume, you are developing web-applications with JVM-based languages and technologies and are looking for the solution of the following problem:

You have a bunch of web-apps, that must run all at the same time, because they call each other. You also want to debug multiple web-apps and even run integration tests – on the complete bunch.

Here is the solution to this problem: use Gretty. This is gradle plugin, capable of exactly this: running multiple web-apps, debugging, integration tests. Of course, it is open-source and available at jcenter and maven central.

Gretty can start arbitrary number of web-apps of various types: gradle projects, WAR-files in the file system and even WAR-files from maven dependencies.
Multiple web-apps feature works out-of-the-box in configureless mode, although it is fully configurable/customizable.

The central concept of Multiple web-apps feature is farm – a collection of web-apps, that should run together.

There are two ways to define and use farms:

  • Default farm is automatically created for you by Gretty. You may add artbitrary web-apps to it and then invoke farm-specific tasks: farmRun, farmRunDebug, etc. Note that farm-specific tasks are not using gretty tasks (jettyRun, jettyRunDebug, etc.), but they understand and use gretty configurations.
  • Named farms, which you create yourself in gradle script. You can add as many named farms as you want, and you can add web-apps to farms in arbitrary constellations. Each named farm provides a specific set of farm tasks. For example, if you define farm with name “XYZ”, there will be new tasks farmRunXYZ, farmRunDebugXYZ, etc. available.

You can start using multiple web-apps support right away, using the following scenario as a starting point:

Create three empty folders: ProjectA, ProjectB and ProjectC, so that folder tree looks like this:

ProjectA
|-- ProjectB
\-- ProjectC

Create file “ProjectA/settings.gradle”, insert code:

include 'ProjectA', 'ProjectB'

Explanation: we organize multi-project setup, so that multiple web-apps can be started/stopped by gretty-farm plugin.

Create file “ProjectA/build.gradle”, insert code:

buildscript {
  repositories {
    jcenter()
  }

  dependencies {
    classpath 'org.akhikhl.gretty:gretty-plugin:+'
  }
}

apply plugin: 'gretty-farm'

Create file “ProjectA/ProjectB/build.gradle”, insert code:

apply plugin: 'gretty'

Create file “ProjectA/ProjectC/build.gradle”, insert code:

apply plugin: 'gretty'

Done! Now you can run multiple web-apps by running the following command in ProjectA:

gradle farmRun

Expected output:

Jetty server 9.1.0.v20131115 started.
:ProjectB runs at the address http://localhost:8080/ProjectB
:ProjectC runs at the address http://localhost:8080/ProjectC
servicePort: 9900, statusPort: 9901
Press any key to stop the jetty server.

Of course, you’ll get 404 in the browser, because web-apps don’t contain any pages. But, as soon as you add pages or/and servlets to the web-apps, things will get real.

By default farm automatically adds all subprojects of the farm project, which are facilitated with gretty plugin, to web-apps list. You can also explicitly add web-apps to the given farm.

Gretty-farm plugin defines new, distinct set of tasks for running farms: farmRun, farmRunDebug, farmRunWar, farmRunWarDebug, etc.

How to install and use Gollum on vanilla Debian/Ubuntu/Mint machine

Suppose you have a vanilla Debian/Ubuntu/Mint machine and you want to use Gollum – wiki system, built on top of Git and used internally by Gihub wiki pages. Here are the necessary steps:

  1. Install required components from OS repositories:
      sudo apt-get install ruby ruby-dev libz-dev libicu-dev build-essential
      

  2. Install Gollum from gems repository:

      sudo gem install gollum
      

  3. Create test git repository and run Gollum on it:

      mkdir testwiki
      cd testwiki
      git init
      gollum
      

Check: you should see messages like this:

user@host:~/Projects/testwiki$gollum
[2014-05-19 18:58:02] INFO WEBrick 1.3.1
[2014-05-19 18:58:02] INFO ruby 1.9.3 (2012-04-20) [x86_64-linux]
== Sinatra/1.4.5 has taken the stage on 4567 for development with backup from WEBrick
[2014-05-19 18:58:02] INFO WEBrick::HTTPServer#start: pid=27319 port=4567

that means: Gollum is up and running on port 4567.

Now you can launch you favourite browser, enter addresss http://localhost:4567 and start editing wiki pages:

Gollum editing home page

Whenever you save a page, Gollum commits it to git repository. Optionally you can add a message to commit.

It is worth noting, that Gollum supports many important markup languages: AsciiDoc, Creole, Markdown, MediaWiki, Org-mode, Pod, RDoc, reStructuredText, Textile.

When wiki pages are ready to be presented to the world, you push them to github wiki pages. Instructions on pushing to a remote repository are found here.

Gretty version 0.0.16 is out!

I release Gretty (gradle plugin for jetty) version 0.0.16!

New:

  • redesigned tasks as two classes: GrettyStartTask and GrettyServiceTask.
  • moved documentation from README.md to wiki pages.
  • drawn beautiful state diagrams for all Gretty tasks.

Sources and documentation at https://github.com/akhikhl/gretty.

Also available on jcenter & maven central!

Wuff version 0.0.1 is out!

Today I release Wuff version 0.0.1!

Wuff is a gradle plugin for automating OSGi/Eclipse-RCP/Eclipse-IDE bundles and applications assembly. It is analog to Eclipse Tycho, but with all power and beauty of gradle.

Full sources and documentation are available here: https://github.com/akhikhl/wuff

Wuff is also available at jcenter and maven central.

Image

Gretty version 0.0.15 is out!

I release Gretty (gradle plugin for jetty) version 0.0.15!

New: fast-reload of webapp-resources, jdk8-compatibility.

Sources and documentation at https://github.com/akhikhl/gretty.

Also available on jcenter & maven central!
gretty_logo

Gretty 0.0.14 is out!

Hello there,

Gretty version 0.0.14 is out – on github, on maven central and jcenter!

What’s new: now Gretty supports jvmArgs parameter in plugin extension. See more information in what’s new section of the documentation.

Gretty is a feature-rich Gradle plugin, designed for running Web-Applications on Jetty. See more information in main features section of the documentation.

Many thanks to Justin Munn for contribution!

What is the cardinality of the Euclidean topology?

David Richeson: Division by Zero

I’m teaching topology this semester. The students are looking at different topologies on the real number line. For homework I asked them to think about which topologies are “the same” (if any) and which are “different,” and why they thought that was the case. We haven’t yet talked about continuous maps or homeomorphisms, so I told them that two topologies were the same if we could rename all of the points so that one topology turned into the other.

They came back with the answers I expected. For example, the trivial topology has only two open sets and all the others have infinitely many, so the trivial topology must be different from the rest. One-point sets are open in the discrete topology, but not in any of the others, so it must be different from the rest.

One student pointed out that the discrete topology is the power set of…

View original post 322 more words

Gretty version 0.0.13 is out!

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

New in version 0.0.13:

  • support of META-INF/web-fragment.xml and META-INF/resources
  • integration tests for most of the examples
  • integration of the build scripts with bintray and availability of the new version on jcenter

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

Gretty 0.0.13 artifacts are available both on maven central and on jcenter under the group “org.akhikhl.gretty”.