Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 28596 use add-opens and set --illegal-access=deny in preparation for Java 21 #28619

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<jackson.version>2.16.1</jackson.version>
<jersey.version>2.22.1</jersey.version>
<graalvm.version>22.3.3</graalvm.version>
<dotcms.tika-api.version>2023.09.8</dotcms.tika-api.version>
</properties>
<dependencyManagement>

Expand Down Expand Up @@ -59,7 +58,7 @@
<dependency>
<groupId>com.dotcms.core.plugins</groupId>
<artifactId>com.dotcms.tika-api</artifactId>
<version>${dotcms.tika-api.version}</version>
<version>${project.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -799,7 +798,7 @@
<dependency>
<groupId>dnsjava</groupId>
<artifactId>dnsjava</artifactId>
<version>2.1.8</version>
<version>3.5.3</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -1505,7 +1504,12 @@
<artifactId>mockito-core</artifactId>
<version>5.11.0</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>5.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Hamcrest is a framework for writing matcher objects allowing 'match' rules to be defined declaratively. -->
<groupId>org.hamcrest</groupId>
Expand Down
3 changes: 0 additions & 3 deletions core-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

<properties>
<maven.deploy.skip>false</maven.deploy.skip>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.plugin.cargo.version>1.9.0</maven.plugin.cargo.version>
<cargo.tomcat.major.version>9</cargo.tomcat.major.version>
Expand Down
10 changes: 10 additions & 0 deletions dotCMS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,16 @@
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
Expand Down
146 changes: 0 additions & 146 deletions dotCMS/src/main/java/com/liferay/util/Randomizer.java

This file was deleted.

6 changes: 0 additions & 6 deletions dotCMS/src/main/java/com/liferay/util/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,6 @@ public static String merge(String array[], String delimiter) {
return sb.toString();
}

public static String randomize(String s) {
Randomizer r = new Randomizer();

return r.randomize(s);
}

public static String read(ClassLoader classLoader, String name)
throws IOException {
InputStream is=classLoader.getResourceAsStream(name);
Expand Down
30 changes: 25 additions & 5 deletions dotCMS/src/main/resources/container/tomcat9/bin/setenv.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
@echo off

set "CATALINA_OPTS=%CATALINA_OPTS% -Dfile.encoding=UTF8"
set "CATALINA_OPTS=%CATALINA_OPTS% --illegal-access=warn"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens=java.base/java.lang=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens=java.base/java.io=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --illegal-access=deny"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.lang=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.io=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.lang.ref=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.lang.reflect=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.net=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.nio=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.nio.charset=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.time=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.time.zone=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.util=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.util.concurrent=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/java.util.regex=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/javax.crypto.spec=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.management/javax.management=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/sun.nio.cs=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/sun.util.calendar=ALL-UNNAMED"
set "CATALINA_OPTS=%CATALINA_OPTS% --add-opens java.base/sun.util.locale=ALL-UNNAMED"

set "CATALINA_OPTS=%CATALINA_OPTS% -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"
set "CATALINA_OPTS=%CATALINA_OPTS% -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"
set "CATALINA_OPTS=%CATALINA_OPTS% -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"
set "CATALINA_OPTS=%CATALINA_OPTS% -Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource"
set "CATALINA_OPTS=%CATALINA_OPTS% -Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource"
28 changes: 24 additions & 4 deletions dotCMS/src/main/resources/container/tomcat9/bin/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
export CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding=UTF8"
export CATALINA_OPTS="$CATALINA_OPTS --illegal-access=warn"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens=java.base/java.lang=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens=java.base/java.io=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --illegal-access=deny"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.lang=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.io=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.lang.ref=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.lang.reflect=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.net=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.nio=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.nio.charset=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.time=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.time.zone=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.util=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.util.concurrent=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/java.util.regex=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/javax.crypto.spec=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.management/javax.management=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/sun.nio.cs=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/sun.util.calendar=ALL-UNNAMED"
export CATALINA_OPTS="$CATALINA_OPTS --add-opens java.base/sun.util.locale=ALL-UNNAMED"



export CATALINA_OPTS="$CATALINA_OPTS -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"
export CATALINA_OPTS="$CATALINA_OPTS -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"
export CATALINA_OPTS="$CATALINA_OPTS -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"
Expand Down
Loading
Loading