Giter Site home page Giter Site logo

Comments (16)

ptahchiev avatar ptahchiev commented on June 24, 2024

I was able to build it by adding some extra requires tech.uom.lib.common; in the module-info

from uom-domain.

ptahchiev avatar ptahchiev commented on June 24, 2024

Does this need to be fixed? Do you want me to submit a PR?

from uom-domain.

keilw avatar keilw commented on June 24, 2024

Hi, this is a bug in Java 11 as well despite its LTS label it isn't as stable as sugested, especially with Jigsaw and Multi-Release-JARs.
The bug is summarized and pointed to here: https://stackoverflow.com/questions/53581799/jdeps-command-use-with-multi-release-option-failed

I cannot say for sure, what is the other issue, because it seems to fail even in Java 14 while Multi-Release-JAR problems we saw in the past no longer showed in
Please use Java 9 for now, it works perfectly fine with that.

from uom-domain.

keilw avatar keilw commented on June 24, 2024

If you found additional imports in the module-info that work above Java 11, please do, the issue you saw first ist a known problem in the JDK.

from uom-domain.

ptahchiev avatar ptahchiev commented on June 24, 2024

Thank you for your reply. I have created a PR to fix the build but I now have a new question. I add the uom-retail-quantity dependency to my pom.xml and I expect to be able to use the new units box, each and crate automatically. However, when I try to parse from string:

ServiceProvider.current().getFormatService().getUnitFormat().parse("box");

I get a MeasurementParseException because the unit is not found. I see none of the modules in the uom-domain project declare a javax.measure.spi.ServiceProvider and I was wondering if I have to declare one in my project. Or is it a missing feature? I mean I would expect each of the modules in this project to declare their own ServiceProvider to automatically register the units that it provides.

from uom-domain.

ptahchiev avatar ptahchiev commented on June 24, 2024

Oops - closed by mistake

from uom-domain.

keilw avatar keilw commented on June 24, 2024

But why reopen it, wasn't it fixed by your PR #18?

from uom-domain.

sroze avatar sroze commented on June 24, 2024

@keilw any chance you could do a release with that fix? 🙏 Thank you!

from uom-domain.

keilw avatar keilw commented on June 24, 2024

We are quite flexible here so I guess together with #16 this justifies a 2.1 release any time soon.

from uom-domain.

keilw avatar keilw commented on June 24, 2024

There is however a possible alignment with issues like unitsofmeasurement/uom-systems#177 but it could be done in a 2.1.1 release. So far this library seems independent of uom-systems, it may change in the future.

from uom-domain.

ptahchiev avatar ptahchiev commented on June 24, 2024

I want to test it before I close the issue. However I don't know how to use the new units. From above:

However, when I try to parse from string:

ServiceProvider.current().getFormatService().getUnitFormat().parse("box");

I get a MeasurementParseException because the unit is not found. I see none of the modules in the uom-domain project declare a javax.measure.spi.ServiceProvider and I was wondering if I have to declare one in my project. Or is it a missing feature? I mean I would expect each of the modules in this project to declare their own ServiceProvider to automatically register the units that it provides.

from uom-domain.

keilw avatar keilw commented on June 24, 2024

As of now there is no SystemOfUnits implementation that would even know a unit BOX.

from uom-domain.

ptahchiev avatar ptahchiev commented on June 24, 2024

But what would be the right approach - provide one with the module, or let the customer create his own. If you opt for the first one I can create a PR

from uom-domain.

keilw avatar keilw commented on June 24, 2024

Maybe similar to https://github.com/unitsofmeasurement/uom-domain/tree/master/health/health/src/main/java/tech/uom/domain/health/unit in "health" this might help, but note even in "health" there is no full integration with the SPI yet, but unless you go all the way of adding a custom formatter, check out https://github.com/unitsofmeasurement/uom-systems/blob/master/unicode/src/main/java/systems/uom/unicode/CLDR.java and see how SimpleUnitFormat is configured there, that might be sufficient, but keep in mind, it only works for SimpleUnitFormat.

from uom-domain.

keilw avatar keilw commented on June 24, 2024

Needs #14

I can fix it for Health, if you would like to create a PR for the "retail" module, there should be no conflicts.
I'll work on #2 and #16 but it is not necessary to recognize those new units to integrate the system with the SPI, that is the cherry on the cake if you want.

from uom-domain.

keilw avatar keilw commented on June 24, 2024

Imaging has a dependency already, so we should not release a 2.1 of this module before systems-uom 2.1 was released first.

from uom-domain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.