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

Have all project declare an explicit Java9 Automatic Module Name #667

Open
simonbasle opened this issue Apr 16, 2019 · 7 comments
Open

Have all project declare an explicit Java9 Automatic Module Name #667

simonbasle opened this issue Apr 16, 2019 · 7 comments
Labels
area/all-projects issues that are transverse to all projects, epics

Comments

@simonbasle
Copy link
Member

simonbasle commented Apr 16, 2019

The Automatic Module feature has 2 modes in terms of how it choses the generated module's name:

  • implicit: the name is derived from the jar filename, which could change eg. if someone imports a renamed jar manually rather than through Maven/Gradle...
  • explicit: the name is declared by the library maintainer in the MANIFEST.MF as an Automatic-Module-Name attribute.

The later solution is more stable, but makes the module name part of the API: this is basically a pledge to use that module name later on when explicit modularization is introduced. Note that changing the module name is not a light thing: every dependent modularized code will need to be updated to requires the new module name.

This epic is two-parts: choosing a name pattern for the projects and making sure no same package is split between two "modules".

@simonbasle simonbasle added the area/all-projects issues that are transverse to all projects, epics label Apr 16, 2019
@simonbasle
Copy link
Member Author

simonbasle commented Apr 16, 2019

Choosing an Automatic-Module-Name

The derived name from the standard Maven naming of the artifacts is in the form reactor.core/reactor.test/reactor.netty, with a few simpler ones like blockhound...

While this could be enough (this is what the Spring Framework is using for instance), there is a need for the module name to be globally unique, and reactor.core might be a touch too generic...

Proposal: use io.projectreactor.XXX as a fuller prefix (even though our packages are shorter, which might be a separate issue). See comment below for a complete list of proposed modules.

@simonbasle
Copy link
Member Author

simonbasle commented Apr 16, 2019

Split Packages

The JPMS enforces that no two modules can export the same package. This is for classes that are directly in said packages, so reactor.adapter vs reactor.adapter.akka is fine.

However there are at least a couple of projects where there is room for improvement in terms of packages: a more specific "root" package would be better:

@simonbasle
Copy link
Member Author

simonbasle commented Apr 16, 2019

Module Names Proposal 1

*Rejected*
  • reactor-core:
    • io.projectreactor.core
    • io.projectreactor.test
  • reactor-addons:
    • io.projectreactor.adapter (exports packages reactor.adapter.akka and reactor.adapter.rxjava, NOT reactor.adapter)
    • io.projectreactor.extra
    • io.projectreactor.logback (note: this one is under scrutiny to be dropped anyway)
  • reactor-netty:
    • io.projectreactor.netty (⚠️ older .ipc artifacts have generated name of reactor.netty so they shouldn't clash, but choosing this name would kind of enforce only being able to use a single 0.8+ netty module at at time. is that a problem @violetagg @smaldini ?)
  • reactor-rabbitmq:
    • io.projectreactor.rabbitmq
    • io.projectreactor.rabbitmq.samples
  • reactor-kafka:
    • io.projectreactor.kafka
    • io.projectreactor.kafka.samples
    • io.projectreactor.kafka.tools
  • reactor-tools:
    • io.projectreactor.tools
  • reactor-pool:
    • io.projectreactor.pool
  • BlockHound:
    • io.projectreactor.blockhound
    • io.projectreactor.blockhound.junit
  • reactor-scala-extensions: N/A
  • reactor-bom: N/A (this is purely a build artifact, not to be used as a JPMS module)

Please vote/comment @smaldini @violetagg @bsideup

@bsideup
Copy link
Contributor

bsideup commented Apr 16, 2019

io.projectreactor.reactor.core

Do we really need to duplicate "reactor" in it? io.projectreactor.reactor.core vs io.projectreactor.core

@simonbasle
Copy link
Member Author

io.projectreactor.reactor.core

Do we really need to duplicate "reactor" in it? io.projectreactor.reactor.core vs io.projectreactor.core

Good point, there is only blockhound that doesn't have the reactor prefix, so we can remove it in module names I guess 👍. Will edit the proposal above.

@simonbasle
Copy link
Member Author

simonbasle commented Apr 16, 2019

Module Names Proposal 2

Please vote/comment @smaldini @violetagg @bsideup

@acogoluegnes
Copy link

acogoluegnes commented Apr 17, 2019

@simonbasle Reactor RabbitMQ already uses reactor.rabbitmq (the samples don't have any automatic module name though, I can add one). I did so to be consistent with the Spring Framework guidelines. I don't mind changing to be consistent with the Reactor libraries, but it'll have to wait until Reactor RabbitMQ 2.0.

bsideup added a commit to reactor/BlockHound that referenced this issue Apr 29, 2019
To be more Jigsaw friendly, we should clearly define the top level
package for each Reactor's sub-project.
`reactor.BlockHound` class breaks this, and should be moved to a
dedicated package (`reactor.blockhound`)

See reactor/reactor#667
bsideup added a commit to reactor/BlockHound that referenced this issue Apr 29, 2019
To be more Jigsaw friendly, we should clearly define the top level
package for each Reactor's sub-project.
`reactor.BlockHound` class breaks this, and should be moved to a
dedicated package (`reactor.blockhound`)

See reactor/reactor#667
simonbasle added a commit to reactor/reactor-core that referenced this issue May 6, 2019
simonbasle added a commit to reactor/reactor-addons that referenced this issue May 6, 2019
simonbasle added a commit to reactor/reactor-netty that referenced this issue May 6, 2019
simonbasle added a commit to reactor/reactor-kafka that referenced this issue May 6, 2019
This includes tools and samples artifacts.

See reactor/reactor#667
simonbasle added a commit to reactor/reactor-pool that referenced this issue May 6, 2019
simonbasle added a commit to reactor/reactor-netty that referenced this issue May 6, 2019
simonbasle added a commit to reactor/reactor-kafka that referenced this issue May 6, 2019
simonbasle added a commit to reactor/reactor-pool that referenced this issue May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/all-projects issues that are transverse to all projects, epics
Projects
None yet
Development

No branches or pull requests

3 participants