Decembrist Jar Plugin
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}
- skipNonExistingDirs - If true - don't process non-existing sources (it can throw exception) Default: true
- classifier - @see maven-jar-plugin
- archive - @see maven-jar-plugin
- forceCreation -@see maven-jar-plugin
- skipIfEmpty - @see maven-jar-plugin