Replace JSR 275 Units Library
- Contact: jodygarnett,James Hughes
- Tracker: https://osgeo-org.atlassian.net/browse/GEOT-1234
- TLDR: JSR-275 units library is non active
- Branch: https://github.com/geotools/geotools/tree/matrix
The JScience beta units library is responsible for javax.measure packages including SI and NonSI. We use this library to handle reference system measurement conversions.
JSR-275 was rejected and cannot be considered for use. We are stuck using the JScience beta (or considering one of the alternatives).
Reference code example using current JScience beta:
Measurable<Duration> time = Measure.valueOf(2, MINUTE); long milliseconds = time.longValue( MILLI(SECOND));
The beta is method compatible with JSR-275.
- GEOT-1266 / GEOT-864 - for historical reference we already migrated once from JSR-108 to JSR-275
- For another teams take please see GEO-190 - GeoAPI considering sticking with JSR-275 until they hear back from JSR-363
- geotools-devel email discussion
- GeoTools change proposal
JSR-363 unitsofmeasure library
BLOCKER The interfaces are provided under a non-open source specification license which self destructs after two years or something.
Kind of odd that they would let something this destructive into maven central.
unit-ri - for Java 7 and ME
BSD License for the implementation, depends on on units-api above.
uom-se - for Java 8 and above
BSD License for the implementation, depends on units-api above.
We cannot upgrade at this time, due to the specification license. Once this JSR is approved we would be in position to change our dependency, and perform a small bit of refactoring.
Critically the package names used for the API are similar to JSR-275 and the JScience beta.
JScience is available as 4.3.1, so it's no longer Beta: http://search.maven.org/#artifactdetails%7Corg.jscience%7Cjscience%7C4.3.1%7Cjar is available, but according to its POM it seems under Apache 2, not BSD
I hope you are aware, JSR-275 0.9.3, which GeoAPI 3.0 uses as of today http://search.maven.org/#artifactdetails%7Cjavax.measure%7Cjsr-275%7C0.9.3%7Cjar uses exactly the same "destructive" license, so you used it for more than 2 years now and it did not seem to self-combust so far (except, the JCP EC never approved it, so it's "inofficial" to "illegitimate" depending on who you ask)
Seems okay, API has an open source and a commercial implementation.
More set up as an OSGi bundle, than as a jar we can use.
Hang tough on JScience beta (wait for release of JSR-363)
We have the option of using JScience Beta of JSR-275 (as long as the BSD-3 license on the beta holds up to review) until such time as JSR-363 is approved (at which point no package changes would be required).
As an example the header from NonSI.java:
/* * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences. * Copyright (C) 2006 - JScience (http://jscience.org/) * All rights reserved. * * Permission to use, copy, modify, and distribute this software is * freely granted, provided that this notice is preserved. */
And the pom.xml contained in the jar manifest has:
<licenses> <license> <name>BSD License</name> <url>http://jscience.org/doc/license.txt</url> <distribution>repo</distribution> <comments>A business-friendly OSS license</comments> </license> </licenses>
Roll our own
Similar to the idea of [removing geoapi interfaces](Resolve GeoAPI 3.0.0 Incompatibilities) we could roll our own unit classes, even using the JScience beta code as a starting point.
Choose one of:
- Under Discussion
- In Progress
- Andrea Aime
- Ben Caradoc-Davies
- Christian Mueller
- Ian Turton
- Justin Deoliveira
- Jody Garnett
- Simone Giannecchini
This section is used to make sure your proposal is complete (did you remember documentation?) and has enough paid or volunteer time lined up to be a success. Use initials to indicate volunteer, or where volunteer is neededs. Proposals that lack resources to be successful are unlikely to be approved.
- Add new dependency.
- Refactor code to new units library, and pass tests.
- Remove JSR-275 dependency
- Make a note on the upgrading page.