Skip to content

Commit 57a914d

Browse files
committed
Bump to GitBlit 1.7.0-SNAPSHOT
Change-Id: I11081a077aaad974ca20f29ab0be5d56d69846bb
1 parent 4d9e3b2 commit 57a914d

22 files changed

+654
-512
lines changed

README

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
GitBlit plugin
2+
==============
3+
4+
Overview
5+
--------
6+
Purpose of this plugin is to use Gitblit as web-based viewer
7+
(i.e. GitWeb replacement) on top of Gerrit Code Review.
8+
9+
How to build
10+
------------
11+
As pre-requisites you need to make a custom-build of Gitblit
12+
and Wicket: the standard JARs downloaded from a public Maven
13+
repository aren't enough as they are missing some specific
14+
build parameters and constraints (i.e. shaded-jar) that are
15+
needed for a Gerrit plugin to work properly.
16+
17+
### Wicket
18+
You need to clone and build a modified version of Wicket that
19+
is currently published on GitHub under the GerritCodeReview
20+
organisation: https://github.com/GerritCodeReview/wicket.git
21+
22+
$ git clone https://github.com/GerritCodeReview/wicket.git
23+
$ git checkout wicket-1.4.23-gerrit
24+
$ mvn clean install -DskipTests
25+
26+
### Gitblit
27+
You need to clone Gitblit from GitHub and build it locally
28+
using the installMaven ANT target.
29+
30+
$ git clone https://github.com/gitblit/gitblit.git
31+
$ git checkout develop
32+
$ ant -DresourceFolderPrefix=static installMaven
33+
34+
### Gitblit plugin
35+
You are ready now to clone and build the Gitblit plugin: the
36+
Wicket and Giblit dependencies will be taken from your local
37+
Maven repository.
38+
39+
$ mvn package
40+
41+
Configuration
42+
-------------
43+
In order to use GitBlit as GitWeb replacement, please apply
44+
the following configuration to your Gerrit config.
45+
(assuming plugin was copied as gitblit.jar)
46+
47+
[gitweb]
48+
type = custom
49+
linkname = Gitblit
50+
url = plugins/
51+
revision = gitblit/commit/?r=${project}&h=${commit}
52+
project = gitblit/summary/?r=${project}
53+
branch = gitblit/log/?r=${project}&h=${branch}
54+
filehistory = gitblit/history/?f=${file}&r=${project}&h=${branch}
55+
file = gitblit/blob/?r=${project}&h=${commit}&f=${file}
56+
roottree = gitblit/tree/?r=${project}&h=${commit}

pom.xml

Lines changed: 31 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -28,103 +28,31 @@ limitations under the License.
2828
<Gerrit-InitStep>com.googlesource.gerrit.plugins.gitblit.GitBlitInitStep</Gerrit-InitStep>
2929
<Gerrit-Module>com.googlesource.gerrit.plugins.gitblit.GitBlitModule</Gerrit-Module>
3030
<Gerrit-HttpModule>com.googlesource.gerrit.plugins.gitblit.GitBlitServletModule</Gerrit-HttpModule>
31+
<dagger.version>1.1.0</dagger.version>
32+
<wicket.version>1.4.23-gerrit</wicket.version>
3133
</properties>
3234
<dependencies>
3335
<dependency>
3436
<groupId>com.google.gerrit</groupId>
3537
<artifactId>gerrit-plugin-api</artifactId>
3638
<version>${Gerrit-ApiVersion}</version>
39+
<scope>provided</scope>
3740
</dependency>
3841
<dependency>
3942
<groupId>com.gitblit</groupId>
4043
<artifactId>gitblit</artifactId>
41-
<version>1.4.0-SNAPSHOT</version>
42-
</dependency>
43-
<dependency>
44-
<groupId>org.apache.wicket</groupId>
45-
<artifactId>wicket-auth-roles</artifactId>
46-
<version>1.4.21</version>
47-
</dependency>
48-
<dependency>
49-
<groupId>org.apache.wicket</groupId>
50-
<artifactId>wicket-extensions</artifactId>
51-
<version>1.4.21</version>
52-
</dependency>
53-
<dependency>
54-
<groupId>org.wicketstuff</groupId>
55-
<artifactId>googlecharts</artifactId>
56-
<version>1.4.21</version>
57-
</dependency>
58-
<dependency>
59-
<groupId>org.apache.httpcomponents</groupId>
60-
<artifactId>httpcore</artifactId>
61-
<version>4.2.1</version>
62-
</dependency>
63-
<dependency>
64-
<groupId>javax.mail</groupId>
65-
<artifactId>mail</artifactId>
66-
<version>1.4</version>
67-
</dependency>
68-
<dependency>
69-
<groupId>commons-net</groupId>
70-
<artifactId>commons-net</artifactId>
71-
<scope>provided</scope>
72-
<version>3.1</version>
73-
</dependency>
74-
<dependency>
75-
<groupId>commons-codec</groupId>
76-
<artifactId>commons-codec</artifactId>
77-
<version>1.6</version>
78-
</dependency>
79-
<dependency>
80-
<groupId>org.codehaus.groovy</groupId>
81-
<artifactId>groovy-all</artifactId>
82-
<version>1.8.8</version>
83-
</dependency>
84-
<dependency>
85-
<groupId>com.beust</groupId>
86-
<artifactId>jcommander</artifactId>
87-
<version>1.17</version>
88-
</dependency>
89-
<dependency>
90-
<groupId>jdom</groupId>
91-
<artifactId>jdom</artifactId>
92-
<version>1.0</version>
93-
</dependency>
94-
<dependency>
95-
<groupId>org.apache.lucene</groupId>
96-
<artifactId>lucene-core</artifactId>
97-
<version>3.6.0</version>
98-
</dependency>
99-
<dependency>
100-
<groupId>org.apache.lucene</groupId>
101-
<artifactId>lucene-highlighter</artifactId>
102-
<version>3.6.0</version>
103-
</dependency>
104-
<dependency>
105-
<groupId>org.apache.lucene</groupId>
106-
<artifactId>lucene-memory</artifactId>
107-
<version>3.6.1</version>
108-
</dependency>
109-
<dependency>
110-
<groupId>org.tautua.markdownpapers</groupId>
111-
<artifactId>markdownpapers-core</artifactId>
112-
<version>1.3.2</version>
113-
</dependency>
114-
<dependency>
115-
<groupId>rome</groupId>
116-
<artifactId>rome</artifactId>
117-
<version>1.0-selfload</version>
118-
</dependency>
119-
<dependency>
120-
<groupId>com.unboundid</groupId>
121-
<artifactId>unboundid-ldapsdk</artifactId>
122-
<version>2.3.0</version>
44+
<version>1.7.0-SNAPSHOT</version>
45+
<exclusions>
46+
<exclusion>
47+
<groupId>org.apache.wicket</groupId>
48+
<artifactId>wicket</artifactId>
49+
</exclusion>
50+
</exclusions>
12351
</dependency>
12452
<dependency>
12553
<groupId>org.apache.wicket</groupId>
12654
<artifactId>wicket</artifactId>
127-
<version>1.4.21-selfload</version>
55+
<version>1.4.23-gerrit</version>
12856
</dependency>
12957
</dependencies>
13058
<build>
@@ -151,7 +79,6 @@ limitations under the License.
15179
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
15280
<artifactSet>
15381
<excludes>
154-
<exclude>com.google.gerrit:*</exclude>
15582
<exclude>org.bouncycastle:*</exclude>
15683
<exclude>org.slf4j:*</exclude>
15784
<exclude>com.google.guava:*</exclude>
@@ -161,6 +88,26 @@ limitations under the License.
16188
<exclude>com.googlecode.javaewah:*</exclude>
16289
<exclude>com.jcraft:*</exclude>
16390
<exclude>javax.servlet:*</exclude>
91+
<exclude>org.apache.lucene:lucene-core</exclude>
92+
<exclude>org.apache.lucene:lucene-analyzers-common</exclude>
93+
<exclude>org.apache.lucene:lucene-queries</exclude>
94+
<exclude>org.apache.lucene:lucene-queryparser</exclude>
95+
<exclude>org.apache.sshd:*</exclude>
96+
<exclude>org.apache.mina:*</exclude>
97+
<exclude>org.bouncycastle:*</exclude>
98+
<exclude>com.google.inject:*</exclude>
99+
<exclude>com.google.inject.extensions:*</exclude>
100+
<exclude>javax.inject:*</exclude>
101+
<exclude>aopalliance:*</exclude>
102+
<exclude>org.pegdown:*</exclude>
103+
<exclude>org.parboiled:*</exclude>
104+
<exclude>commons-io:commons-io</exclude>
105+
<exclude>commons-codec:commons-codec</exclude>
106+
<exclude>args4j:args4j</exclude>
107+
<exclude>org.apache.commons:commons-compress</exclude>
108+
<exclude>org.tukaani:xz</exclude>
109+
<exclude>org.ow2.asm:*</exclude>
110+
<exclude>org.eclipse.jetty:*</exclude>
164111
</excludes>
165112
</artifactSet>
166113
<transformers>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright (C) 2014 The Android Open Source Project
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.googlesource.gerrit.plugins.gitblit;
16+
17+
import javax.servlet.ServletContext;
18+
19+
import com.gitblit.manager.IAuthenticationManager;
20+
import com.gitblit.manager.IGitblit;
21+
import com.gitblit.manager.INotificationManager;
22+
import com.gitblit.manager.IProjectManager;
23+
import com.gitblit.manager.IRepositoryManager;
24+
import com.gitblit.manager.IRuntimeManager;
25+
import com.gitblit.manager.IUserManager;
26+
import com.gitblit.servlet.GitblitContext;
27+
import com.google.gerrit.server.config.SitePaths;
28+
import com.google.inject.Inject;
29+
import com.google.inject.Singleton;
30+
31+
@Singleton
32+
class GerritGitBlitContext extends GitblitContext {
33+
private final SitePaths sitePaths;
34+
private final IRuntimeManager runtime;
35+
private final INotificationManager notificationManager;
36+
private final IUserManager userManager;
37+
private final IAuthenticationManager authenticationManager;
38+
private final IRepositoryManager repositoryManager;
39+
private final IProjectManager projectManager;
40+
private final IGitblit gitblit;
41+
42+
@Inject
43+
GerritGitBlitContext(SitePaths sitePaths,
44+
IRuntimeManager runtime,
45+
INotificationManager notificationManager,
46+
IUserManager userManager,
47+
IAuthenticationManager authenticationManager,
48+
IRepositoryManager repositoryManager,
49+
IProjectManager projectManager,
50+
IGitblit gitblit) {
51+
this.sitePaths = sitePaths;
52+
this.runtime = runtime;
53+
this.notificationManager = notificationManager;
54+
this.userManager = userManager;
55+
this.authenticationManager = authenticationManager;
56+
this.repositoryManager = repositoryManager;
57+
this.projectManager = projectManager;
58+
this.gitblit = gitblit;
59+
}
60+
61+
void init(ServletContext context) {
62+
// Manually configure IRuntimeManager
63+
runtime.setBaseFolder(sitePaths.site_path);
64+
runtime.getStatus().servletContainer = context.getServerInfo();
65+
runtime.start();
66+
67+
// start all other managers
68+
startManager(notificationManager);
69+
startManager(userManager);
70+
startManager(authenticationManager);
71+
startManager(repositoryManager);
72+
startManager(projectManager);
73+
startManager(gitblit);
74+
75+
logger.info("All Gitblit managers started.");
76+
}
77+
}

0 commit comments

Comments
 (0)