Skip to content

Commit 46e5e56

Browse files
authored
Update RTS For DSpace 8.0 (#74)
* Update RTS For DSpace 8.0 * updated workflow actions, including Java 17 * get content store from configuration instead of only the primary store * fixed typo * lint fixes * catch exception from ReplicaManager during initialization * enforce DSpace checkstyle rules * dependency updates * changes from DSpace
1 parent ec570e1 commit 46e5e56

Some content is hidden

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

62 files changed

+1333
-1457
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ jobs:
1515
steps:
1616
# https://github.com/actions/checkout
1717
- name: Checkout codebase
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919

2020
# https://github.com/actions/setup-java
21-
- name: Install JDK 11
22-
uses: actions/setup-java@v2
21+
- name: Install JDK 17
22+
uses: actions/setup-java@v4
2323
with:
24-
distribution: zulu
25-
java-version: 11
24+
distribution: 'temurin'
25+
java-version: 17
26+
cache: 'maven'
2627

2728
# https://github.com/actions/cache
2829
- name: Cache Maven dependencies
29-
uses: actions/cache@v2
30+
uses: actions/cache@v4
3031
with:
3132
# Cache entire ~/.m2/repository
3233
path: ~/.m2/repository

checkstyle-suppressions.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Puppy Crawl//DTD Suppressions 1.2//EN"
4+
"http://checkstyle.sourceforge.net/dtds/suppressions_1_2.dtd">
5+
<suppressions>
6+
<!-- Temporarily suppress indentation checks for all Tests -->
7+
<!-- TODO: We should have these turned on. But, currently there's a known bug with indentation checks
8+
on JMockIt Expectations blocks and similar. See https://github.com/checkstyle/checkstyle/issues/3739 -->
9+
<suppress checks="Indentation" files="src[/\\]test[/\\]java"/>
10+
</suppressions>

checkstyle.xml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
5+
<!--
6+
DSpace CodeStyle Requirements
7+
8+
1. 4-space indents for Java, and 2-space indents for XML. NO TABS ALLOWED.
9+
2. K&R style braces required. Braces required on all blocks.
10+
3. Do not use wildcard imports (e.g. import java.util.*). Duplicated or unused imports also not allowed.
11+
4. Javadocs should exist for all public classes and methods. (Methods rule is unenforced at this time.) Keep it short and to the point
12+
5. Maximum line length is 120 characters (except for long URLs, packages or imports)
13+
6. No trailing spaces allowed (except in comments)
14+
7. Tokens should be surrounded by whitespace (see http://checkstyle.sourceforge.net/config_whitespace.html#WhitespaceAround)
15+
8. Each source file must include our license header (validated separately by license-maven-plugin, see pom.xml)
16+
17+
For more information on CheckStyle configurations below, see: http://checkstyle.sourceforge.net/checks.html
18+
-->
19+
<module name="Checker">
20+
<!-- Configure checker to use UTF-8 encoding -->
21+
<property name="charset" value="UTF-8"/>
22+
<!-- Configure checker to run on files with these extensions -->
23+
<property name="fileExtensions" value="java, properties, cfg, xml"/>
24+
25+
<!-- Suppression configurations in checkstyle-suppressions.xml in same directory -->
26+
<module name="SuppressionFilter">
27+
<property name="file" value="${checkstyle.suppressions.file}" default="checkstyle-suppressions.xml"/>
28+
</module>
29+
30+
<!-- No tab characters ('\t') allowed in the source code -->
31+
<module name="FileTabCharacter">
32+
<property name="eachLine" value="true"/>
33+
<property name="fileExtensions" value="java, properties, cfg, css, js, xml"/>
34+
</module>
35+
36+
<!-- No Trailing Whitespace, except on lines that only have an asterisk (e.g. Javadoc comments) -->
37+
<module name="RegexpSingleline">
38+
<property name="format" value="(?&lt;!\*)\s+$|\*\s\s+$"/>
39+
<property name="message" value="Line has trailing whitespace"/>
40+
<property name="fileExtensions" value="java, properties, cfg, css, js, xml"/>
41+
</module>
42+
43+
<!-- Allow individual lines of code to be excluded from these rules, if they are annotated
44+
with @SuppressWarnings. See also SuppressWarningsHolder below -->
45+
<module name="SuppressWarningsFilter" />
46+
47+
<!-- Maximum line length is 120 characters -->
48+
<module name="LineLength">
49+
<property name="fileExtensions" value="java"/>
50+
<property name="max" value="120"/>
51+
<!-- Only exceptions for packages, imports, URLs, and JavaDoc {@link} tags -->
52+
<property name="ignorePattern" value="^package.*|^import.*|http://|https://|@link"/>
53+
</module>
54+
55+
<!-- Check individual Java source files for specific rules -->
56+
<module name="TreeWalker">
57+
<!-- Highlight any TODO or FIXME comments in info messages -->
58+
<module name="TodoComment">
59+
<property name="severity" value="info"/>
60+
<property name="format" value="(TODO)|(FIXME)"/>
61+
</module>
62+
63+
<!-- Do not report errors on any lines annotated with @SuppressWarnings -->
64+
<module name="SuppressWarningsHolder"/>
65+
66+
<!-- ##### Import statement requirements ##### -->
67+
<!-- Star imports (e.g. import java.util.*) are NOT ALLOWED -->
68+
<module name="AvoidStarImport"/>
69+
<!-- Redundant import statements are NOT ALLOWED -->
70+
<module name="RedundantImport"/>
71+
<!-- Unused import statements are NOT ALLOWED -->
72+
<module name="UnusedImports"/>
73+
<!-- Ensure imports appear alphabetically and grouped -->
74+
<module name="CustomImportOrder">
75+
<property name="sortImportsInGroupAlphabetically" value="true"/>
76+
<property name="separateLineBetweenGroups" value="true"/>
77+
<property name="customImportOrderRules" value="STATIC###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE"/>
78+
</module>
79+
80+
<!-- ##### Javadocs requirements ##### -->
81+
<!-- Requirements for Javadocs for classes/interfaces -->
82+
<module name="JavadocType">
83+
<!-- All public classes/interfaces MUST HAVE Javadocs -->
84+
<property name="scope" value="public"/>
85+
<!-- Add an exception for anonymous inner classes -->
86+
<property name="excludeScope" value="anoninner"/>
87+
<!-- Ignore errors related to unknown tags -->
88+
<property name="allowUnknownTags" value="true"/>
89+
<!-- Allow params tags to be optional -->
90+
<property name="allowMissingParamTags" value="false"/>
91+
</module>
92+
<!-- Requirements for Javadocs for methods -->
93+
<module name="JavadocMethod">
94+
<!-- All public methods MUST HAVE Javadocs -->
95+
<property name="accessModifiers" value="public"/>
96+
<!-- Allow params, throws and return tags to be optional -->
97+
<property name="allowMissingParamTags" value="true"/>
98+
<property name="allowMissingReturnTag" value="true"/>
99+
</module>
100+
101+
<!-- ##### Requirements for K&R Style braces ##### -->
102+
<!-- Code blocks MUST HAVE braces, even single line statements (if, while, etc) -->
103+
<module name="NeedBraces"/>
104+
<!-- Left braces should be at the end of current line (default value)-->
105+
<module name="LeftCurly"/>
106+
<!-- Right braces should be on start of a new line (default value) -->
107+
<module name="RightCurly"/>
108+
109+
<!-- ##### Indentation / Whitespace requirements ##### -->
110+
<!-- Require 4-space indentation (default value) -->
111+
<module name="Indentation"/>
112+
<!-- Whitespace should exist around all major tokens -->
113+
<module name="WhitespaceAround">
114+
<!-- However, make an exception for empty constructors, methods, types, etc. -->
115+
<property name="allowEmptyConstructors" value="true"/>
116+
<property name="allowEmptyMethods" value="true"/>
117+
<property name="allowEmptyTypes" value="true"/>
118+
<property name="allowEmptyLoops" value="true"/>
119+
</module>
120+
<!-- Validate whitespace around Generics (angle brackets) per typical conventions
121+
http://checkstyle.sourceforge.net/config_whitespace.html#GenericWhitespace -->
122+
<module name="GenericWhitespace"/>
123+
124+
<!-- ##### Requirements for "switch" statements ##### -->
125+
<!-- "switch" statements MUST have a "default" clause -->
126+
<module name="MissingSwitchDefault"/>
127+
<!-- "case" clauses in switch statements MUST include break, return, throw or continue -->
128+
<module name="FallThrough"/>
129+
130+
<!-- ##### Other / Miscellaneous requirements ##### -->
131+
<!-- Require utility classes do not have a public constructor -->
132+
<module name="HideUtilityClassConstructor"/>
133+
<!-- Require each variable declaration is its own statement on its own line -->
134+
<module name="MultipleVariableDeclarations"/>
135+
<!-- Each line of code can only include one statement -->
136+
<module name="OneStatementPerLine"/>
137+
<!-- Require that "catch" statements are not empty (must at least contain a comment) -->
138+
<module name="EmptyCatchBlock"/>
139+
</module>
140+
</module>

config/modules/duracloud.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ duracloud.port = 443
2020
# http://demo.duracloud.org/[context]/[space-id]/[filename]
2121
duracloud.context = durastore
2222

23+
# DuraCloud Content Store ID
24+
duracloud.store-id = 0
25+
2326
# DuraCloud user name
2427
duracloud.username = rep-agent
2528
# DuraCloud password

0 commit comments

Comments
 (0)