Closed kenolson closed 1 year ago
I‘ve encountered the same problem. Naming a package with hyphen is really a bad idea, hope it could get renamed. Since this issue has been open for 7 months with no updates, I take it that it won't be soon fixed, so I created a temporary library that solves this issue (by renaming the evil "java-time" to "javatime"). For anyone who encountered the same problem, this library might be of help. It's available in maven central, and the usage is below:
repositories {
mavenCentral()
}
dependencies {
implementation("org.rationalityfrontline.workaround:exposed-java-time:0.29.1")
}
Have the same issue, still not fixed. Wonder why they havent noticed during development. Would bet they use Intellij, the editor should give warnings and building shouldnt be possible ether with this namespace. Makes exposed unuseable for dao in most cases.
Has this still not been fixed? How!!
@xidsyed This issue was fixed by this commit and was included in the release of version 0.36.1 in 2021. The issue, unlike its duplicate, was just not closed.
If there is still an issue related to using the package or .jar files, please consider reporting it on YouTrack so we can investigate further.
Using exposed-java-time.jar with JPMS results in an exception during initial classloading. Exception in thread "main" java.lang.NoClassDefFoundError: org/jetbrains/exposed/sql/java-time/JavaDateColumnTypeKt
When using exposed in a project using the java module system (module-info.java present), the exposed-java-time.jar file fails to load as a module because the package name of its classes is not a valid java package name. During module loading the jar file is scanned to discover all the packages contained in the jar (so the JVM can construct a package to module map).
For each class found the package name is extracted and validated (path through JVM is ModulePath.deriveModuleDescriptor() -> ModulePath.toPackageName() -> Checks.isPackageName() -> Checks.isTypeName() -> Checks.isJavaIdentifier()) which fails due to the hyphen in "java-time" segment of the package name.
The jar file works when not used in a project using the java module system because this validation is not performed or needed. The exposed-jodatime.jar file works with the java module system because its package name is valid.
Please rename / duplicate or otherwise correct the package name (add an additional jar such as exposed-javatime with valid package names to preserve backward compatibility?) so that exposed can be fully used with the java module system.
Sample code to reproduce the issue below.
main.kt
module-info.java
pom.xml