Skip to content
Permalink
Browse files
adding few more doc on maven doc goal and cli mode
  • Loading branch information
rmannibucau committed Aug 3, 2016
1 parent db7931d commit fbfc42433bd35c86718af911bb1c7eeed05bd112
Showing 3 changed files with 65 additions and 0 deletions.
@@ -0,0 +1,42 @@
<!---
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
# CLI

BatchEE provides a CLI to make it easy to integrate with companies schedulers
and let JBatch batches run as any program.

## BatchEE CLI usage

BatchEE cli has several mode and can be used as a base dependency to build shades
or fatjars but strength of it is revealed when used as a product:

* you extract batchee-cli zip somewhere on your disk (`/opt/apache/batchee/cli` for instance)
* you extract your application somewhere else (`/opt/company/application/application.war` for instance)
* you run one of the batch of the war with `/opt/apache/batchee/cli/bin/batchee start -lifecycle openejb -archive /opt/company/application/application.war -name mybatch`

Tip: `batchee` script help can be accessed calling it without any argument. To get a detail help on a particular command just prefix its name byu `help`, for instance to
get help on `start` command launch `./bin/batchee help start`.

As you can see with last bullet, BatchEE CLI provides several options to start a batch. Here few interesting ones (you can get the full list/description calling `help` on it):

* `-lifecycle`: allows to start/stop a container and run the batch once it is launched. Previous sample was running it in OpenEJB (TomEE) allowing you to rely on CDI, EJB, JTA, JPA...
BatchEE also provides integration for Spring or custom lifecycles/containers.
* `-sharedLibs`: allows to add to the container/BatchEE classloader a set of jars (all the jars in the specified folder). Useful to be able to keep BatchEE, your container and your batches
separated on the disk to allow partial updates (updating BatchEE without updating OpenEJB or the application for instance).
* `-archive`: specify which application contain the batch to run, this can be a `war` or a `bar`. If you want to deploy a jar no need to specify this option, just ensure you added it in `-libs`.
@@ -32,4 +32,6 @@ If you want to learn about JBatch extensions please visit our [extensions](./ext

If you are more interested in a GUI solution, have a look to [gui](./gui.html) page.

If you want to learn to launch your batches through a CLI, have a look to [cli](./cli.html) page.

Finally if you want to control your batches from Maven just open the [maven plugin](./maven.html) page.
@@ -27,6 +27,27 @@ under the License.
</plugin>
]]></pre>

## Documentation generation parsing batch components

BatchEE provides a `doc` goal allowing to parse `BatchProperty` to generate your JBatch component documentation.

You can run it on a plain JBatch module but it is recommanded to add `doc-api` dependency to be able to use `@Documentation`
to describe what the property is used for:

<pre class="prettyprint linenums"><![CDATA[
<dependency>
<groupId>org.apache.batchee</groupId>
<artifactId>batchee-doc-api</artifactId>
<version>${batchee.version}</version>
</plugin>
]]></pre>

Then simply run:

<pre class="prettyprint"><![CDATA[
mvn batchee:doc
]]></pre>

## Configuration for a remote BatchEE instance (JAX-RS client)

<pre class="prettyprint linenums"><![CDATA[

0 comments on commit fbfc424

Please sign in to comment.