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

Add (configurable) merging for user defined files for uber-jar creation #46129

Open
Dudeplayz opened this issue Feb 6, 2025 · 8 comments
Open
Labels
area/core kind/enhancement New feature or request

Comments

@Dudeplayz
Copy link

Description

I am using https://github.com/JavaMoney/jsr354-ri which defines multiple javamoney.properties. Before I used the maven-shade-plugin with

<transformers>
      <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>javamoney.properties</resource>
    </transformer>
</transformers>

which combined these before.

Now only one is picked, which blocks the app from starting, because the configuration for the requested ExchangeRateProvider can't be found.

Implementation ideas

UberJarMergedResourceBuildItem could be used for it. There is a config property to specify the ignored resources quarkus.package.jar.user-configured-ignored-entries, similar there could be quarkus.package.jar.user-configured-merged-entries.

@Dudeplayz Dudeplayz added the kind/enhancement New feature or request label Feb 6, 2025
Copy link

quarkus-bot bot commented Feb 6, 2025

/cc @radcortez (config)

@Dudeplayz Dudeplayz changed the title Add (configurable) shading for additional files for uber-jar creation Add (configurable) merging for user defined files for uber-jar creation Feb 6, 2025
@melloware
Copy link
Contributor

Not a bad idea. JavaMoney would probably need a custom Extension to make this work in combining files now. Did you also look into this Quarkus JavaMoney extension: https://github.com/quarkiverse/quarkus-moneta

@melloware
Copy link
Contributor

melloware commented Feb 6, 2025

@Dudeplayz if you open a ticket at Quarkus Moneta this is a really easy fix.

@BuildStep(onlyIf = IsNormal.class)
    void uberJarFiles(BuildProducer<UberJarMergedResourceBuildItem> uberJarMergedProducer) {
        uberJarMergedProducer.produce(new UberJarMergedResourceBuildItem("javamoney.properties"));
    }

@melloware
Copy link
Contributor

cc @andlinger

@gsmet
Copy link
Member

gsmet commented Feb 6, 2025 via email

@melloware
Copy link
Contributor

PR submitted: quarkiverse/quarkus-moneta#82

@Dudeplayz
Copy link
Author

Thanks!

But maybe it still would be a good addition to have some config property to simply allow it for other resources, without the need to create an own extension?

@melloware
Copy link
Contributor

Yep its still assigned to the Quarkus but i thought it was worth fixing in the extension for others!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants