Hi everyone, i'm struggling with a dependency issu...
# announcements
r
Hi everyone, i'm struggling with a dependency issues. Apparently the kotlin-compiler has some google guava code copied to it? So not a dependency but the actual class files. This is causing a confliflct with the selenium library which uses guava
g
are you using the embedded compiler library? It adds the Guava code under internal packages to avoid classloader conflicts.
r
No its loaded via the kotlin maven plugin
And it seems to be the normal compiler for kotlin
k
Are you sure the compiler is conflicting with your actual dependencies? The compiler is only a dependency of the build, not the real code.
I don't know how this works in maven but in gradle you have to specify them separately, maybe you made a mistake there?
r
No i should clarify, when i run my tests in intellij it fails because of an dependency issue
It tries ro call a method with a different signature than provider by the kotlin compiler
d
What exactly outcome do you see? IntelliJ Plugin exception? Compiler exception during compilation?
r
Hold on
I get a nosuchmethoderror when running the test in intellij
d
Can you please post a complete stacktrace?
r
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124) at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32) at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:339) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123) at testData.TestData.createDriver(TestData.kt:43) at testData.TestData.<clinit>(TestData.kt:38) at functions.BrowserFunctionsKt.openBrowserWithPage(BrowserFunctions.kt:16) at steps.Steps$1.accept(Steps.kt:43) at ✽.Given I am on the page "removed" (C:/data/repos/kotlin-ogurets-shablonnyy/src/test/
How do i use the kotlin-maven-plugin with the embedded compiler
d
Can you please clarify, why do you think that kotlin compiler has something to do with it? For me, it looks like you're launching already compiled code, and it fails with
NoSuchMethodError
-- at that point kotlin compiler should have already finished and terminated
r
Because the compiler is on the classpath and is that internal guava code that gets executed. Its not that it is wrongly compiled somehow.
I think the issue is that with gradle you have different configurations so the compiler will never end up on the project classpath as karel stated
k
I can't imagine maven doesn't have the same concept.
r
Yeah i agree
d
If kotlin-maven-plugin somehow adds kotlin-compiler on the classpath of the user code, then this is an issue indeed. If that's the case, can you please report issue with minimal repro to YouTrack (kotl.in/issue)? It will be passed to folks who know kotlin-maven-plugin better than me 🙂
r
Or me...
I think theres already a similar issue
Although the pr is blocked for an unclear reason
k
That issue is about conflicting with other compile-time plugins, which makes sense, but you issue seems to be about conflicting at runtime? That's something different entirely
r
Jezus, its a tottaly different project. Completely overlooked, sorry!
I create an issue later todst
k
Yea that too.
r
It is resolved though, i gave the compiler a provider scope and used the embedded instead