Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zaplatynski/fsm-packagetype

A basic approach to a Maven package type for FirstSpirit modules
https://github.com/zaplatynski/fsm-packagetype

assembly firstspirit firstspirit-modules fsm maven maven-plugin packaging

Last synced: 14 days ago
JSON representation

A basic approach to a Maven package type for FirstSpirit modules

Awesome Lists containing this project

README

        

# Maven Package Type For FSMs [![Build Status](https://travis-ci.org/zaplatynski/fsm-packagetype.svg?branch=master)](https://travis-ci.org/zaplatynski/fsm-packagetype) [![Coverage Status](https://coveralls.io/repos/github/zaplatynski/fsm-packagetype/badge.svg)](https://coveralls.io/github/zaplatynski/fsm-packagetype) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.zaplatynski/fsm-packagetype/badge.svg?style=flat)](http://mvnrepository.com/artifact/com.github.zaplatynski/fsm-packagetype)

This is a basic approach to create a Maven package type for FirstSpirit modules (FSM) with a
fully working Maven lifecycle inclung install and deploy. Additionally there is support to crate
the FSM deployment descriptor called module.xml. For information please consult the official
documentations.

## How to use

In your `pom.xml` add this:
```xml

my-group
my-fsm-artifact
1.2.3


fsm

...






com.github.zaplatynski
fsm-packagetype
2.3.0

true




maven-assembly-plugin
3.0.0

false
false

src/assembly/fsm.xml




make-assembly
prepare-package

single






...

```
To create the `module.xml` (FirstSpirit module deployment descriptor) you must provide a `module
.vm` ([Apache Velocity macro](http://velocity.apache.org/engine/devel/user-guide.html)) in the path `src/main/fsm` with content:
```
#defaultModuleXml($project)
```
The example (see [macros.vm](src/main/resources/macros.vm)) above will add the common tags for
name, version etc. (sub macro #addHeader) and collect module fragment xml if avaiable
(sub macro #addModuleXmlFragments). Besides those three macros the variable $project give access
to the whole
[Maven project](https://maven.apache.org/ref/3.2.3/apidocs/org/apache/maven/project/MavenProject.html).
In addition all user defined Maven properties are available too. Since Velocity can not deal with dots in variable names please name them accordingly.

### FirstSpirit Mode Isolated

To enable FirstSpirit upcoming mode insolated inside the module deployment descriptor simply add
this property to your pom.xml:

```xml

...

...
isolated
...

...

```
The default Velocity macros will recognized it and create the the following attribute inside resource
tags:
```xml

...

...

...

...

...

...

```

### Module Deployment Descriptor Fragment

To create an module fragment xml in any other jar Maven module just this to the `pom.xml`:
```xml

...

...

...

com.github.zaplatynski
fsm-packagetype
2.3.0



fragmentModuleXml




...


...

```
Again in the `src/main/fsm` there must be an in the path `module-fragment.vm` in which you can
define e.g. an FirstSpirit Executable or Service.

### FSM Layout

Inside the above mentioned `fsm.xml` you need to specify the [Maven assembly plugin](http://maven.apache.org/plugins/maven-assembly-plugin/) descriptor to create a typical FSM file layout:
```xml

fsm

zip

false


target/module.xml
META-INF
false


target/${project.artifactId}-${project.version}.jar
lib
false




lib
true
false

```
The FSM Maven package type will take care to rename the zip file to a FSM file. In the dependency set you specify yourself.

If you want to have a kind of real world example then have a look at my [Second-Hand Log project](https://github.com/zaplatynski/second-hand-log) or my [FSM Libray Creator project](https://github.com/zaplatynski/fsm-library-creator) here on GitHub.

## Build command

[Maven](http://maven.apache.org/) is used to compile and assemble this project:
```
mvn clean install
```

## Help, bugs and feature requests

Please file any **request for help**, **bug** or **feature request** at [github.com/zaplatynski/fsm-packagetype/issues](https://github.com/zaplatynski/fsm-packagetype/issues).

## Disclaimer

By using it you agree to the license stated in the file [LICENSE](LICENSE). FirstSpirit is a trade mark by the [e-Spirit AG](http://www.e-spirit.com/).