plugins {
id("java")
id("application")
}
dependencies {
// implementation(fileTree("lib")) // this lead to same issue
implementation(files("lib/stdlib.jar"))
}
i can use only stdlib classes on only classes declared on the default package and i am not using module
this only happened with local dependency using dependency from maven or google repo has no issue
is that expected? or i am missing something here
system specs
Gradle 8.3
Kotlin: 1.9.0
Groovy: 3.0.17
Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM: 17.0.8 (Red Hat, Inc. 17.0.8+7-LTS)
OS: Linux 5.14.0-284.30.1.el9_2.x86_64 amd64
IntelliJ IDEA 2023.2.2 (Community Edition)
Besides, that a flatDir repository is practically always preferable over using files or fileTree dependencies, it is quite unclear what you mean.
Can you please provide an MCVE that shows what problem you have?
create new project on inteljidea choosing gradle as the build tool and using kotlin dsl
using the build above
create 2 class one on the default package and another one on any package let say test package
on those both classes use any class that on the jar file
the class that you created on the default package will be able to use any class on the jar file but the class that on the test package will not be able to detect any thing from the jar file as if i did not add it to my dependency
this not happen if the dependency was on maven for example so only on local dependency
Unfortunately, no.
Your description neither fulfills the C nor the V of “MCVE”.
From how I understood your instructions, it works perfectly fine here.
Can you please make it C and V, for example by providing a ZIP with the reproducer, or by pushing it to some GitHub repository or similar?
i got the issue the classes on the jar file was on the default package that why i could not reference any of them from any class outside the default package