wForget commented on issue #2328:
URL: 
https://github.com/apache/incubator-kyuubi/issues/2328#issuecomment-1096894191

   > ```
   > val codeSourcePath = 
getClass.getProtectionDomain.getCodeSource.getLocation.getPath
   > val cwd = if (codeSourcePath.contains("kyuubi-assembly")) {
   >   codeSourcePath.split("kyuubi-assembly")
   > } else {
   >   codeSourcePath.split("kyuubi-server")
   > }
   > assert(cwd.length > 1)
   > Option(Paths.get(cwd.head, "externals", module, "target", jarName))
   >   .map(_.toAbsolutePath.toFile.getCanonicalPath)
   > ```
   
   @ulysses-you @pan3793 This doesn't seem like a good way, because for 
KyuubiServer started by `bin/kyuubi start` , we can use 
`env.get(KyuubiConf.KYUUBI_HOME)` to get kyuubi root path.
   
   We just need to get `mainResource` like this:
   ```
   env.get(KyuubiConf.KYUUBI_HOME).map { Paths.get(_, "externals", module, 
"target", jarName) }
   ```
   
   I will try to fix it later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to