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

[OPENJPA-2896] automatic module name is set for bundles #92

Merged
merged 4 commits into from
Dec 23, 2021

Conversation

solomax
Copy link
Contributor

@solomax solomax commented Dec 17, 2021

No description provided.

@@ -110,6 +110,7 @@
<Specification-Title>JSR-338 Java Persistence</Specification-Title>
<Specification-Vendor>ORACLE, Inc.</Specification-Vendor>
<Specification-Version>2.2</Specification-Version>
<Automatic-Module-Name>org.apache.openjpa.all</Automatic-Module-Name>
Copy link
Contributor

Choose a reason for hiding this comment

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

isnt it a broken pattern to not have the same name for standard dep and bundle one? should be replaceable and it is no more?

Maybe leave the bundle away from JPMS or only enable JPMS for it but not both, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I understand what is wrong :(
I believe every module need it's own unique name :))

I've added automatic module name to openjpa-all for consistency

I try to migrate my main project to JPMS and fix all

[WARNING] * Required filename-based automodules detected: [openjpa-3.2.1-SNAPSHOT.jar]. Please don't publish this project to a public artifact repository! *

I can leave openjpa-allas-is in this PR, would it be better? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe every module need it's own unique name :))

Right but when you do an all on one you dont create a new module but you merge N modules.
Issue is on consumer side, you depend on org.apache.openjpa.kernel, with this strategy your module-info will depend on openjpa.all or openjpa.kernel (ie the deployment is bound to the build now) which is quite unlikely so it is better to have stable names for the same packages.
This is why I think we should choose to enable JPMS for only the fatjar or only independent modules but not both.

Choose a reason for hiding this comment

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

Agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right now I have dependency on openjpa-3.2.1-SNAPSHOT.jar (which is fatjar as well)
and I have no option to add org.apache.openjpa.kernel
only openjpa with WARN :(

what am I doing wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I can see some project do have "Automatic Module name" for both fat-jars and regular jars
for example Apache Tika

I would expect most of users will use fat-jar-dependency

Not sure what should be my next steps :(

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, some do and break users (unintentionally from the ones I saw - mainly a "put automatic names everywhere" without caring about consumer side :().
The topic is interesting and joins another one: should our fatjar be the recommended one or should we promote the modular approach? Once this question answered we just put automatic names - or real module-info - in these modules.
One approach is to get stats from public github repos using openjpa.
I tend to think like you but without figures it is quite hypothetic IMHO.
Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Well I would really use github cause mvnrepo just indexes central and very few projects are released to central (guess central download stats are an alternative approach which can be better). We are at 40% for the fatjar, 11 for the karaf feature and rest is distributed <= 7% between other artifacts so our assumption was right, let's name the module only for the fatjar :).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be addressed :)

Copy link
Contributor

@rmannibucau rmannibucau left a comment

Choose a reason for hiding this comment

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

Okish for me, points to check before hitting merge:

  1. do we want org.apache.openjpa.jakarta? assume we move from javax to jakarta in the code, we would keep org.apache.openjpa so for me we should use the same name (both can't be in the same classloader anyway)
  2. why org.apache.openjpa and org.apache.openjpa.all, due to the reasoning we had on this PR I think a single one is valid.

@solomax
Copy link
Contributor Author

solomax commented Dec 23, 2021

Shall I drop Auto-module for openjpa-all artifact?
not using it since it is too fat :)))

@rmannibucau
Copy link
Contributor

@solomax let's just have openjpa one then ;)

@solomax solomax merged commit 468a453 into master Dec 23, 2021
@solomax solomax deleted the OPENJPA-2896-module-name branch December 23, 2021 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants