decembrist-jar-plugin

Plugin for creating java and kotlin(kotlin2js) jar

License

License

GroupId

GroupId

org.decembrist
ArtifactId

ArtifactId

decembrist-jar-plugin
Last Version

Last Version

0.9.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

decembrist-jar-plugin
Plugin for creating java and kotlin(kotlin2js) jar
Project URL

Project URL

http://decembrist.org/
Source Code Management

Source Code Management

https://github.com/decembrist-revolt/decembrist-jar-plugin

Download decembrist-jar-plugin

How to add to project

<plugin>
    <groupId>org.decembrist</groupId>
    <artifactId>decembrist-jar-plugin</artifactId>
    <version>0.9.1</version>
</plugin>

Dependencies

compile (6)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.3.9
org.apache.maven : maven-project jar 2.2.1
org.apache.maven : maven-archiver jar 3.2.0
org.codehaus.plexus : plexus-archiver jar 3.5
org.jetbrains.kotlin : kotlin-stdlib jar 1.2.31
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.3

Project Modules

There are no modules declared in this project.

Decembrist Jar Plugin

Build Status
Flexible jar plugin for Maven

Plugin substitutes maven-jar-plugin to create jar for java, kotlin or kotlin2js You should specify target in configuration block

  • JVM
  • JS
<plugin>
    <groupId>org.decembrist</groupId>
    <artifactId>decembrist-jar-plugin</artifactId>
    <version>0.9.0</version>
    <extensions>true</extensions>
    <configuration>
        <target>JVM</target>
    </configuration>
</plugin>

You can ignore target propery and specify sources for packing manually with sourceConfigs

  • sourceConfigs - array of sources configs
  • directories - array of directories to include
  • includes - array of file patterns to include
  • excludes - array of files patterns to exclude

Patterns examples

  • **/*.class - for any .class files
  • **/** - for any files
  • **/*.js - for .js files
...
<configuration>
    <sourceConfigs>
        <config>
            <directories>
                <directory>${project.build.outputDirectory}</directory>
            </directories>
            <includes>
                <include>**/*.class</include>
            </includes>
            <excludes>
                <exclude>**/*.js</exclude>
            </excludes>
        </config>
    </sourceConfigs>
</configuration>
...

You can combine your sourceConfigs with target.

target for both JVM and JS presents hardcoded source configs:

  • JVM
<sourceConfigs>
    <config>
        <directories>
            <directory>${project.build.outputDirectory}</directory>
        </directories>
        <includes>
            <include>**/**</include>
        </includes>
        <excludes>
            <exclude>**/package.html</exclude>
        </excludes>
    </config>
</sourceConfigs>
  • JS
<sourceConfigs>
    <config>
        <directories>
            <directory>${project.build.directory}/js/${project.name}</directory>
        </directories>
        <includes>
            <include>**/*.kjsm</include>
        </includes>
        <excludes>
            <exclude>**/*.class</exclude>
            <exclude>**/*.js</exclude>
        </excludes>
    </config>
    <config>
        <directories>
            <directory>(${project.build.directory}/js/${project.name}).parentFile</directory>
        </directories>
        <includes>
            <include>**/*.js</include>
            <include>**/*.js.map</include>
        </includes>
        <excludes>
            <exclude>**/*.kjsm</exclude>
            <exclude>**/*.class</exclude>
        </excludes>
    </config>
    <config>
        <directories>
            <directory>${project.build.outputDirectory}</directory>
        </directories>
        <includes>
            <include>**/**</include>
        </includes>
        <excludes>
            <exclude>**/*.kjsm</exclude>
            <exclude>**/*.class</exclude>
        </excludes>
    </config>
</sourceConfigs>

One of <target> or <sourceConfigs> have to be specified

Other available options:

  • jsDefaultKjsmDirectory - directory where are .kjsm files placed. Used only for JS - target. Default:
    ${project.build.directory}/js/${project.name}
  • outputDirectory - directory containing the generated JAR Default:
    ${project.build.directory}

Versions

Version
0.9.1
0.9.0