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

Run Maven plugin extensions #2397

Merged
merged 3 commits into from
Apr 13, 2020

Conversation

chanseokoh
Copy link
Member

@chanseokoh chanseokoh commented Apr 9, 2020

Using the standard Service Provider Interfaces (SPI) mechanism to load and run Maven plugin extensions.

This doesn't yet involve the new extension config option (like <extensions><extension><implementation>com.example.ExtensionClass). The config option can be added in a later PR.

With this, we are actually enabling running and testing Maven extensions. A configuration will look like this.

<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>jib-maven-plugin</artifactId>
  <version>2.1.1-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>com.example</groupId>
      <artifactId>quarkus-extension-maven</artifactId>
      <version>0.1.0-SNAPSHOT</version>
    </dependency>
  </dependencies>
</plugin>

@@ -526,6 +533,37 @@ boolean jarRepackagedBySpringBoot() {
@Override
public JibContainerBuilder runPluginExtensions(JibContainerBuilder jibContainerBuilder)
throws JibPluginExtensionException {
return jibContainerBuilder;
return runPluginExtensions(
ServiceLoader.load(JibMavenPluginExtension.class).iterator(), jibContainerBuilder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need to create some sort of ordering mechanism so like some file manipulation extension can run after a framework extension has populated all the file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. In a follow-up PR, I'll add a new extension configuration option, as I proposed in the internal doc. I think I will be able to enforce ordering with it.

Copy link
Member

@loosebazooka loosebazooka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just minor log string thing

@chanseokoh chanseokoh merged commit 57e2ded into master Apr 13, 2020
@chanseokoh chanseokoh deleted the plugin-extension-java-src-run-extensions branch April 13, 2020 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants