9. Modify the pom.xml files under plugins/hooks-its AND plugins/hooks-its/hooks-its:
123456789101112131415161718192021222324252627
cd plugins/hooks-its
$ git diff
diff --git a/hooks-its/pom.xml b/hooks-its/pom.xml
index a206459..75e11dc 100644
--- a/hooks-its/pom.xml
+++ b/hooks-its/pom.xml
@@ -22,7 +22,7 @@ limitations under the License.
<parent>
<groupId>com.googlesource.gerrit.plugins.its</groupId>
<artifactId>hooks-its-parent</artifactId>
- <version>2.9-SNAPSHOT</version>
+ <version>2.8</version>
</parent>
<artifactId>hooks-its</artifactId>
<name>Gerrit Code Review - Commit validation and Workflow</name>
diff --git a/pom.xml b/pom.xml
index 600bff9..995d008 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@ limitations under the License.
<groupId>com.googlesource.gerrit.plugins.its</groupId>
<artifactId>hooks-its-parent</artifactId>
<packaging>pom</packaging>
- <version>2.9-SNAPSHOT</version>
+ <version>2.8</version>
<name>Gerrit Code Review - Issue tracker support</name>
10. Build the hooks-its:
12
$ cd plugins/hooks-its
$ mvn -DskipTests -Dmaven.test.skip=true package install
NOTE: The hooks-its-2.8.jar will be generated here: hooks-its/target/hooks-its-2.8.jar
NOTE: If don’t skip tests, run with the command: mvn clean package install, then will fail on test case!
NOTE: Gerrit select BUCK as its new build system, for new plugin, please reference to the following NOTES #5
11. Modify the pom.xml files under plugins/hooks-jira:
123456789101112131415
$ cd plugins/hooks-jira
$ git diff
diff --git a/pom.xml b/pom.xml
index 7b04c60..8f60c78 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
<parent>
<groupId>com.googlesource.gerrit.plugins.its</groupId>
<artifactId>hooks-its-parent</artifactId>
- <version>2.9-SNAPSHOT</version>
+ <version>2.8</version>
</parent>
<artifactId>hooks-jira</artifactId>
<packaging>jar</packaging>
12. Build the hooks-jira:
12
$ cd plugins/hooks-jira
$ mvn clean package
NOTE: The hooks-jira-2.8.jar will be generated here: target/hooks-jira-2.8.jar
13. Copy the following jar files to the plugin folder under the Gerrit installation path on remote server:
2. The file review_site/etc/gerrit.config should look like:
12345678
[jira]url= http://review.example.com:8080
username= jira-robot
commentOnRefUpdatedGitWeb=false# to comment gitweb comments on jira[commentLink "jira"]match=([A-Z]+-[0-9]+)html= <a href=\"http://jira.example.com:8080/browse/$1\">$1</a>
association= SUGGESTED
3. If we just want to parse the jira id on the subject of the git comments, then here is the diff:
12345678910111213
diff --git a/hooks-its/src/main/java/com/googlesource/gerrit/plugins/hooks/util/
index a04b175..3d56426 100644
--- a/hooks-its/src/main/java/com/googlesource/gerrit/plugins/hooks/util/CommitM
+++ b/hooks-its/src/main/java/com/googlesource/gerrit/plugins/hooks/util/CommitM
@@ -31,7 +31,7 @@ public class CommitMessageFetcher { RevWalk revWalk= new RevWalk(repo);
RevCommit commit= revWalk.parseCommit(ObjectId.fromString(commitId));
- return commit.getFullMessage();
+ return commit.getShortMessage();
} finally { repo.close();
}
4. Get the log message from jetty/logs on Gerrit server.
5. Gerrit choose BUCK as its new build system, so for the new plugin, the build steps should be (take cookbook-plugin as an example):
1
buck build plugins/cookbook-plugin
The output is created in: buck-out/gen/plugins/cookbook-plugin/cookbook-plugin.jar