bee

bee.task

Jar

Handles the packaging of project artifacts (classes, sources, resources, documentation) into JAR files.

Provides options for creating standard JARs, source JARs, test JARs, documentation JARs, and executable "uber-jars" containing all dependencies.

Includes functionality to modify class files before packaging using the Java Class-File API (Java 24+). Modifications can include downgrading the class file version and removing debug or trace information based on the Config settings.

source()void

Packages the main compiled classes and resources into a standard JAR file. Also creates a separate JAR containing the main source files and resources. If configured, modifies class files (version downgrade, debug/trace info removal) before packaging. This is the default command for the jar task.

test()void

Packages the compiled test classes and resources into a test JAR file. Also creates a separate JAR containing the test source files and resources. Class file modification is typically not applied to test classes.

project()void

Packages the compiled project definition classes (e.g., the Project class itself) and resources into a project JAR file. Also creates a separate JAR containing the project source files and resources. Class file modification is typically not applied to project classes.

document()void

Packages the generated Javadoc documentation into a documentation JAR file.

merge()void

Creates a single executable JAR file (uber-jar or fat-jar) containing the main classes, resources, and all runtime dependencies unpacked and merged together. Automatically detects and sets the Main-Class and agent attributes in the JAR's manifest file.