Skip to content

Generate toolchains.xml for Maven builds

Actions
Create and customize ~/.m2/toolchains.xml
v2.0.1
Latest
Star (1)

maven-toolchains-xml-action

build-test

Github Action to create Maven toolchains (~/.m2/toolchains.xml) based upon maven-settings-xml-action.

Inputs

toolchains

JSON array of toolchains to add to toolchains.xml.

The configuration supports convenience properties for adding a jdk toolchain entry; jdkVersion and jdkHome, but also supports creating an arbitrary <toolchain> entry.

Name Description Default
type Type of toolchain. jdk
jdkVersion Version of the JDK this toolchain represents. Will be inserted into the provides (if any) with the key version.
jdkHome Path to JDK location. Will be inserted into the configuration (if any) with the key jdkHome.
provides JSON object containing provides properties.
configuration JSON object containing anything else to add to the configuration.

Reference: https://maven.apache.org/maven-core/toolchains.html for the schema of the <toolchain> element that is reproduced here


Basic Usage

- id: setupJava
  uses: actions/setup-java@v2
  with:
    java-version: '8'
    distribution: 'temurin'
- uses: cactuslab/maven-toolchains-xml-action@v1
  with:
    toolchains: |
      [
        {"jdkVersion": "8", "jdkHome": "${{steps.setupJava.outputs.path}}"}
      ]

Local Setup

This repository uses pnpm instead of npm because it's so much faster.

Install Dependencies

pnpm install

Run Linter

pnpm lint

Run Unit-Tests

pnpm test

Build

pnpm build
pnpm watch

Create Distribution

pnpm package

Generate toolchains.xml for Maven builds is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Create and customize ~/.m2/toolchains.xml
v2.0.1
Latest

Generate toolchains.xml for Maven builds is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.