Closed Eurybiadan closed 4 years ago
It sounds like the POM of your project could be missing dependencies. Would you be able to share some more about the setup with us?
This very simple demo project shows the minimal dependencies and uom-lib-common
is also part of it: https://github.com/unitsofmeasurement/uom-demos/blob/master/console/basic/pom.xml
IntelliJ tells me that uom-lib-common is already added as a dependency, but even adding it explicitly doesn't fix it.
My pom originally included just the line (per your uom-guide):
<dependency>
<groupId>tech.units</groupId>
<artifactId>indriya</artifactId>
<version>2.0</version>
</dependency>
But in order to get both SI and USCustomary unit I added.
<dependency>
<groupId>systems.uom</groupId>
<artifactId>systems-common</artifactId>
<version>2.0</version>
</dependency>
It's important to note that moving to 2.0.1 does not fix my issue.
I also use junit jupiter:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
It's also important to note that if I create a new project, and place just
<dependency>
<groupId>tech.units</groupId>
<artifactId>indriya</artifactId>
<version>2.0</version>
</dependency>
In my pom and the line above into a java file, there are no issues compiling. So I'm guessing there's a conflict somewhere...
Ugh, I found it and fixed it. Turns out my classpath didn't auto-update to include the dependencies of indriya. Sorry for clogging your issues feed.
I am using Indriya 2.0.1 via Maven and am getting an error at compile time wherever I instantiate a custom unit; for example, if I create a "pixel" unit:
Unit<Dimensionless> PIXEL = new BaseUnit<Dimensionless>("px","pixel");
This leads to the error:
Any advice would be appreciated.