Replace unused postgresql jar with manual site copy Once the executor is built, the resulting postgresql jar file should be manually copied over to the gerrit site /lib folder. Add this to the plugin documentation. Make the latter's executor-related section usable and cleaner. Before this change, the plugin-provided postgresql classes were not loaded upon gerrit core dependencies that transitively depended on them. Relational database support in Gerrit already expects driver files to be put under site's lib folder, for account_patch_reviews to duly function. Include that aspect in the amended plugin build documentation. Bug: Issue 12810 Change-Id: I5485068c55c34cc8193ee784abaf903a6b60ce13
diff --git a/BUILD b/BUILD index f311f16..bca433e 100644 --- a/BUILD +++ b/BUILD
@@ -7,11 +7,7 @@ "gerrit_plugin", ) -CONDUCTOR_DEPS = [ - "@postgresql//jar", -] - -EXECUTOR_DEPS = CONDUCTOR_DEPS + [ +EXECUTOR_DEPS = [ "@aopalliance//jar", "@dbcp//jar", "@guava//jar", @@ -25,6 +21,7 @@ "@log4j-core//jar", "@log4j-slf4j-impl//jar", "@pool//jar", + "@postgresql//jar", "@retry//jar", "@slf4j-api//jar", "@slf4j-ext//jar", @@ -48,7 +45,6 @@ ["src/main/resources/**/*"], exclude = ["src/main/resources/log4j2.xml"], ), - deps = CONDUCTOR_DEPS, ) java_library(
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md index 3643444..24ec423 100644 --- a/src/main/resources/Documentation/build.md +++ b/src/main/resources/Documentation/build.md
@@ -7,7 +7,7 @@ * In Gerrit tree. Standalone build mode is recommended, as this mode doesn't require local Gerrit -tree to exist. +tree to exist. This plugin has a side component, gc-executor, to build as well. Successfully running some of the tests requires Docker, which are skipped if Docker is not available. @@ -55,6 +55,7 @@ to generate the required files and then import the project. +## Building gc-executor To build the executor, issue the following command: @@ -65,11 +66,21 @@ The output is created in: ``` - /bazel-bin/gc-executor_deploy.jar + bazel-bin/gc-executor_deploy.jar ``` This jar should be renamed to gc-executor.jar before deployment. +Once the executor is built, the resulting postgresql jar file like below +should be manually copied over to the gerrit site /lib folder; on macOS: + +``` + bazel-out/darwin-fastbuild/bin/gc-executor.runfiles/gc_executor/external/postgresql/jar/postgresql-42.2.5.jar +``` + +That file has to be in accordance with potentially existing database driver +files under site's /lib, for proper account_patch_reviews support. + ## Build in Gerrit tree Clone or link this plugin to the plugins directory of Gerrit's