This is a Gradle plugin for producing JAR files which are valid BlueJ project archives.
This plugin only works in Java projects, as BlueJ only supports Java and Stride. It also
only works in the main Source Set. Support for non-main Source Sets is planned.
For alternative build systems:
bluej-jar is available on the Gradle Plugin Portal.
Apply bluej-jar with:
plugins {
id "com.williambl.bluej_jar.bluej-jar" version "0.1"
}Note that BlueJ uses Java 11, so the bytecode compiled must be Java 11-compatible. This can be done with:
compileJava {
options.release = 11
}A BlueJ project archive has several differences to a 'normal' JAR file:
.javasources are included alongside built.classfiles (the.classfiles are not even technically required!)- all library
.jarfiles are included in a+libsfolder (BlueJ's dependency management consists only of this+libsfolder) - contents of libraries are included ('fat JAR') (it is unknown if this is required - it is likely not. However, this is how BlueJ exports JARs.)
This plugin also copies README.TXT and project.bluej files into the JAR, as BlueJ has special handling for these.
This plugin does not handle generation of project.bluej or *.ctxt files. BlueJ can import the project without them.
The plugin does not offer configuration at this time.
- Configuration (not include
.classfiles, not include certain libraries, etc.) - Research whether the JAR is required to be a 'fat JAR', and if not, add an option to disable this
- Research whether the libs must be copied to
+libsif the JAR is fat
- Research whether the libs must be copied to
- Possible
project.bluejgeneration, to allow classes to be placed nicely in BlueJ's graph view README.TXTgeneration from top-level readme files or frompackage-info.javajavadoc.- Task to open the resulting JAR in BlueJ, for testing.
- Task to change Source Set(s) used