Git Product home page Git Product logo

wildfly-gradle-tools's Introduction

This repository contains two plugins: one to create a custom WildFly server by assembling various feature packs, and one to create such feature packs.

Gradle plugin for WildFly provisioning

org.wildfly.build.provision plugin. See also the plugin page on the Gradle Plugin Portal for details on how to apply the latest plugin version to your build.

Minimum working build.gradle :

plugins {
	id 'org.wildfly.build.provision' version '0.0.7'
}

provision {
    variables['wildfly.version'] = '11.0.0.Final'
}

Run with

gradle provision

You'll find a fully working copy of WildFly 11.0.0.Final in your build/provisioned-wildfly directory.

More powerful example build.gradle :

plugins {
   id 'org.wildfly.build.provision' version "0.0.7"
}

repositories {
	mavenLocal()
	mavenCentral()
	maven {
		name 'jboss-nexus'
		url "http://repository.jboss.org/nexus/content/groups/public/"
	}
}

provision {
	//Optional provisioning configuration:
	//configuration = "custom-server-provisioning.xml"

	//You can set variables to be injected in the provisioning.xml configuration;
	//The 'wildfly.version' variable is required by the default configuration:
	variables['wildfly.version'] = '11.0.0.Final'

	//The default is to add jboss-nexus automatically as you'll likely need it,
	//yet most builds will want to control such details explicitly.
	autoAddRepositories = false
	
	//Optional destination directory:
	//destinationDir = file("$buildDir/light-wildfly")
	//Overrides the version of an artifact:
	override( 'org.hibernate:hibernate-core' ) {
		version = '5.3.0.Beta1'
	}
	override( 'org.hibernate:hibernate-envers' ) {
		version = '5.3.0.Beta1'
	}
	//Overrides version, group, etc.. :
	override( 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api' ) {
		groupId = 'javax.persistence'
		artifactId = 'javax.persistence-api'
		version = '2.2'
	}
}

Description

The provision task will download and install a WildFly server to the target directory, while upgrading the two Hibernate ORM libraries and replacing the JPA 2.1 API with the standard JPA 2.2 API.

N.B. this example is not replacing all Hibernate ORM libraries so it wouldn't provide a reliable server! Doing such an upgrade properly shouldn't be done via version overrides but using an appropriate feature pack - using the more powerful 'configuration' property. The overrides capability is meant for developers experimenting with changes to the WildFly server.

Thin server

The created server will be of the "thin" kind: almost no jars and will take minimal space, but the necessary jars will be stored in your local maven repository.

Custom server

You can use a server-provisioning.xml to pick and choose only the feature packs you need; this way you can materialize a slim server which only has the features you need.

Currently there isn't a large collection of feature packs but this will improve soon.

An example server-provisioning.xml could be:

<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1">
   <feature-packs>
      <feature-pack groupId="org.wildfly" artifactId="wildfly-feature-pack" version="11.0.0.Final"/>
   </feature-packs>
</server-provisioning>

The above will materialize a "full" WildFly 11.0.0.Final in the target directory.

A more complex example:

<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1">
   <feature-packs>
      <feature-pack groupId="org.wildfly" artifactId="wildfly-servlet-feature-pack" version="11.0.0.Final"/>
      <feature-pack groupId="org.hibernate.lucene-jbossmodules" artifactId="lucene-jbossmodules" version="5.5.5.hibernate05"/>
   </feature-packs>
</server-provisioning>

The above example will materialize a smaller WildFly server (the "servlet" edition), but then include as well the Apache Lucene libraries appropriately packaged as modules.

Output directory

The default is to unpack a copy of the server in the "provisioned-wildfly" subdirectory of your build directory.

Set the destinationDir property to any other directory to change this.

If you choose a destinationDir which is not in your build directory you might want to explicitly add a clean task:

clean {
   delete file("/somehere/custom-wildfly")
}

Limitations

Provisioning is a powerful feature of the WildFly server which includes several other capabilities which have not yet been implemented in this plugin. Patches and help welcome!

Maven users

This plugin is actually a fairly limited port to Gradle of an existing, more powerful and more mature Maven plugin. Maven users should use the original plugin.

License

This software and its documentation are distributed under the Apache Software License 2.0. Refer to LICENSE.txt for more information.

wildfly-gradle-tools's People

Contributors

sanne avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.