Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
38322c37
Unverified
Commit
38322c37
authored
6 years ago
by
Cam Saul
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #9657 from metabase/merge-32
Merge 32
parents
0829dc7a
3174bea5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/plugins.clj
+9
-1
9 additions, 1 deletion
src/metabase/plugins.clj
src/metabase/plugins/files.clj
+7
-0
7 additions, 0 deletions
src/metabase/plugins/files.clj
with
16 additions
and
1 deletion
src/metabase/plugins.clj
+
9
−
1
View file @
38322c37
...
...
@@ -103,8 +103,16 @@
(
trs
"spark-deps.jar is no longer needed by Metabase 1.0+. You can delete it from the plugins directory."
)))))]
path
))
(
defn-
has-manifest?
^
Boolean
[
^
Path
path
]
(
boolean
(
files/file-exists-in-archive?
path
"metabase-plugin.yaml"
)))
(
defn-
init-plugins!
[
paths
]
(
doseq
[
^
Path
path
paths
]
;; sort paths so that ones that correspond to JARs with no plugin manifest (e.g. a dependency like the Oracle JDBC
;; driver `ojdbc8.jar`) always get initialized (i.e., added to the classpath) first; that way, Metabase drivers that
;; depend on them (such as Oracle) can be initialized the first time we see them.
;;
;; In Clojure world at least `false` < `true` so we can use `sort-by` to get non-Metabase-plugin JARs in front
(
doseq
[
^
Path
path
(
sort-by
has-manifest?
paths
)]
(
try
(
init-plugin!
path
)
(
catch
Throwable
e
...
...
This diff is collapsed.
Click to expand it.
src/metabase/plugins/files.clj
+
7
−
0
View file @
38322c37
...
...
@@ -122,6 +122,13 @@
;;; | JAR FILE CONTENTS |
;;; +----------------------------------------------------------------------------------------------------------------+
(
defn
file-exists-in-archive?
"True is a file exists in an archive."
[
^
Path
archive-path
&
path-components
]
(
with-open
[
fs
(
FileSystems/newFileSystem
archive-path
(
ClassLoader/getSystemClassLoader
))]
(
let
[
file-path
(
apply
get-path-in-filesystem
fs
path-components
)]
(
exists?
file-path
))))
(
defn
slurp-file-from-archive
"Read the entire contents of a file from a archive (such as a JAR)."
[
^
Path
archive-path
&
path-components
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment