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

improve way of fetching available plugin goals #895

Closed
Eskibear opened this issue Nov 1, 2022 · 0 comments · Fixed by #903
Closed

improve way of fetching available plugin goals #895

Eskibear opened this issue Nov 1, 2022 · 0 comments · Fixed by #903
Assignees
Labels
feature-request New feature or request performance
Milestone

Comments

@Eskibear
Copy link
Member

Eskibear commented Nov 1, 2022

current impl

Run mvn help:describe and parse output for available goals. It's slow because we need to launch a JVM and download its deps if necessary.

alternative

Read mojos directly from .jar file, it's located in META-INF/maven/plugin.xml. And we can download the single plugin.jar if missing, instead of downloading all its deps.

plugin.xml

<plugin>
  <name>Spring JavaFormat Maven Plugin</name>
  <description>Spring JavaFormat</description>
  <groupId>io.spring.javaformat</groupId>
  <artifactId>spring-javaformat-maven-plugin</artifactId>
  <version>0.0.31</version>
  <goalPrefix>spring-javaformat</goalPrefix>  //<------GOAL_PREFIX
  <isolatedRealm>false</isolatedRealm>
  <inheritedByDefault>true</inheritedByDefault>
  <mojos>
    <mojo>
      <goal>apply</goal> //<------GOAL
      <description>Applies source formatting to the codebase.</description>
      <requiresDirectInvocation>false</requiresDirectInvocation>
@Eskibear Eskibear added feature-request New feature or request performance labels Nov 1, 2022
@Eskibear Eskibear added this to the backlog milestone Nov 1, 2022
@Eskibear Eskibear self-assigned this Nov 7, 2022
Eskibear added a commit that referenced this issue Nov 14, 2022
Signed-off-by: Yan Zhang <yanzh@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant