-
Notifications
You must be signed in to change notification settings - Fork 3
Packaging and Distribution
Assemble the selected source modules for distribution:
ja assemble --module-version 1.2.3 build/artifactsThe destination must not already exist. Each module receives binary, source, and Javadoc JARs. Modules that use the standard JMOD layout also receive a JMOD, while --jmod requests one for every selected module:
ja assemble --jmod --module-version 1.2.3 build/artifactsArtifacts use their Java module names and form a flat directory. The version is recorded in each binary module descriptor. A META-INF/com.netflix.tools.ja/maven/deploy.pom resource is preserved in the assembled module and copied beside the matching main JAR as <module-name>.pom. When a module requires an automatic module, its binary JAR is also made automatic and records its name in Automatic-Module-Name; a JMOD is not created for that module.
Export the selected source modules as a Maven reactor for IDE import and other tools that understand the Maven project model:
ja maven exportThe command exports to the selected working directory, which must be a common ancestor of every selected source module. It updates the root pom.xml, writes module-info.pom beside each selected module descriptor, and configures .mvn/maven.config to make resolved dependencies available to Maven. The generated module-info.pom is an export intermediary and is not included when assembling the module.
Install the selected source modules in the configured local Maven repository:
ja maven install --module-version 1.2.3Deploy them to a selected release repository:
ja maven deploy \
--module-version 1.2.3 \
--repository releases=https://repository.example/releasesDeploy to a filesystem repository by passing its path:
ja maven deploy \
--module-version 1.2.3 \
--repository build/repositoryMaven repositories expose project information alongside a module so consumers can understand its purpose, ownership, licensing, and source. Provide this information in META-INF/com.netflix.tools.ja/maven/deploy.pom within each source module:
- Use Maven model version
4.0.0. - Give the project a name and description.
- Link to the project website.
- Identify its license.
- Identify its developers.
- Link to its source control repository.
Add --sign when the selected repository requires OpenPGP signatures.
Deploy a release to Maven Central with:
ja maven deploy-central --module-version 1.2.3Every selected module must provide a deployment POM with the project information required by Central. Store the Central user token under the central server in ~/.m2/settings.xml, or set both MAVEN_CENTRAL_USERNAME and MAVEN_CENTRAL_PASSWORD. Signing reads MAVEN_GPG_KEY, with optional MAVEN_GPG_KEY_FINGERPRINT and MAVEN_GPG_PASSPHRASE, from the environment. Add --manual to leave the validated deployment awaiting approval in the Central Portal.
Run the JDK's jlink tool directly to create a runtime image for the current source application. ja supplies the selected modules and their module path:
ja tool jlink --output /path/to/imageStandard jlink options are accepted. For example, include every observable module:
ja tool jlink \
--add-modules ALL-MODULE-PATH \
--output /path/to/imageInstall the current source module as a command:
ja installInstall a command from a released module by module name or Maven package URL:
ja install com.example.application
ja install com.example.application@1.2.3
ja install 'pkg:maven/com.example/example-application'
ja install 'pkg:maven/com.example/example-application@1.2.3'Without a version, the latest stable semantic version is selected across all major versions. If the repository has no semantic versions, the latest version reported by the repository is selected.
Installation creates a dedicated runtime containing the application and its dependencies, and makes its command available in the user executable directory. The final component of the module name is used as the command name by default:
ja install --name example com.example.application@1.2.3An existing installation of the same version is not overwritten. Use --force to replace it:
ja install --force com.example.application@1.2.3Use --output to create a standalone runtime image without installing a command:
ja install --output /path/to/image com.example.application@1.2.3Static requirements are omitted by default. Include them with --include-static:
ja install --include-static com.example.application@1.2.3An application containing automatic modules requires java.se in its runtime image, which can increase the installed size.