• Logo
    Craft Parts
  • github.com/canonical/craft-parts
  • More resources
    • Forum
    • GitHub
Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Craft Parts documentation
Craft Parts documentation
  • Tutorials
    • Adding parts processing to an application
    • Hello craft-parts
  • How-to guides
    • Use parts
    • Customise the build with craftctl
    • Use craft-parts from the command-line
    • Override a part's default build behavior
    • Create a plugin
    • Document a plugin
    • Including local files and remote resources
    • Add a custom source type to an application
  • Reference
    • Actions
    • Exceptions
    • Project information
    • Lifecycle manager
    • Part properties
    • Parts and Steps
    • Plugins
      • .NET plugin
      • Ant plugin
      • Autotools plugin
      • CMake plugin
      • Dump plugin
      • Go plugin
      • Go Use plugin
      • Gradle plugin
      • JLink plugin
      • Make plugin
      • Maven plugin
      • Meson plugin
      • Nil plugin
      • NPM Plugin
      • Poetry plugin
      • Python plugin
      • Qmake plugin
      • Cargo Use plugin
      • Rust plugin
      • SCons plugin
      • uv plugin
    • Package reference
      • craft_parts package
        • craft_parts.executor package
          • craft_parts.executor.collisions module
          • craft_parts.executor.environment module
          • craft_parts.executor.executor module
          • craft_parts.executor.filesets module
          • craft_parts.executor.migration module
          • craft_parts.executor.organize module
          • craft_parts.executor.part_handler module
          • craft_parts.executor.step_handler module
        • craft_parts.overlays package
          • craft_parts.overlays.chroot module
          • craft_parts.overlays.errors module
          • craft_parts.overlays.layers module
          • craft_parts.overlays.overlay_fs module
          • craft_parts.overlays.overlay_manager module
          • craft_parts.overlays.overlays module
        • craft_parts.packages package
          • craft_parts.packages.apt_cache module
          • craft_parts.packages.base module
          • craft_parts.packages.deb module
          • craft_parts.packages.deb_package module
          • craft_parts.packages.dnf module
          • craft_parts.packages.errors module
          • craft_parts.packages.normalize module
          • craft_parts.packages.platform module
          • craft_parts.packages.snaps module
          • craft_parts.packages.yum module
        • craft_parts.plugins package
          • craft_parts.plugins.ant_plugin module
          • craft_parts.plugins.autotools_plugin module
          • craft_parts.plugins.base module
          • craft_parts.plugins.cargo_use_plugin module
          • craft_parts.plugins.cmake_plugin module
          • craft_parts.plugins.dotnet_plugin module
          • craft_parts.plugins.dump_plugin module
          • craft_parts.plugins.go_plugin module
          • craft_parts.plugins.go_use_plugin module
          • craft_parts.plugins.gradle_plugin module
          • craft_parts.plugins.java_plugin module
          • craft_parts.plugins.jlink_plugin module
          • craft_parts.plugins.make_plugin module
          • craft_parts.plugins.maven_plugin module
          • craft_parts.plugins.meson_plugin module
          • craft_parts.plugins.nil_plugin module
          • craft_parts.plugins.npm_plugin module
          • craft_parts.plugins.plugins module
          • craft_parts.plugins.poetry_plugin module
          • craft_parts.plugins.properties module
          • craft_parts.plugins.python_plugin module
          • craft_parts.plugins.qmake_plugin module
          • craft_parts.plugins.rust_plugin module
          • craft_parts.plugins.scons_plugin module
          • craft_parts.plugins.uv_plugin module
          • craft_parts.plugins.validator module
        • craft_parts.sources package
          • craft_parts.sources.base module
          • craft_parts.sources.cache module
          • craft_parts.sources.checksum module
          • craft_parts.sources.deb_source module
          • craft_parts.sources.errors module
          • craft_parts.sources.file_source module
          • craft_parts.sources.git_source module
          • craft_parts.sources.local_source module
          • craft_parts.sources.rpm_source module
          • craft_parts.sources.sevenzip_source module
          • craft_parts.sources.snap_source module
          • craft_parts.sources.sources module
          • craft_parts.sources.tar_source module
          • craft_parts.sources.zip_source module
        • craft_parts.state_manager package
          • craft_parts.state_manager.build_state module
          • craft_parts.state_manager.overlay_state module
          • craft_parts.state_manager.prime_state module
          • craft_parts.state_manager.pull_state module
          • craft_parts.state_manager.reports module
          • craft_parts.state_manager.stage_state module
          • craft_parts.state_manager.state_manager module
          • craft_parts.state_manager.states module
          • craft_parts.state_manager.step_state module
        • craft_parts.utils package
          • craft_parts.utils.deb_utils module
          • craft_parts.utils.file_utils module
          • craft_parts.utils.formatting_utils module
          • craft_parts.utils.git module
          • craft_parts.utils.os_utils module
          • craft_parts.utils.partition_utils module
          • craft_parts.utils.path_utils module
          • craft_parts.utils.process module
          • craft_parts.utils.url_utils module
        • craft_parts.actions module
        • craft_parts.callbacks module
        • craft_parts.constraints module
        • craft_parts.ctl module
        • craft_parts.dirs module
        • craft_parts.errors module
        • craft_parts.features module
        • craft_parts.infos module
        • craft_parts.lifecycle_manager module
        • craft_parts.main module
        • craft_parts.parts module
        • craft_parts.permissions module
        • craft_parts.pydantic_schema module
        • craft_parts.sequencer module
        • craft_parts.steps module
        • craft_parts.xattrs module
    • Changelog
  • Explanation
    • Parts
    • Lifecycle details
    • Implementation notes
    • Filesets
    • Overlay Step
    • Dump Plugin
    • Gradle Plugin
    • Cryptographic technology
Back to top
View this page

craft_parts.plugins.jlink_plugin module¶

The JLink plugin.

class craft_parts.plugins.jlink_plugin.JLinkPlugin(*, properties, part_info)[source]¶

Bases: Plugin

Create a Java Runtime using JLink.

Parameters:
  • properties (PluginProperties)

  • part_info (PartInfo)

get_build_commands()[source]¶

Return a list of commands to run during the build step.

Return type:

list[str]

get_build_environment()[source]¶

Return a dictionary with the environment to use in the build step.

Return type:

dict[str, str]

get_build_packages()[source]¶

Return a set of required packages to install in the build environment.

Return type:

set[str]

get_build_snaps()[source]¶

Return a set of required snaps to install in the build environment.

Return type:

set[str]

properties_class¶

alias of JLinkPluginProperties

validator_class¶

alias of JLinkPluginEnvironmentValidator

class craft_parts.plugins.jlink_plugin.JLinkPluginEnvironmentValidator(*, part_name, env, properties)[source]¶

Bases: PluginEnvironmentValidator

Check the execution environment for the JLink plugin.

Parameters:
  • part_name (str) – The part whose build environment is being validated.

  • env (str) – A string containing the build step environment setup.

  • properties (PluginProperties)

validate_environment(*, part_dependencies=None)[source]¶

Ensure the environment contains dependencies needed by the plugin.

Parameters:

part_dependencies (Optional[list[str]]) – A list of the parts this part depends on.

Raises:

PluginEnvironmentValidationError – If go is invalid and there are no parts named go.

Return type:

None

class craft_parts.plugins.jlink_plugin.JLinkPluginProperties(**data)[source]¶

Bases: PluginProperties

The part properties used by the JLink plugin.

Parameters:

data (Any)

jlink_jars: list[str]¶
model_config: ClassVar[ConfigDict] = {'alias_generator': <function PluginProperties.<lambda>>, 'extra': 'forbid', 'frozen': True, 'validate_assignment': True}¶

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

plugin: Literal['jlink']¶
Copyright © 2023-2025, Canonical Group Ltd
Last updated on May 08, 2025
Show source
Ask a question on Discourse
Open a GitHub issue for this page
Edit this page on GitHub
Contents
  • craft_parts.plugins.jlink_plugin module
    • JLinkPlugin
      • JLinkPlugin.get_build_commands()
      • JLinkPlugin.get_build_environment()
      • JLinkPlugin.get_build_packages()
      • JLinkPlugin.get_build_snaps()
      • JLinkPlugin.properties_class
      • JLinkPlugin.validator_class
    • JLinkPluginEnvironmentValidator
      • JLinkPluginEnvironmentValidator.validate_environment()
    • JLinkPluginProperties
      • JLinkPluginProperties.jlink_jars
      • JLinkPluginProperties.model_config
      • JLinkPluginProperties.plugin