Skip to content

Commit 4ce4e2b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into mavenize
# Conflicts: # opengrok-indexer/pom.xml # opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/executables/JavaClassAnalyzer.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/RuntimeEnvironment.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/AbortMessage.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/ConfigMessage.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/Message.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/Messages.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/NormalMessage.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/ProjectMessage.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/RefreshMessage.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/RepositoryMessage.java # opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/messages/StatsMessage.java # opengrok-indexer/src/main/java/org/opengrok/indexer/history/SCCSRepositoryAuthorParser.java # opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexDatabase.java # opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexVersion.java # opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java # opengrok-indexer/src/main/java/org/opengrok/indexer/util/XmlEofInputStream.java # opengrok-indexer/src/main/java/org/opengrok/indexer/util/XmlEofOutputStream.java # opengrok-indexer/src/main/java/org/opengrok/indexer/web/PageConfig.java # opengrok-indexer/src/main/java/org/opengrok/indexer/web/Util.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/RuntimeEnvironmentTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/AbortMessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/ConfigMessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/ExpirationNormalMessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/MessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/MessagesTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/NormalMessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/ProjectMessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/RefreshMessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/RepositoryMessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/messages/StatsMessageTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/util/XmlEofInputStreamTest.java # opengrok-indexer/src/test/java/org/opengrok/indexer/util/XmlEofOutputStreamTest.java # opengrok-web/src/main/java/org/opengrok/web/JSONSearchServlet.java # opengrok-web/src/main/webapp/WEB-INF/web.xml # opengrok-web/src/main/webapp/mast.jsp # opengrok-web/src/main/webapp/menu.jspf # opengrok-web/src/main/webapp/repos.jspf # src/org/opensolaris/opengrok/configuration/messages/AbortMessage.java # src/org/opensolaris/opengrok/configuration/messages/RefreshMessage.java # src/org/opensolaris/opengrok/web/api/v1/controller/SystemController.java # src/org/opensolaris/opengrok/web/constraints/ValidationExceptionMapper.java # test/org/opensolaris/opengrok/configuration/messages/RepositoryMessageTest.java # test/org/opensolaris/opengrok/web/api/v1/controller/RepositoriesControllerTest.java # tools/Messages
2 parents 9f434e9 + 050590f commit 4ce4e2b

File tree

90 files changed

+4135
-5715
lines changed

Some content is hidden

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

90 files changed

+4135
-5715
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ pmd.bat
5050
*.iml
5151
.idea
5252
*.pyc
53+
.wercker

OpenGrok

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Supported Environment Variables for configuring the default setup:
131131
- OPENGROK_SCAN_REPOS Disable Scan for repositories (*)
132132
- OPENGROK_SCAN_DEPTH How deep should scanning for repos go
133133
(by default 3 directories from SRC_ROOT)
134-
- OPENGROK_WEBAPP_CFGADDR Web app address to send configuration to
134+
- OPENGROK_WEBAPP_CFGADDR Web application URI to send configuration to
135135
(use "none" to avoid sending it to web app)
136136
- OPENGROK_WEBAPP_CONTEXT Context URL of the OpenGrok webapp
137137
(by default /source).
@@ -368,15 +368,14 @@ DefaultInstanceConfiguration()
368368
#SKIN='--style default'
369369

370370
# OPTIONAL: Configuration Address (host:port)
371-
# (conf/web.xml default is localhost:2424)
372371
WEBAPP_CONFIG=""
373372
if [ -n "${OPENGROK_WEBAPP_CFGADDR}" ]; then
374373
WEBAPP_CONFIG_ADDRESS=${OPENGROK_WEBAPP_CFGADDR}
375374
if [ "${OPENGROK_WEBAPP_CFGADDR}" = "none" ]; then
376375
WEBAPP_CONFIG_ADDRESS=""
377376
fi
378377
else
379-
WEBAPP_CONFIG_ADDRESS="localhost:2424"
378+
WEBAPP_CONFIG_ADDRESS="http://localhost:8080/source"
380379
fi
381380

382381
if [ -n "${WEBAPP_CONFIG_ADDRESS}" ]; then
@@ -450,6 +449,10 @@ ${BZR:+-Dorg.opengrok.indexer.history.Bazaar=$BZR} \
450449
ASSIGNMENTS="`echo $OPENGROK_ASSIGNMENTS | sed 's/[:space:]+/_/g'`"
451450
ASSIGNMENTS="-A `echo $ASSIGNMENTS | sed 's/,/ -A /g'`"
452451
fi
452+
453+
if [ -f "${XML_CONFIGURATION}" ]; then
454+
CHK_INDEX_CONF="${XML_CONFIGURATION}"
455+
fi
453456
}
454457

455458
#
@@ -858,21 +861,6 @@ CreateRuntimeRequirements()
858861
fi
859862
}
860863

861-
CheckIndexVersion()
862-
{
863-
if [ ! -f "${XML_CONFIGURATION}" ]
864-
then
865-
return
866-
fi
867-
if ! MinimalInvocation --checkIndexVersion \
868-
-R "${XML_CONFIGURATION}" -d "${DATA_ROOT}" "$@"
869-
then
870-
echo "\nIndex version check failed. You might want to remove all data" \
871-
"under the data root directory ${DATA_ROOT} and reindex.\n"
872-
exit 1
873-
fi
874-
}
875-
876864
MinimalInvocation()
877865
{
878866
${DO} ${JAVA} ${JAVA_OPTS} ${PROPERTIES} \
@@ -901,6 +889,7 @@ CommonInvocation()
901889
${ASSIGNMENTS} \
902890
${READ_XML_CONF} \
903891
${WEBAPP_CONFIG} \
892+
${CHK_INDEX_CONF:+--checkIndexVersion} ${CHK_INDEX_CONF} \
904893
${OPENGROK_PROFILER:+--profiler} \
905894
"${@}"
906895
}
@@ -1012,11 +1001,11 @@ DeployWar()
10121001
FatalError "Web Application Installation FAILED"
10131002
fi
10141003

1015-
# If user does not use default OPENGROK_INSTANCE_BASE or default
1016-
# WEBAPP_CONFIG_ADDRESS, then attempt to extract WEB-INF/web.xml from
1017-
# source.war using jar or zip utility, update the hardcoded values and
1018-
# then update source.war with the new WEB-INF/web.xml
1019-
if [ "${OPENGROK_INSTANCE_BASE}" != '/var/opengrok' ] || [ "${WEBAPP_CONFIG_ADDRESS}" != 'localhost:2424' ]
1004+
# If user does not use default OPENGROK_INSTANCE_BASE then attempt to
1005+
# extract WEB-INF/web.xml from source.war using jar or zip utility, update
1006+
# the hardcoded values and then update source.war with the new
1007+
# WEB-INF/web.xml.
1008+
if [ "${OPENGROK_INSTANCE_BASE}" != '/var/opengrok' ]
10201009
then
10211010
EXTRACT_COMMAND=""
10221011
COMPRESS_COMMAND=""
@@ -1042,14 +1031,6 @@ DeployWar()
10421031
mv "${warTarget}/WEB-INF/web.xml.tmp" \
10431032
"${warTarget}/WEB-INF/web.xml"
10441033
fi
1045-
if [ "${WEBAPP_CONFIG_ADDRESS}" != 'localhost:2424' ]
1046-
then
1047-
sed -e 's/localhost:2424/'"$WEBAPP_CONFIG_ADDRESS"'/g' \
1048-
"${warTarget}/WEB-INF/web.xml" \
1049-
> "${warTarget}/WEB-INF/web.xml.tmp"
1050-
mv "${warTarget}/WEB-INF/web.xml.tmp" \
1051-
"${warTarget}/WEB-INF/web.xml"
1052-
fi
10531034
eval "${COMPRESS_COMMAND} ${warTarget}/${FINAL_WAR_NAME}.war WEB-INF/web.xml"
10541035
rm -rf "${warTarget}/WEB-INF"
10551036
fi
@@ -1095,14 +1076,12 @@ case "${1}" in
10951076

10961077
update)
10971078
ValidateConfiguration
1098-
CheckIndexVersion
10991079
CreateRuntimeRequirements
11001080
UpdateGeneratedData && UpdateDescriptionCache
11011081
;;
11021082

11031083
updateQuietly)
11041084
ValidateConfiguration
1105-
CheckIndexVersion
11061085
CreateRuntimeRequirements
11071086
QUIET="-q"
11081087
VERBOSE=""
@@ -1129,7 +1108,6 @@ case "${1}" in
11291108
SRC_ROOT="${2}"
11301109
fi
11311110
ValidateConfiguration
1132-
CheckIndexVersion
11331111
CreateRuntimeRequirements
11341112
UpdateGeneratedData && UpdateDescriptionCache
11351113
;;
@@ -1144,7 +1122,6 @@ case "${1}" in
11441122
FatalError "need configuration via OPENGROK_READ_XML_CONFIGURATION"
11451123
fi
11461124
ValidateConfiguration
1147-
CheckIndexVersion $@
11481125
CreateRuntimeRequirements
11491126
UpdateDataPartial $@
11501127
;;

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ Each of these directories was created with `cvs checkout` command (with
8383
appropriate arguments to get given branch) and will be treated by OpenGrok
8484
as a project.
8585

86-
### 3.2 Messages
86+
### 3.2 Web services
8787

88-
See https://github.com/oracle/opengrok/wiki/Messages
88+
See https://github.com/oracle/opengrok/wiki/Web-services
8989

9090
## 4. OpenGrok install
9191

@@ -193,10 +193,8 @@ otherwise (if `SRC_ROOT` is in different directory) run:
193193

194194
The above command attempts to upload the latest index status reflected into
195195
`configuration.xml` to a running source web application.
196-
Once above command finishes without errors
197-
(e.g. `SEVERE: Failed to send configuration to localhost:2424`),
198-
you should be able to enjoy your OpenGrok and search your sources using
199-
latest indexes and setup.
196+
Once above command finishes without errors you should be able to enjoy your
197+
OpenGrok and search your sources using latest indexes and setup.
200198

201199
It is assumed that any SCM commands are reachable in one of the components
202200
of the PATH environment variable (e.g. `git` command for Git repositories).
@@ -261,8 +259,8 @@ It basically works like this:
261259
* this will create `/var/opengrok/etc/configuration.xml` with basic set of
262260
properties. If more is needed use:
263261

264-
```
265-
Messages -n config -t set "set propertyXY = valueFOO"
262+
```bash
263+
curl -d "${value}" -H "Content-Type: text/plain" -X PUT "${webapp_uri}/api/v1/configuration/${property}"
266264
```
267265

268266
2. add a new project **foo**:
@@ -275,8 +273,8 @@ It basically works like this:
275273
searchable. Store the config in a file so that indexer can see the project
276274
and its repositories:
277275
278-
```
279-
Messages -n config -t getconf > /var/opengrok/etc/configuration.xml
276+
```bash
277+
curl "${webapp_uri}/api/v1/configuration" > /var/opengrok/etc/configuration.xml
280278
```
281279
282280
3. index the project. It will become searchable after that.
@@ -289,11 +287,11 @@ It basically works like this:
289287
4. make the project `indexed` status of the project persistent so that if
290288
webapp is redeployed the project will be still visible:
291289
292-
```
293-
Messages -n config -t getconf > /var/opengrok/etc/configuration.xml
290+
```bash
291+
curl "${webapp_uri}/api/v1/configuration" > /var/opengrok/etc/configuration.xml
294292
```
295293

296-
If an *add* message is sent that matches existing project, the list of
294+
If an *add project* REST API call is invoked that matches existing project, the list of
297295
repositories for that project will be refreshed. This is handy when repositories
298296
are added/deleted.
299297

distribution/assembly.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
<outputDirectory>bin</outputDirectory>
6363
<includes>
6464
<include>ConfigMerge</include>
65-
<include>Messages</include>
6665
<include>Groups</include>
6766
</includes>
6867
</fileSet>

doc/EXAMPLE.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,6 @@ edit WEB-INF/web.xml and add the following section (next to all the other
149149
<param-value>/opengrok/configuration.xml</param-value>
150150
</context-param>
151151

152-
<context-param>
153-
<param-name>ConfigAddress</param-name>
154-
<param-value>localhost:2424</param-value>
155-
</context-param>
156-
157-
The last entry will let the web application listen on port 2424 for
158-
configuration updates. There is currently _no_ authentication implemented here,
159-
so you should not add an ip address reachable from an untrusted source.
160-
If you run the index generation on another server than the web server, you must
161-
add one of the external interfaces of the web server (but it should _NOT_ be
162-
reachable from external hosts).
163-
164152
You may also want to modify the file index_body.html before you re-create
165153
the jar-file with the following commands:
166154

opengrok-indexer/pom.xml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
3737

3838
<name>OpenGrok Indexer</name>
3939

40+
<properties>
41+
<jersey.version>2.27</jersey.version>
42+
</properties>
43+
4044
<dependencies>
4145
<dependency>
4246
<groupId>org.apache.bcel</groupId>
@@ -96,12 +100,58 @@ Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
96100
<groupId>org.apache.ant</groupId>
97101
<artifactId>ant</artifactId>
98102
</dependency>
103+
<dependency>
104+
<groupId>org.glassfish.jersey.containers</groupId>
105+
<artifactId>jersey-container-servlet</artifactId>
106+
<version>${jersey.version}</version>
107+
</dependency>
108+
<dependency>
109+
<groupId>org.glassfish.jersey.inject</groupId>
110+
<artifactId>jersey-hk2</artifactId>
111+
<version>${jersey.version}</version>
112+
</dependency>
113+
<dependency>
114+
<groupId>org.glassfish.jersey.media</groupId>
115+
<artifactId>jersey-media-json-jackson</artifactId>
116+
<version>${jersey.version}</version>
117+
</dependency>
118+
<dependency>
119+
<groupId>org.glassfish.jersey.ext</groupId>
120+
<artifactId>jersey-bean-validation</artifactId>
121+
<version>${jersey.version}</version>
122+
</dependency>
123+
<dependency>
124+
<groupId>javax.xml.bind</groupId>
125+
<artifactId>jaxb-api</artifactId>
126+
<version>2.3.0</version>
127+
</dependency>
128+
<dependency>
129+
<groupId>javax.activation</groupId>
130+
<artifactId>activation</artifactId>
131+
<version>1.1</version>
132+
</dependency>
99133
<dependency>
100134
<groupId>junit</groupId>
101135
<artifactId>junit</artifactId>
102136
<scope>test</scope>
103137
</dependency>
104-
138+
<dependency>
139+
<groupId>org.awaitility</groupId>
140+
<artifactId>awaitility</artifactId>
141+
<version>3.1.0</version>
142+
<scope>test</scope>
143+
</dependency>
144+
<dependency>
145+
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
146+
<artifactId>jersey-test-framework-provider-grizzly2</artifactId>
147+
<version>${jersey.version}</version>
148+
<scope>test</scope>
149+
</dependency>
150+
<dependency>
151+
<groupId>org.mockito</groupId>
152+
<artifactId>mockito-core</artifactId>
153+
<version>2.19.0</version>
154+
<scope>test</scope>
105155
</dependencies>
106156

107157
<build>

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/document/MandocException.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2017, Chris Fraire <[email protected]>.
21+
* Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2222
*/
2323
package org.opengrok.indexer.analysis.document;
2424

2525
/**
2626
* Represents an exception that occurs when mandoc exits non-zero.
2727
*/
2828
public class MandocException extends Exception {
29-
public MandocException() { super(); }
3029
public MandocException(String message) { super(message); }
31-
public MandocException(String message, Throwable cause) {
32-
super(message, cause);
33-
}
34-
public MandocException(Throwable cause) { super(cause); }
3530
}

0 commit comments

Comments
 (0)