Proposal: #VersionedDependences

mark.reinhold at mark.reinhold at
Thu Jan 26 22:35:31 UTC 2017

2016/12/9 14:10:43 -0800, david.lloyd at
> On 12/09/2016 03:46 PM, mark.reinhold at wrote:
>> ...
>> Proposal
>> --------
>> ...
>> Now that compile-time versions can be recorded in module descriptors
>> there is even less need to tolerate version information in module names,
>> a bad practice that we'd like to discourage at the outset.  We therefore
>> further propose to:
>>  - Revise the accepted proposal for #VersionsInModuleNames [3] to state
>>    that a module name appearing anywhere in a source-form module
>>    declaration must both start and end with "Java letters" [4].
> Can we just drop this part?  I really am not a fan of the 
> social-enforcement-in-technical-code thing, and I can already think of 
> one existing project off the top of my head that will suffer 
> collaterally from this: Fabric8.  Also any other project to which the 
> "vanity license plate effect" would apply.

This is only the second example that's been pointed out since I posted
the original proposal for #VersionsInModuleNames [1], the first being
`commons-lang3` [2].

>                                             And I can think of many ways 
> to circumvent this rule, including, but not limited to, bracketing with 
> letters "v5slot", roman numerals, etc., so really all it does is add an 
> annoying "big brother" effect without practical benefit.

Sure, you can work around it, but disallowing the obvious abuses should
go a long way towards encouraging people to do the right thing.

If this restriction really becomes a problem then we could consider
loosening it in a later release.  If we lift it now and this kind of
abuse becomes common then we'll have no way to go back.

> Anyway I disagree pretty strongly that versions (or more specifically, 
> version segments) in module names are that really that strong of an 
> anti-pattern.  Sure having whole version numbers in is a pretty fragile 
> technique, but it's very useful to have (for example) multiple major 
> versions of a library on a large distribution to ease migration, 
> especially when you're talking hundreds or thousands of modules.

In the context of JPMS, I respectfully disagree.  We long ago chose
explicitly not to solve the version-selection problem in this module
system, leaving it to build tools and container applications.  If we
allow digits at the end of module names then we just invite confusion.
"I wrote `requires foo4` but I have `foo5.jar` on my module path, why
doesn't that work?"

- Mark


More information about the jpms-spec-observers mailing list