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

Fix JAR build issues #11119

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Fix JAR build issues #11119

wants to merge 1 commit into from

Conversation

GPortas
Copy link
Contributor

@GPortas GPortas commented Dec 20, 2024

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.

@qqmyers
Copy link
Member

qqmyers commented Dec 20, 2024

Hmm - the @AutoService(PidProviderFactory.class) annotation (and similar for exporters) is supposed to do that. Do you have some problem with the autoservice dependency?

@pdurbin
Copy link
Member

pdurbin commented Dec 20, 2024

@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 @AutoService not working properly. I checked and we first added @AutoService in 2016 in e560a34 as part of #3308 and we talk about it in our docs: https://guides.dataverse.org/en/6.5/developers/metadataexport.html

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 @AutoService has been working for all of us all this time and then it suddenly stopped working for you! Good job tracking this down!

@qqmyers
Copy link
Member

qqmyers commented Dec 20, 2024

FWIW: #10713 updates autoservice to 1.1.1 which we've been using at QDR.

@GPortas
Copy link
Contributor Author

GPortas commented Dec 20, 2024

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.

Hmm - the @AutoService(PidProviderFactory.class) annotation (and similar for exporters) is supposed to do that. Do you have some problem with the autoservice dependency?

I think for some reason I don't know yet it isn't working for me...

@GPortas
Copy link
Contributor Author

GPortas commented Dec 20, 2024

@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 @AutoService not working properly. I checked and we first added @AutoService in 2016 in e560a34 as part of #3308 and we talk about it in our docs: https://guides.dataverse.org/en/6.5/developers/metadataexport.html

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 @AutoService has been working for all of us all this time and then it suddenly stopped working for you! Good job tracking this down!

The strange thing is that this has always worked for me in the past!

@pdurbin
Copy link
Member

pdurbin commented Dec 20, 2024

Yes, in one of my tests, I updated the dependency to version 1.1.1, but it made no difference.

Once we're on the latest it would be legit to open an issue at https://github.com/google/auto/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants