blob: 13071df35cae604a7befb6d2931a46c29607ad2c [file] [log] [blame]
David Ostrovsky7a686552014-01-24 19:03:50 +01001= Gerrit Code Review - Building plugins
2
3
4From build process perspective there are three types of plugins:
5
6* Maven driven
7* Buck in tree driven
8* Buck standalone driven
9
10These types can be combined: if both files in plugin's root directory exist:
11
12* `BUCK`
13* `pom.xml`
14
15the plugin can be built with both Buck and Maven.
16
17
18== Maven driven build
19
20If plugin contains `pom.xml` file, it can be built with Maven as usually:
21
22----
23mvn clean package
24----
25
26Exceptions from the rule above:
27
28=== Exception 1:
29
30
31Plugin's `pom.xml` references snapshot version of plugin API:
32`2.8-SNAPSHOT`. In this case there are two possibilities:
33
34* switch to release API. Change plugin API version in `pom.xml` from
35 `2.8-SNAPSHOT` to `2.8.1` and repeat step 1 above.
36* build and install `SNAPSHOT` version of plugin API in local Maven repository:
37
38----
David Pursehoused5f3ca52016-09-01 19:32:27 +090039./tools/maven/api.sh install
David Ostrovsky7a686552014-01-24 19:03:50 +010040----
41
42=== Exception 2:
43
44Plugin's `pom.xml` references other own or foreign (unpublished) libraries or
45even other Gerrit plugins. These libraries and/or plugins must be built and
46installed in local Maven repository. Clone the related projects and issue
47
48----
49mvn install
50----
51
52Repeat step 1. above.
53
54
55== Buck in tree driven
56
57
58The fact that plugin contains `BUCK` file doesn't mean that building this
59plugin from the plugin directory works. For now it doesn't. Buck in tree driven
60means it can only be built from within Gerrit tree. Clone or link the plugin
61into gerrit/plugins directory:
62
63----
64cd gerrit
65buck build plugins/<plugin-name>:<plugin-name>
66----
67
68The output can be normally found in the following directory:
69
70----
71buck-out/gen/plugins/<plugin-name>/<plugin-name>.jar
72----
73
74Some plugins describe their build process in `src/main/resources/Documentation/build.md`
75file. It may worth checking.
76
77== Buck standalone driven
78
79Only few plugins support that mode for now:
80
81----
82cd reviewers
83buck build plugin
84----
85
86GERRIT
87------
88Part of link:index.html[Gerrit Code Review]
89
90SEARCHBOX
91---------