craft_parts.plugins.maven_plugin module

The maven plugin.

class craft_parts.plugins.maven_plugin.MavenPlugin(*, properties, part_info)[source]

Bases: JavaPlugin

A plugin to build parts that use Maven.

The Maven build system is commonly used to build Java projects. This plugin requires a pom.xml in the root of the source tree.

This plugin uses the common plugin keywords as well as those for “sources”. For more information check the ‘plugins’ topic for the former and the ‘sources’ topic for the latter.

Additionally, this plugin uses the following plugin-specific keywords:

  • maven-parameters: (list of strings) Flags to pass to the build using the maven semantics for parameters.

Parameters:
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 MavenPluginProperties

validator_class

alias of MavenPluginEnvironmentValidator

class craft_parts.plugins.maven_plugin.MavenPluginEnvironmentValidator(*, part_name, env, properties)[source]

Bases: PluginEnvironmentValidator

Check the execution environment for the maven 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.maven_plugin.MavenPluginProperties(**data)[source]

Bases: PluginProperties, PluginModel

The part properties used by the maven plugin.

Parameters:

data (Any) –

maven_parameters: List[str]
source: str
classmethod unmarshal(data)[source]

Populate class attributes from the part specification.

Parameters:

data (Dict[str, Any]) – A dictionary containing part properties.

Return type:

MavenPluginProperties

Returns:

The populated plugin properties data object.

Raises:

pydantic.ValidationError – If validation fails.