Skip to content

Commit

Permalink
Update to jdk11 build support
Browse files Browse the repository at this point in the history
  • Loading branch information
madushadhanushka committed Nov 9, 2022
1 parent d0a8cb7 commit fdb85d2
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 115 deletions.
8 changes: 6 additions & 2 deletions components/org.wso2.carbon.business.rules.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@
<groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.openjdk.nashorn</groupId>
<artifactId>nashorn-core</artifactId>
</dependency>
</dependencies>

<properties>
Expand Down Expand Up @@ -235,8 +239,8 @@
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.gson.JsonObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.StrSubstitutor;
import org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory;
import org.wso2.carbon.business.rules.core.bean.RuleTemplate;
import org.wso2.carbon.business.rules.core.bean.RuleTemplateProperty;
import org.wso2.carbon.business.rules.core.bean.Template;
Expand Down Expand Up @@ -466,8 +467,8 @@ public static String replaceRegex(String templateString, String regexPatternStri
* @throws TemplateManagerHelperException
*/
public static Map<String, String> getScriptGeneratedVariables(String script) throws RuleTemplateScriptException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("JavaScript");
NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
ScriptEngine engine = factory.getScriptEngine();
ScriptContext scriptContext = new SimpleScriptContext();
scriptContext.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
try {
Expand Down
4 changes: 4 additions & 0 deletions components/org.wso2.carbon.business.rules.web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
Expand Down
4 changes: 2 additions & 2 deletions components/org.wso2.carbon.data.provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
4 changes: 2 additions & 2 deletions components/org.wso2.carbon.health.check.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions components/org.wso2.carbon.siddhi.store.api.rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.when;

@PowerMockIgnore("jdk.internal.reflect.*")
@PrepareForTest(StreamProcessorDataHolder.class)
public class DBPersistenceStoreTest extends PowerMockTestCase {

Expand Down
26 changes: 26 additions & 0 deletions components/si-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,32 @@
<groupId>org.wso2.carbon.maven</groupId>
<artifactId>carbon-feature-plugin</artifactId>
<version>${carbon.feature.plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${com.sun.xml.bind.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${com.sun.xml.bind.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.wso2.orbit.javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${org.wso2.orbit.javax.xml.bind.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>${com.sun.activation.javax.activation.version}</version>
<type>jar</type>
</dependency>
</dependencies>
<executions>
<execution>
<id>p2-repo-generation</id>
Expand Down
26 changes: 26 additions & 0 deletions components/si-tooling-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,32 @@
<groupId>org.wso2.carbon.maven</groupId>
<artifactId>carbon-feature-plugin</artifactId>
<version>${carbon.feature.plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${com.sun.xml.bind.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${com.sun.xml.bind.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.wso2.orbit.javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${org.wso2.orbit.javax.xml.bind.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>${com.sun.activation.javax.activation.version}</version>
<type>jar</type>
</dependency>
</dependencies>
<executions>
<execution>
<id>p2-repo-generation</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/resources/);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/resources/businessRules/);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/resources/businessRules/templates/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../lib/features/org.wso2.carbon.business.rules.core_${feature.version}/templates/,target:${installFolder}/resources/businessRules/templates/,overwrite:true);\

This file was deleted.

This file was deleted.

28 changes: 28 additions & 0 deletions findbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,34 @@
<Class name="org.wso2.carbon.streaming.integrator.core.persistence.IncrementalFileSystemPersistenceStore" />
<Bug pattern="NP_NULL_PARAM_DEREF" />
</Match>
<Match>
<Class name="org.wso2.carbon.streaming.integrator.core.internal.asyncapi.ServiceCatalogueApiHelper"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>
<Match>
<Class name="org.wso2.carbon.streaming.integrator.core.persistence.DBPersistenceStore"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>
<Match>
<Class name="org.wso2.carbon.streaming.integrator.core.persistence.IncrementalDBPersistenceStore"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>
<Match>
<Class name="org.wso2.carbon.streaming.integrator.core.siddhi.error.handler.DBErrorStore"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>
<Match>
<Class name="org.wso2.carbon.event.simulator.core.internal.generator.database.util.DatabaseConnector"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>
<Match>
<Class name="org.wso2.carbon.event.simulator.core.internal.util.SimulationConfigUploader"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>
<Match>
<Class name="org.wso2.carbon.siddhi.editor.core.util.errorhandler.ErrorHandlerApiHelper"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>

<!--<Match>-->
<!--<Package name="~org\.wso2\.siddhi\.query\.api.*"/>-->
Expand Down
27 changes: 16 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2</groupId>
<artifactId>wso2</artifactId>
<version>5.1</version>
<version>5.3</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -100,14 +100,14 @@
<version>${maven.src.version}</version>
</plugin>
<plugin><!-- Overridden from parent pom to exclude generated sources -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration combine.self="override">
<effort>Max</effort>
<threshold>Low</threshold>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutputDirectory>${project.build.directory}/findbugs
</findbugsXmlOutputDirectory>
<spotbugsXmlOutputDirectory>${project.build.directory}/findbugs
</spotbugsXmlOutputDirectory>
<excludeFilterFile>${maven.findbugsplugin.version.exclude}</excludeFilterFile>
<!--Exclude generated sources-->
</configuration>
Expand Down Expand Up @@ -190,9 +190,9 @@
</configuration>
</plugin>
<plugin><!-- Overridden from parent pom to exclude generated sources -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${maven.findbugsplugin.version}</version>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${maven.spotbugsplugin.version}</version>
<configuration>
<effort>Max</effort>
<threshold>Medium</threshold>
Expand Down Expand Up @@ -1623,6 +1623,11 @@
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.openjdk.nashorn</groupId>
<artifactId>nashorn-core</artifactId>
<version>${openjdk.nashorn.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -1699,9 +1704,7 @@
<maven.build.helper.plugin.version>1.9.1</maven.build.helper.plugin.version>
<carbon.p2.plugin.version>1.5.4</carbon.p2.plugin.version>

<!-- TODO commented bcz running in Java8 -->
<!-- <carbon.feature.plugin.version>3.1.5</carbon.feature.plugin.version>-->
<carbon.feature.plugin.version>3.1.3</carbon.feature.plugin.version> <!-- TODO revert if running in Java11 -->
<carbon.feature.plugin.version>3.1.5</carbon.feature.plugin.version>

<testng.version>6.9.4</testng.version>
<plugin.version.antlr>4.7.2</plugin.version.antlr>
Expand Down Expand Up @@ -1902,5 +1905,7 @@

<xerces.version>2.12.2</xerces.version>
<maven.spotbugsplugin.version>3.1.10</maven.spotbugsplugin.version>
<openjdk.nashorn.version>15.2</openjdk.nashorn.version>
<maven.jar.plugin.version>3.2.2</maven.jar.plugin.version>
</properties>
</project>

0 comments on commit fdb85d2

Please sign in to comment.