Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven Toolchains Support for JavaToolInstaller #16492

Open
Okeanos opened this issue Jun 25, 2022 · 6 comments
Open

Maven Toolchains Support for JavaToolInstaller #16492

Okeanos opened this issue Jun 25, 2022 · 6 comments
Labels
Area: ABTT Akvelon Build Tasks Team area of work enhancement Task: JavaToolInstaller

Comments

@Okeanos
Copy link

Okeanos commented Jun 25, 2022

Required Information

Question, Bug, or Feature?
Type: Feature

Enter Task Name: JavaToolInstaller

Environment

  • Server - Azure Pipelines
  • Agent - Hosted

Issue Description

The JavaToolInstaller can be used to install JDKs for consumption by tasks in pipelines. It already offers a number of features such as exporting the JDK_HOME environment variable so tools such as Maven and Gradle can pick the JDKs up more easily. This feature can be improved further by providing a Maven Toolchains Declaration.

This requires putting a toolchains.xml file with the proper definitions into the $HOME/.m2 location of the current user, i.e. the one running Maven.

This would allow using JavaToolInstaller with less overhead in projects that have Maven toolchain requirements configured and also allow Gradle to pick up JDK locations automatically starting with 7.4.

To generate a useful and valid toolchains declaration for a particular JDK the following information is necessary:

  • JDK version (major version only, e.g. 1.6, 8, 16, 17)
  • JDK location (/path/to/jdk)

Optionally, some additional useful information can be made available offering finer grained control over the toolchains declaration:

  • JDK vendor
  • some sort of stable unique ID to identify this particular toolchain

The toolchains.xml exists only once and can be extended to contain any number of known JDKs and allow detection/usage by Maven and Gradle. So multiple JavaToolInstaller (or matrix?) invocations should be chainable and generate a full toolchains declaration. Any other tooling just builds on top of this and makes using JavaToolInstaller easier. This is also the reason why this shouldn't be put into the Maven setup tasks instead – because lots of projects now just use the Maven Wrapper nowadays.

Related to this actions/setup-java#276.

@github-actions github-actions bot added Area: ABTT Akvelon Build Tasks Team area of work enhancement Task: JavaToolInstaller labels Jun 25, 2022
Okeanos added a commit to Okeanos/azure-pipelines-tasks that referenced this issue Jun 25, 2022
Add Maven Toolchains declaration generation based on the JDK input parameters
@github-actions
Copy link

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Dec 22, 2022
@Okeanos
Copy link
Author

Okeanos commented Dec 22, 2022

Yeah, I'd still like to see this. The GitHub Actions version works like a charm.

@github-actions github-actions bot removed the stale label Dec 22, 2022
@github-actions
Copy link

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Jun 20, 2023
@Okeanos
Copy link
Author

Okeanos commented Jun 21, 2023

Yeah, I'd still like to see this. The GitHub Actions version works like a charm.

@github-actions github-actions bot removed the stale label Jun 21, 2023
Copy link

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Dec 18, 2023
@Okeanos
Copy link
Author

Okeanos commented Dec 18, 2023

Yeah, I'd still like to see this. The GitHub Actions version works like a charm.

@github-actions github-actions bot removed the stale label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work enhancement Task: JavaToolInstaller
Projects
None yet
Development

No branches or pull requests

1 participant