Skip to content

Commit 7fca0e0

Browse files
committed
Merge with parent
2 parents 56a2e68 + 044f790 commit 7fca0e0

File tree

105 files changed

+6361
-1054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+6361
-1054
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ jdk:
33
- oraclejdk8
44
before_install:
55
- sudo apt-get update -qq
6-
- sudo apt-get install -qq exuberant-ctags cvs git mercurial cssc bzr subversion
6+
- sudo apt-get install -qq exuberant-ctags cvs git mercurial cssc bzr subversion monotone rcs
77

88
env:
99
global:

README.txt

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ called DATA_ROOT.
7070

7171
OpenGrok has a concept of Projects - one project is one directory underneath
7272
SRC_ROOT directory which usually contains a checkout of a project sources.
73-
(this can be branch, version, ...)
73+
(this can be branch, version, ...)
7474

7575
Projects effectively replace the need to have more web applications, each with
7676
opengrok .war file. Instead it leaves you with one indexer and one web
@@ -161,13 +161,13 @@ of the tasks. It has been tested on Solaris and Linux distributions.
161161
First please change to opengrok directory where the OpenGrok shell script is
162162
stored (can vary on your system).
163163

164-
Note that now you might need to change to user which owns the target
164+
Note that now you might need to change to user which owns the target
165165
directories for data, e.g. on Solaris you'd do:
166166

167167
# pfexec su - webservd
168168
$ cd /usr/opengrok/bin
169169

170-
and run
170+
and run
171171

172172
$ ./OpenGrok deploy
173173

@@ -232,14 +232,14 @@ E.g. if opengrok data directory is /tank/opengrok and source root is
232232
in /tank/source then to get more verbosity run the indexer as:
233233

234234
$ OPENGROK_VERBOSE=true OPENGROK_INSTANCE_BASE=/tank/opengrok \
235-
./OpenGrok index /tank/source
235+
./OpenGrok index /tank/source
236236

237237
Since above will also change default location of config file, beforehands(or
238238
restart your web container after creating this symlink) I suggest doing
239239
below for our case of having opengrok instance in /tank/opengrok :
240240

241241
$ ln -s /tank/opengrok/etc/configuration.xml \
242-
/var/opengrok/etc/configuration.xml
242+
/var/opengrok/etc/configuration.xml
243243

244244
More customizations can be found inside the script, you just need to
245245
have a look at it, eventually create a configuration out of it and use
@@ -316,7 +316,7 @@ service like this:
316316
opengrok/srcdir="/absolute/path/to/your/sourcetree"
317317
# svccfg -s opengrok setprop opengrok/maxmemory="2048"
318318

319-
Then make the service start the indexing, at this point it would be nice if
319+
Then make the service start the indexing, at this point it would be nice if
320320
the web application is already running.
321321

322322
Now enable the service:
@@ -326,7 +326,7 @@ Now enable the service:
326326
Note that this will enable tomcat6 service as dependency.
327327

328328
When the service starts indexing for first time, it's already enabled and
329-
depending on tomcat6, so at this point the web application should be
329+
depending on tomcat6, so at this point the web application should be
330330
already running.
331331

332332
Note that indexing is not done when the opengrok service is disabled.
@@ -424,13 +424,13 @@ file named source.war, you can change it as follows:
424424

425425
* Option 1: Unzip the file to TOMCAT/webapps/source/ directory and
426426
change the source/WEB-INF/web.xml and other static html files like
427-
index.html to customize to your project.
428-
427+
index.html to customize to your project.
428+
429429
* Option 2: Extract the web.xml file from source.war file
430430

431431
$ unzip source.war WEB-INF/web.xml
432432

433-
edit web.xml and re-package the jar file.
433+
edit web.xml and re-package the jar file.
434434

435435
$ zip -u source.war WEB-INF/web.xml
436436

@@ -440,8 +440,8 @@ file named source.war, you can change it as follows:
440440

441441
Copy source.war to TOMCAT/webapps
442442

443-
When invoking OpenGrok to build the index, use -w <webapp> to set the
444-
context. If you change this(or set using OPENGROK_WEBAPP_CONTEXT) later,
443+
When invoking OpenGrok to build the index, use -w <webapp> to set the
444+
context. If you change this(or set using OPENGROK_WEBAPP_CONTEXT) later,
445445
FULL clean reindex is needed.
446446

447447
After the index is built, there's a couple different ways to set the
@@ -516,25 +516,25 @@ Other:
516516
Solaris 11:
517517

518518
Use one of the following methods to start the database:
519-
519+
520520
a) via SMF (preferred):
521-
521+
522522
# svcadm enable javadb
523-
523+
524524
b) from command line:
525-
525+
526526
$ mkdir -p $DATA_ROOT/derby
527527
$ java -Dderby.system.home=$DATA_ROOT/derby \
528528
-jar /opt/SUNWjavadb/lib/derbynet.jar start
529-
529+
530530
Debian:
531531

532532
$ mkdir -p $DATA_ROOT/derby
533533
$ java -Dderby.system.home=$DATA_ROOT/derby \
534534
-jar /usr/lib/jvm/java-6-sun/db/lib/derbynet.jar start
535535

536536

537-
2) Copy derbyclient.jar to the lib directory
537+
2) Copy derbyclient.jar to the lib directory
538538

539539
The derbyclient.jar is provided with Java DB installation.
540540
The lib directory is the one where opengrok.jar is located.
@@ -583,8 +583,8 @@ the JavaDB data directory and add this line to it:
583583
OpenGrok script doesn't support this out of box, so you'd need to add it there.
584584
Usually to StdInvocation() function after line -jar ${OPENGROK_JAR} .
585585
It would look like this:
586-
-A cs:org.opensolaris.opengrok.analysis.PlainAnalayzer
587-
(this will map extension .cs to PlainAnalyzer)
586+
-A cs:org.opensolaris.opengrok.analysis.PlainAnalayzer
587+
(this will map extension .cs to PlainAnalyzer)
588588
You should even be able to override OpenGroks analyzers using this option.
589589

590590

@@ -640,7 +640,7 @@ Deploy the modified .war file in glassfish/Sun Java App Server:
640640
* Option 2: Copy the source.war file to
641641
GLASSFISH/domains/YOURDOMAIN/autodeploy directory, glassfish will try
642642
to deploy it "auto magically".
643-
643+
644644
* Option 3: Use cli from GLASSFISH directory:
645645

646646
# ./bin/asadmin deploy /path/to/source.war
@@ -697,11 +697,11 @@ being executed on) under the dist/ directory.
697697
9.1 Unit testing
698698
----------------
699699

700-
Note: For full coverage report your system has to provide proper junit test
700+
Note: For full coverage report your system has to provide proper junit test
701701
environment, that would mean:
702702

703703
- you have to use Ant 1.9 and above
704-
- at least junit-4.12.jar has to be in ant's classpath (e.g. in ./lib)
704+
- at least junit-4.12.jar has to be in ant's classpath (e.g. in ./lib)
705705

706706
- install derby.jar to ant's classpath so that Java DB tests can be run
707707
- your PATH must contain directory with exuberant ctags binary
@@ -722,7 +722,7 @@ occurences in the TESTS-TestSuites.xml file produced by the test run.
722722
------------------
723723

724724
If you want to run Findbugs (http://findbugs.sourceforge.net/) on OpenGrok,
725-
you have to download Findbugs to your machine, and install it where you have
725+
you have to download Findbugs to your machine, and install it where you have
726726
checked out your OpenGrok source code, under the lib/findbugs directory,
727727
like this:
728728

@@ -785,7 +785,7 @@ e.g. like this:
785785

786786
You also have to create symbolic links to the jar files:
787787

788-
$ cd checkstyle
788+
$ cd checkstyle
789789
$ ln -s checkstyle-6.8-all.jar checkstyle-all.jar
790790

791791
To run checkstyle on the source code, just run ant checkstyle:
@@ -796,7 +796,7 @@ Output from the command will be stored in the checkstyle directory.
796796

797797
If you want to install checkstyle some other place than ~/.ant/lib, you can
798798
untar the .tar.gz file to a directory, and use the checkstyle.home property
799-
to tell ant where to find checkstyle, like this (if you have installed
799+
to tell ant where to find checkstyle, like this (if you have installed
800800
checkstyle under the lib directory):
801801

802802
$ ant checkstyle -Dcheckstyle.home=lib/checkstyle
@@ -824,7 +824,7 @@ Output from the command will be stored in the pmd subdirectory:
824824

825825
If you want to install PMD some other place than ~/.ant/lib, you can
826826
unzip the .zip file to a directory, and use the pmd.home property
827-
to tell ant where to find PMD, like this (if you have installed
827+
to tell ant where to find PMD, like this (if you have installed
828828
PMD under the ./ext_lib directory):
829829

830830
$ ant pmd -Dpmd.home=ext_lib/pmd
@@ -864,14 +864,14 @@ Output is stored in the jdepend directory:
864864
9.7 Using SonarQube
865865
-------------------
866866

867-
Use a sonar runner with included sonar-project.properties properties,
867+
Use a sonar runner with included sonar-project.properties properties,
868868
e.g. using bash:
869869

870870
$ cd <checkout_dir> # it has to contain sonar-project.properties!
871871
$ export SONAR_RUNNER_OPTS="-Xmx768m -XX:MaxPermSize=256m"
872872
$ export SERVERIP=10.163.26.78
873873
$ ~//Projects/sonar-runner-2.3/bin/sonar-runner \
874-
-Dsonar.host.url=http://${SERVERIP}:9000
874+
-Dsonar.host.url=http://${SERVERIP}:9000
875875
-Dsonar.jdbc.url=jdbc:h2:tcp://${SERVERIP}:9092/sonar
876876

877877
9.8 Using Travis CI
@@ -886,26 +886,28 @@ OpenGroks Travis is here: https://travis-ci.org/OpenGrok/OpenGrok
886886
10. Tuning OpenGrok for large code bases
887887
---------------------------------------
888888

889-
While indexing big source repos you might consider using ZFS filesystem to give
889+
While indexing big source repos you might consider using ZFS filesystem to give
890890
you advantage of datasets which can be flipped over or cloned when needed.
891-
If the machine is strong enough it will also give you an option to
891+
If the machine is strong enough it will also give you an option to
892892
incrementally index in parallel to having the current sources and index in sync.
893-
(So tomcat sees certain zfs datasets, then you just stop it, flip datasets to
894-
the ones that were updated by SCM/index and start tomcat again - outage is
893+
(So tomcat sees certain zfs datasets, then you just stop it, flip datasets to
894+
the ones that were updated by SCM/index and start tomcat again - outage is
895895
minimal, sources+indexes are ALWAYS in sync, users see the truth)
896896

897-
OpenGrok script by default uses 2G of heap and 16MB per thread for flush size of
897+
OpenGrok script by default uses 2G of heap and 16MB per thread for flush size of
898898
lucene docs indexing(when to flush to disk).
899899
It also uses default 32bit JRE.
900900
This MIGHT NOT be enough. You might need to consider this:
901901
Lucene 4.x sets indexer defaults:
902+
902903
DEFAULT_RAM_PER_THREAD_HARD_LIMIT_MB = 1945;
903904
DEFAULT_MAX_THREAD_STATES = 8;
904-
DEFAULT_RAM_BUFFER_SIZE_MB = 16.0;
905+
DEFAULT_RAM_BUFFER_SIZE_MB = 16.0;
906+
905907
- which might grow as big as 16GB (though DEFAULT_RAM_BUFFER_SIZE_MB shouldn't
906908
really allow it, but keep it around 1-2GB)
907909

908-
- the lucenes RAM_BUFFER_SIZE_MB can be tuned now using the parameter -m, so
910+
- the lucenes RAM_BUFFER_SIZE_MB can be tuned now using the parameter -m, so
909911
running a 8GB 64 bit server JDK indexer with tuned docs flushing(on Solaris 11):
910912

911913
# export JAVA=/usr/java/bin/`isainfo -k`/java
@@ -914,7 +916,7 @@ running a 8GB 64 bit server JDK indexer with tuned docs flushing(on Solaris 11):
914916
# OPENGROK_FLUSH_RAM_BUFFER_SIZE="-m 256" ./OpenGrok index /source
915917

916918
Tomcat by default also supports only small deployments. For bigger ones you
917-
MIGHT need to increase its heap which might necessitate the switch to 64-bit
919+
MIGHT need to increase its heap which might necessitate the switch to 64-bit
918920
Java. It will most probably be the same for other containers as well.
919921
For tomcat you can easily get this done by creating conf/setenv.sh:
920922

@@ -931,7 +933,7 @@ For tomcat you can easily get this done by creating conf/setenv.sh:
931933
export JAVA_OPTS
932934

933935

934-
For tomcat you might also hit a limit for http header size (we use it to send
936+
For tomcat you might also hit a limit for http header size (we use it to send
935937
the project list when requesting search results):
936938
- increase(add) in conf/server.xml maxHttpHeaderSize
937939
connectionTimeout="20000"
@@ -946,8 +948,12 @@ The same tuning to Apache can be done with the LimitRequestLine directive:
946948
LimitRequestFieldSize 65536
947949

948950
Open File hard and soft limits
949-
The initial index creation process is resource intensive and often the error "java.io.IOException: error=24, Too many open files" appears in the logs. To avoid this increase the ulimit value to a higher number.
950-
It is noted that the hard and soft limit for open files of 10240 works for mid sized repositores and so the recommendation is to start with 10240.
951+
The initial index creation process is resource intensive and often the error
952+
"java.io.IOException: error=24, Too many open files" appears in the logs. To
953+
avoid this increase the ulimit value to a higher number.
954+
955+
It is noted that the hard and soft limit for open files of 10240 works for mid
956+
sized repositores and so the recommendation is to start with 10240.
951957

952958
11. Authors
953959
-----------
@@ -965,9 +971,10 @@ Vladimir Kotal, Oracle. http://blogs.oracle.com/vlad/
965971
12. Contact us
966972
--------------
967973

968-
Feel free to participate in discussion on [email protected].
974+
Feel free to participate in discussion on the mailing lists:
969975

970-
You can subscribe via web interface on:
976+
[email protected] (user topics)
977+
[email protected] (developers' discussion)
971978

972-
http://java.net/projects/opengrok/lists
979+
To subscribe, send email to <mailing_list_name>[email protected]
973980

build.xml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ information: Portions Copyright [yyyy] [name of copyright owner]
1818
1919
CDDL HEADER END
2020
21-
Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
21+
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
2222
2323
-->
2424
<project name="OpenGrok" default="jar" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
@@ -102,13 +102,15 @@ Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
102102

103103
<property name="test.repositories" value="testdata/repositories"/>
104104
<property name="test.sources" value="testdata/sources"/>
105+
<property name="test.plugins" value="testdata/plugins"/>
105106
<property name="test.cvs" value="${test.repositories}/cvs_test"/>
106107
<property name="test.cvs.repo" value="${test.cvs}/cvsrepo"/>
107108
<property name="test.cvs.root" value="${test.cvs}/cvsroot"/>
108109
<property name="test.hg" value="${test.repositories}/mercurial"/>
109110
<property name="test.git" value="${test.repositories}/git"/>
110111
<property name="test.svn" value="${test.repositories}/svn"/>
111112
<property name="test.razor" value="${test.repositories}/razor"/>
113+
<property name="test.plugins_jar" value="${test.plugins}/plugins.jar"/>
112114

113115
<property name="mvn.repository" value="http://repo1.maven.org/maven2"/>
114116

@@ -193,6 +195,8 @@ Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
193195
<run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/java/JavaXref.lex"/>
194196
<run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/javascript/JavaScriptSymbolTokenizer.lex"/>
195197
<run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/javascript/JavaScriptXref.lex"/>
198+
<run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/lua/LuaSymbolTokenizer.lex"/>
199+
<run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/lua/LuaXref.lex"/>
196200
<run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/python/PythonSymbolTokenizer.lex"/>
197201
<run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/python/PythonXref.lex"/>
198202
<run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/perl/PerlSymbolTokenizer.lex"/>
@@ -664,11 +668,29 @@ Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
664668
</not>
665669
</condition>
666670
</target>
671+
672+
<target name="check_plugins_jar" description="check if plugins.jar was generated">
673+
<available
674+
file="${build.test.classes.dir}/org/opensolaris/opengrok/authorization/plugins.jar"
675+
type="file" property="plugins_exists">
676+
</available>
677+
<condition property="plugins_missing">
678+
<not>
679+
<isset property="plugins_exists" />
680+
</not>
681+
</condition>
682+
</target>
667683

668-
<target depends="create_repos" name="-post-compile-test">
684+
<target depends="create_repos, create_plugins" name="-post-compile-test">
669685
</target>
670686

671-
<target depends="create_repos" name="-post-compile-test-single">
687+
<target depends="create_repos, create_plugins" name="-post-compile-test-single">
688+
</target>
689+
690+
<target depends="check_plugins_jar" name="create_plugins" if="plugins_missing">
691+
<copy
692+
file="${test.plugins_jar}"
693+
tofile="${build.test.classes.dir}/org/opensolaris/opengrok/authorization/plugins.jar" />
672694
</target>
673695

674696
<target depends="check_repositories_zip" name="create_repos" if="repos_missing">

0 commit comments

Comments
 (0)