https://github.com/valery1707/kaitai-maven-plugin
Maven plugin for Kaitai: declarative language to generate binary data parsers
https://github.com/valery1707/kaitai-maven-plugin
java kaitai kaitai-struct maven-plugin
Last synced: 5 months ago
JSON representation
Maven plugin for Kaitai: declarative language to generate binary data parsers
- Host: GitHub
- URL: https://github.com/valery1707/kaitai-maven-plugin
- Owner: valery1707
- License: mit
- Created: 2018-03-30T16:21:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-05T18:42:29.000Z (over 1 year ago)
- Last Synced: 2024-01-05T19:44:06.798Z (over 1 year ago)
- Topics: java, kaitai, kaitai-struct, maven-plugin
- Language: Java
- Homepage: https://kaitai.io/
- Size: 487 KB
- Stars: 12
- Watchers: 5
- Forks: 8
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://maven-badges.herokuapp.com/maven-central/name.valery1707.kaitai/kaitai-maven-plugin)
[](http://opensource.org/licenses/MIT)[](https://travis-ci.org/valery1707/kaitai-maven-plugin)
[](https://ci.appveyor.com/project/valery1707/kaitai-maven-plugin/branch/master)
[](https://circleci.com/gh/valery1707/kaitai-maven-plugin/tree/master)
[](https://github.com/valery1707/kaitai-maven-plugin/actions/workflows/check.yml)[](https://lgtm.com/projects/g/valery1707/kaitai-maven-plugin/alerts/)
[](https://lgtm.com/projects/g/valery1707/kaitai-maven-plugin/context:java)[](https://github.com/valery1707/kaitai-maven-plugin/)
[](https://github.com/valery1707/kaitai-maven-plugin/)
[](https://github.com/valery1707/kaitai-maven-plugin/)
[](https://github.com/valery1707/kaitai-maven-plugin/)
[](https://github.com/valery1707/kaitai-maven-plugin/)[](http://www.rultor.com/p/valery1707/kaitai-maven-plugin)
Maven plugin for [Kaitai](http://kaitai.io/): declarative language to generate binary data parsers.
This plugin has the following goals:
* `kaitai:generate`: generate java-sources for kaitai-templates## Usage flow
1. Add last version of [kaitai-maven-plugin](https://maven-badges.herokuapp.com/maven-central/name.valery1707.kaitai/kaitai-maven-plugin) into plugins section
1. Configure plugin execution with `generategenerate`
1. Add last version of [kaitai-struct-runtime](https://maven-badges.herokuapp.com/maven-central/io.kaitai/kaitai-struct-runtime) into compile dependencies
1. Add some [kaitai templates](http://formats.kaitai.io/) into `src/main/resources/kaitai`
1. *(Optionally)* Modify [plugin configuration](#plugin-parameters)
1. Build project with goal `package` or manually generate sources with goal `kaitai:generate`## Working examples
See [kaitai-java-demo](https://github.com/valery1707/kaitai-java-demo).
## Plugin parameters
| Name | Type | Since | Description |
|-----------------|--------------|-------|-------------------------------------------------------------------------------------------------------------------------|
| skip | boolean | 0.1.0 | Skip plugin execution (don't read/validate any files, don't generate any java types).
**Default**: `false` |
| url | java.net.URL | 0.1.0 | Direct link onto [KaiTai universal zip archive](http://kaitai.io/#download).
**Default**: Detected from version |
| version | String | 0.1.0 | Version of [KaiTai](http://kaitai.io/#download) library.
**Default**: `0.8` |
| cacheDir | java.io.File | 0.1.0 | Cache directory for download KaiTai library.
**Default**: `build/tmp/kaitai-cache` |
| sourceDirectory | java.io.File | 0.1.0 | Source directory with [Kaitai Struct language](http://formats.kaitai.io/) files.
**Default**: src/main/resources/kaitai |
| includes | String[] | 0.1.0 | Include wildcard pattern list.
**Default**: ["*.ksy"] |
| excludes | String[] | 0.1.0 | Exclude wildcard pattern list.
**Default**: [] |
| output | java.io.File | 0.1.0 | Target directory for generated Java source files.
**Default**: `build/generated/kaitai` |
| exactOutput | Boolean | 0.1.5 | Move root of packages directory structure exact inside configured output path and remove `src` item.
**Default**: `false`|
| packageName | String | 0.1.0 | Target package for generated Java source files.
**Default**: Trying to get project's group or `kaitai` otherwise |
| executionTimeout| Long | 0.1.3 | Timeout for execution operations.
**Default**: `5000` |
| fromFileClass | String | 0.1.3 | Classname with custom KaitaiStream implementations for static builder `fromFile(...)`|
| opaqueTypes | Boolean | 0.1.3 | Allow use opaque (external) types in ksy. See more in [documentation](http://doc.kaitai.io/user_guide.html#opaque-types).|
| noVersionCheck | Boolean | 0.1.6 | Allow to disable Java version check. For non-Windows only.
**Default**: `false` |
| noAutoRead | Boolean | 0.1.7 | Allow to disable auto-running `_read` in constructor
**Default**: `false` |### Useful commands
* Execute integration test: `./mvnw clean verify -P run-its`
* Execute checkstyle (report will be stored in `target/site/checkstyle.html`): `./mvnw checkstyle:checkstyle`