Maven Bathe plugin

Creates an artifact with the specified file extension (jar/war/etc) where the dependencies are unzipped inside at the specified offset.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.bluetrainsoftware.maven
ArtifactId

ArtifactId

bathe-plugin
Last Version

Last Version

2.7
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Maven Bathe plugin
Creates an artifact with the specified file extension (jar/war/etc) where the dependencies are unzipped inside at the specified offset.
Source Code Management

Source Code Management

http://github.com/rvowles/bathe-plugin

Download bathe-plugin

How to add to project

<plugin>
    <groupId>com.bluetrainsoftware.maven</groupId>
    <artifactId>bathe-plugin</artifactId>
    <version>2.7</version>
</plugin>

Dependencies

compile (5)

Group / Artifact Type Version
org.springframework.boot : spring-boot-loader-tools jar 1.5.6.RELEASE
com.bluetrainsoftware.composite : composite-maven-plugin jar [1,2)
org.codehaus.groovy : groovy-all jar 2.4.12
commons-io : commons-io jar 2.4
com.bluetrainsoftware.bathe : bathe-booter jar [2,3)

test (1)

Group / Artifact Type Version
com.bluetrainsoftware.composite : composite-unit-test jar [1,2)

Project Modules

There are no modules declared in this project.

The Bathe Plugin

'Cause you want a clean build.

Introduction

The Bathe Plugin is a Maven Plugin that is intended for use in the final artifact of your build change - the final jar or war, and is intended to be used to create a runnable artifact that does not need to unarchive itself onto disk anywhere, or use special resource loaders (only standard Java ones).

It is intended to be used with the Bathe Booter - https://github.com/rvowles/bathe-booter - to re-ify your classpath, run a set of services in a pre-determined order and then jump to your "main" class. The Bathe Runner is separate from this artifact as it is typically used throughout your application artifacts to enable your application to run (we use it in test mode for our artifacts).

The plugin efficiently creates a single jar of all the contents of the jar/zip files that are in the dependency tree. It offsets the dependencies with their artifact names and versions in the resulting zip file, this preserving unique names (unlike the Shade plugin which requires considerable tuning). When the jar is "run", the Bathe Runner creates classpaths with offsets into itself - the same as a web app does when referencing /WEB-INF/classes - you just also get /WEB-INF/jars/spring-core-3.23/…​ for example.

Using the Bathe Plugin

You can issue specific goal commands, and you can, by changing the packaging have it automatically create the correct packaged applications.

Configuration

The plugin, if it is to be used when packaging and deploying your application under the standard Maven lifecycle, requires your packaging to be either bathe-war or bathe-jar, the first creates an artifact ending in .war, the latter one ending in .jar. That is essentially the only difference.

pom.xml
<packaging>bathe-jar</packaging>

Dependencies

Typically you will be including the bathe-runner as a dependency at this level. You can have it include itself transitively or directly. It is recommended it is bought in via version range, it is also recommended that you create a composite of all of the bathe services that you will be using so you can easily include them as test dependencies in other artifacts. See the bathe-runner for more details on this.

Goals

The plugin has a number of goals, the default being bathe:time.

  • bathe:time - this builds your artifact

  • bathe:sponge - this runs your artifact with specified parameters, it creates a thread that monitors for shutdown. Used with integration testing.

  • bathe:rinse - this signals to your artifact to shut down by contacting the sponge thread and asking it to destroy the process. Used with integration testing. *

bathe:time

This will build your jar/war file. There are no mandatory parameters, but there are some you would typically configure:

  • jumpClass: this specifies the class that the Bathe Runner will jump to once it has completed configuration. It gets added to the manifest file. -

release notes

2.7

  • swapped by default to using the baseVersion so snapshots use the name SNAPSHOT and keep a consistent artifact name when packaged

  • added threadSafe support as there is no static state

  • swapped to using the nexus auto-release mechanism

Versions

Version
2.7
2.6
2.5
2.4
2.3
2.2
2.1
1.5
1.4
1.3
1.2
1.1