1
1
#
2
- # Copyright (c) 2006, 2013 , Oracle and/or its affiliates. All rights reserved.
2
+ # Copyright (c) 2006, 2014 , Oracle and/or its affiliates. All rights reserved.
3
3
#
4
4
5
5
@@ -9,14 +9,15 @@ OpenGrok - a wicked fast source browser
9
9
1. Introduction
10
10
2. Requirements
11
11
3. Usage
12
- 4. OpenGrok setup
13
- 5. Optional Command Line Interface Usage
14
- 6. Change web application properties or name
15
- 7. OpenGrok systray
16
- 8. Information for developers
17
- 9. Tuning OpenGrok for large code bases
18
- 10. Authors
19
- 11. Contact us
12
+ 4. OpenGrok install
13
+ 5. OpenGrok setup
14
+ 6. Optional Command Line Interface Usage
15
+ 7. Change web application properties or name
16
+ 8. OpenGrok systray
17
+ 9. Information for developers
18
+ 10. Tuning OpenGrok for large code bases
19
+ 11. Authors
20
+ 12. Contact us
20
21
21
22
22
23
1. Introduction
@@ -89,13 +90,36 @@ Each of these directories was created with 'cvs checkout' command (with
89
90
appropriate arguments to get given branch) and will be treated by OpenGrok
90
91
as a project.
91
92
92
- 4. OpenGrok setup
93
+
94
+ 4. OpenGrok install
95
+ -----------------
96
+
97
+ 4.1 Installing on Solaris from *.p5p file
98
+ -----------------
99
+
100
+ 4.1.0 Install
101
+ -----------------
102
+
103
+ The file <package_name>.p5p you can easily use as a new publisher for the pkg command.
104
+
105
+ # pkg install --no-refresh -g /path/to/file/<package_name>.p5p opengrok
106
+
107
+
108
+ 4.1.1 Update
109
+ -----------------
110
+
111
+ You can also update OpenGrok software with the *.p5p file by running a command
112
+
113
+ # pkg update --no-refresh -g /path/to/file/<package_name>.p5p 'pkg://<publisher>/*'
114
+
115
+
116
+ 5. OpenGrok setup
93
117
-----------------
94
118
95
119
To setup OpenGrok it is needed to prepare the source code, let OpenGrok index
96
120
it and start the web application.
97
121
98
- 4 .1 Setting up the sources
122
+ 5 .1 Setting up the sources
99
123
--------------------------
100
124
101
125
Source base should be available locally for OpenGrok to work efficiently.
@@ -123,13 +147,13 @@ If you want to skip indexing the history of a particular directory
123
147
at the root of that directory.
124
148
125
149
126
- 4 .2 Using Opengrok wrapper script to create indexes
150
+ 5 .2 Using Opengrok wrapper script to create indexes
127
151
---------------------------------------------------
128
152
129
153
For *nix systems there is a shell script called OpenGrok which simplifies most
130
154
of the tasks. It has been tested on Solaris and Linux distributions.
131
155
132
- 4 .2.1 - Deploy the web application
156
+ 5 .2.1 - Deploy the web application
133
157
----------------------------------
134
158
135
159
First please change to opengrok directory where the OpenGrok shell script is
@@ -157,7 +181,7 @@ available to user running opengrok with all permissions. In root user case
157
181
it will create all the directories needed, otherwise you have to manually
158
182
create the directory and grant all permissions to the user used.
159
183
160
- 4 .2.2 - Populate DATA_ROOT Directory
184
+ 5 .2.2 - Populate DATA_ROOT Directory
161
185
------------------------------------
162
186
163
187
During this process the indexer will generate OpenGrok XML configuration file
@@ -221,7 +245,7 @@ OPENGROK_CONFIGURATION environment variable to point to it. Obviously such
221
245
setups can be used for nightly cron job updates of index or other automated
222
246
purposes.
223
247
224
- 4 .3 Using SMF service (Solaris) to maintain OpenGrok indexes
248
+ 5 .3 Using SMF service (Solaris) to maintain OpenGrok indexes
225
249
------------------------------------------------------------
226
250
227
251
If you installed OpenGrok from the OSOLopengrok package, it will work out of
@@ -260,12 +284,12 @@ Note: before removing the package please disable the service.
260
284
If you don't do it, it will not be removed automatically.
261
285
In such case please remove it manually.
262
286
263
- 4 .4 Using command line interface to create indexes
287
+ 5 .4 Using command line interface to create indexes
264
288
--------------------------------------------------
265
289
266
290
There are 2 (or 3) steps needed for this task.
267
291
268
- 4 .4.1 - Populate DATA_ROOT Directory
292
+ 5 .4.1 - Populate DATA_ROOT Directory
269
293
------------------------------------
270
294
271
295
Option 1. OpenGrok: There is a sample shell script OpenGrok that is suitable
@@ -281,7 +305,7 @@ hypertext files generated by OpenGrok are to be stored in DATA_ROOT, run
281
305
282
306
See opengrok.jar manual below for more details.
283
307
284
- 4 .4.2 - Configure and Deploy source.war Webapp
308
+ 5 .4.2 - Configure and Deploy source.war Webapp
285
309
----------------------------------------------
286
310
287
311
To configure the webapp source.war, look into the parameters defined in
@@ -299,7 +323,7 @@ web.xml of source.war file and change them (see note1) appropriately.
299
323
The contents of this file file will be appended to the footer of each
300
324
web page after the information about last index update.
301
325
302
- 4 .4.3 - Path Descriptions (optional)
326
+ 5 .4.3 - Path Descriptions (optional)
303
327
------------------------------------
304
328
305
329
OpenGrok can use path descriptions in various places (e.g. while showing
@@ -330,7 +354,7 @@ then the paths.tsv file contents can look like this:
330
354
331
355
Note that only some paths can have a description.
332
356
333
- 4 .4.4 - Changing webapp parameters (optional)
357
+ 5 .4.4 - Changing webapp parameters (optional)
334
358
---------------------------------------------
335
359
336
360
web.xml is the deployment descriptor for the web application. It is in a Jar
@@ -379,7 +403,7 @@ file named source.war, you can change it as follows:
379
403
380
404
This file will contain something like the Context described above.
381
405
382
- 4 .4.5 Custom ctags configuration
406
+ 5 .4.5 Custom ctags configuration
383
407
--------------------------------
384
408
385
409
To make ctags recognize additional symbols/definitions/etc. it is possible to
@@ -394,7 +418,7 @@ the full path to the file will be /var/opengrok/etc/ctags.config).
394
418
Sample configuration file for Solaris code base is delivered in the doc/
395
419
directory.
396
420
397
- 4 .5 Using Java DB for history cache
421
+ 5 .5 Using Java DB for history cache
398
422
-----------------------------------
399
423
400
424
By default OpenGrok stores history indexes in gzipped xml files. An alternative
@@ -486,7 +510,7 @@ the JavaDB data directory and add this line to it:
486
510
/var/lib/javadb/data/derby.properties
487
511
488
512
489
- 5 . Optional Command Line Interface Usage
513
+ 6 . Optional Command Line Interface Usage
490
514
----------------------------------------
491
515
492
516
You need to pass location of project file + the query to Search class, e.g.
500
524
501
525
$ java -cp ./opengrok.jar org.opensolaris.opengrok.search.Search
502
526
503
- 6 . Change web application properties or name
527
+ 7 . Change web application properties or name
504
528
--------------------------------------------
505
529
506
530
You might need to modify the web application if you don't store the
@@ -546,7 +570,7 @@ Deploy the modified .war file in tomcat:
546
570
547
571
* just copy the source.war file to TOMCAT_INSTALL/webapps directory.
548
572
549
- 7 . OpenGrok systray
573
+ 8 . OpenGrok systray
550
574
-------------------
551
575
552
576
The indexer can be setup with agent and systray GUI control application.
@@ -572,10 +596,10 @@ localhost, but rather on a physical network interface).
572
596
573
597
This agent is work in progress, so it might not fully work.
574
598
575
- 8 . Information for developers
599
+ 9 . Information for developers
576
600
-----------------------------
577
601
578
- 8 .0 Building
602
+ 9 .0 Building
579
603
------------
580
604
581
605
Just run 'ant' from command line in the top-level directory or use build
@@ -585,13 +609,13 @@ Note: in case you are behind http proxy, use ANT_OPTS to download jflex, lucene
585
609
E.g. $ ANT_OPTS="-Dhttp.proxyHost=?.? -Dhttp.proxyPort=80" ant
586
610
587
611
588
- 8 .0.1 Package build
612
+ 9 .0.1 Package build
589
613
-------------------
590
614
591
615
Run 'ant package' to create package (specific for the operating system this is
592
616
being executed on) under the dist/ directory.
593
617
594
- 8 .1 Unit testing
618
+ 9 .1 Unit testing
595
619
----------------
596
620
597
621
Note: For full coverage report your system has to provide proper junit test
@@ -620,7 +644,7 @@ The tests are then run as follows:
620
644
To check if the test completed without error look for AssertionFailedError
621
645
occurences in the TESTS-TestSuites.xml file produced by the test run.
622
646
623
- 8 .2 Using Findbugs
647
+ 9 .2 Using Findbugs
624
648
------------------
625
649
626
650
If you want to run Findbugs (http://findbugs.sourceforge.net/) on OpenGrok,
@@ -655,7 +679,7 @@ under the lib directory):
655
679
There is also a findbugs-xml ant target that can be used to generate XML files
656
680
that can later be parsed, e.g. by Jenkins.
657
681
658
- 8 .3 Using Emma
682
+ 9 .3 Using Emma
659
683
--------------
660
684
661
685
If you want to check test coverage on OpenGrok, download Emma from
@@ -706,7 +730,7 @@ To generate reports, run ant again:
706
730
Look at coverage/coverage.txt, coverage/coverage.xml and
707
731
coverage/coverage.html to see how complete your tests are.
708
732
709
- 8 .4 Using Checkstyle
733
+ 9 .4 Using Checkstyle
710
734
--------------------
711
735
712
736
To check that your code follows the standard coding conventions,
@@ -740,7 +764,7 @@ checkstyle under the lib directory):
740
764
741
765
$ ant checkstyle -Dcheckstyle.home=lib/checkstyle
742
766
743
- 8 .5 Using PMD and CPD
767
+ 9 .5 Using PMD and CPD
744
768
---------------------
745
769
746
770
To check the quality of the OpenGrok code you can also use PMD
@@ -784,7 +808,7 @@ Which will result in:
784
808
$ ls pmd
785
809
cpd_report.xml cpd_report.txt
786
810
787
- 8 .6 Using JDepend
811
+ 9 .6 Using JDepend
788
812
-----------------
789
813
790
814
To see dependencies in the source code, you can use JDepend from
@@ -807,7 +831,7 @@ Output is stored in the jdepend directory:
807
831
$ ls jdepend/
808
832
report.txt report.xml
809
833
810
- 8 .7 Using SonarQube
834
+ 9 .7 Using SonarQube
811
835
-------------------
812
836
813
837
Use a sonar runner with included sonar-project.properties properties,
@@ -820,15 +844,15 @@ e.g. using bash:
820
844
-Dsonar.host.url=http://${SERVERIP}:9000
821
845
-Dsonar.jdbc.url=jdbc:h2:tcp://${SERVERIP}:9092/sonar
822
846
823
- 8 .8 Using Travis CI
847
+ 9 .8 Using Travis CI
824
848
-------------------
825
849
826
850
Please see .travis.yml, if your branch has this file,
827
851
you should be able to connect your Github to Travis CI.
828
852
OpenGroks Travis is here: https://travis-ci.org/OpenGrok/OpenGrok
829
853
830
854
831
- 9 . Tuning OpenGrok for large code bases
855
+ 10 . Tuning OpenGrok for large code bases
832
856
---------------------------------------
833
857
834
858
While indexing big source repos you might consider using ZFS filesystem to give
@@ -886,7 +910,7 @@ the project list when requesting search results):
886
910
Refer to docs of other containers for more info on how to achieve the same.
887
911
888
912
889
- 10 . Authors
913
+ 11 . Authors
890
914
-----------
891
915
892
916
The project has been originally conceived in Sun Microsystems by Chandan B.N.
@@ -899,7 +923,7 @@ Knut Anders Hatlen, Oracle. http://blogs.oracle.com/kah/
899
923
Lubos Kosco, Oracle. http://blogs.oracle.com/taz/
900
924
Vladimir Kotal, Oracle. http://blogs.oracle.com/vlad/
901
925
902
- 11 . Contact us
926
+ 12 . Contact us
903
927
--------------
904
928
905
929
Feel free to participate in discussion on
[email protected] .
0 commit comments