Runtime.Version

Robert Scholte rfscholte at apache.org
Sat Jul 8 18:11:17 UTC 2017


Hi Rémi,

I'm talking about the concept of Versions in general, adding some examples.
Right now I'm working on the maven-javadoc-plugin which has a parsing  
issue since b175, which is more in line with Runtime.Version. In the  
future the plugin could switch to Runtime.Version, that why I had a look  
this new class.

Providing getters for all parts of the version-string could block future  
changes of the version scheme.

thanks,
Robert

On Sat, 08 Jul 2017 19:44:11 +0200, Remi Forax <forax at univ-mlv.fr> wrote:

> Hi Robert,
> this is the JDK version as specified by JEP 223 [1], this is not an  
> artifact version, this is the JDK (as a whole) version.
>
> The ModuleDescriptor.Version [2] is the module version, something like  
> your artifact version.
>
> The JDK version is loosely related to a module version because they some  
> version components like starting with 9.
>
> That's said, i'm not sure the JDK version is something that should be  
> checked/compared in the code, after all people can build there own JDK  
> with their own version.
> You can use the java.base version instead, there is a signing mechanism  
> (the module hashes) that ensures that the jdk modules and the java.base  
> module are compatible.
>
> regards,
> Rémi
>
> [1] [1] http://openjdk.java.net/jeps/223
> [2]  
> http://download.java.net/java/jigsaw/docs/api/java/lang/module/ModuleDescriptor.Version.html
>
> ----- Mail original -----
>> De: "Robert Scholte" <rfscholte at apache.org>
>> À: jpms-spec-experts at openjdk.java.net
>> Envoyé: Samedi 8 Juillet 2017 18:59:54
>> Objet: Runtime.Version
>
>> Hi,
>>
>> I'm kind of surprised by the number of methods of Runtime.Version:
>> http://download.java.net/java/jigsaw/docs/api/java/lang/Runtime.Version.html
>>
>> Based on my experience with versions I would advice to reduce the number
>> of methods.
>>
>> With Maven we had this interface:
>> http://maven.apache.org/ref/3.5.0/maven-artifact/apidocs/org/apache/maven/artifact/versioning/ArtifactVersion.html
>>
>> However, in the end all those separate segments didn't add a thing and  
>> are
>> actually causing unnecessary complex code in case we were doing other
>> implementations with ArtifactVersion. ArtifactVersion is quite an
>> important interface in our code, so there's no simple solution to  
>> simplify
>> this mistake.
>>
>> I'm really pleased that for Aether (which is now back at Maven as  
>> Artifact
>> Resolver) it is all reduced to this:
>> http://maven.apache.org/resolver/apidocs/org/eclipse/aether/version/Version.html
>>
>> This is all we need: parsing + comparing (+ #toString()). If none of the
>> additional methods of Runtime.Version is used *yet*, you should consider
>> to remove them.
>>
>> thanks,
>> Robert


More information about the jpms-spec-experts mailing list