-
Notifications
You must be signed in to change notification settings - Fork 492
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
Fix JAR build issues #11119
base: develop
Are you sure you want to change the base?
Fix JAR build issues #11119
Conversation
Hmm - the @AutoService(PidProviderFactory.class) annotation (and similar for exporters) is supposed to do that. Do you have some problem with the autoservice dependency? |
@GPortas this looks like progress toward a solution! I'm going to also add a link to https://stackoverflow.com/questions/66000185/spring-factories-in-meta-inf-folder-not-added-to-target-folder-after-packaging/66000292#66000292 which you mentioned in Slack. I'm sure @qqmyers is right that something is amiss with We haven't bumped the version since then, since 2016. We're still on 1.0-rc2 even though https://github.com/google/auto/blob/main/service/README.md and https://github.com/google/auto/releases show never versions. The latest seems to be 1.11.0. Maybe it's worth trying a new version? To me, a version bump would be better than having to maintain a static list of files, as you've done (understandably!) in this PR. It's so strange that |
FWIW: #10713 updates autoservice to 1.1.1 which we've been using at QDR. |
Yes, in one of my tests, I updated the dependency to version 1.1.1, but it made no difference.
I think for some reason I don't know yet it isn't working for me... |
The strange thing is that this has always worked for me in the past! |
Once we're on the latest it would be legit to open an issue at https://github.com/google/auto/issues |
What this PR does / why we need it:
I suddenly started having issues with building the Docker image locally. I realized that the services weren't being correctly added to META-INF/services within the .jar created and included in the container image, and this was causing the ServiceLoader to be unable to find the required services during application startup.
I’m not sure how this was working for others without these files I am adding, or even for myself previously, but I had to include the services in the resources META-INF/services folder for the ServiceLoader to recognize them.
The content of the added files is copied from a jar built by @pdurbin using the latest develop.