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

[ENTESB-9789]Support Running on Java 11/fabric8 #1177

Open
wants to merge 2 commits into
base: 3.0.11.redhat-7.x
Choose a base branch
from
Open
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
4 changes: 0 additions & 4 deletions components/fabric8-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
Expand Down
6 changes: 6 additions & 0 deletions components/fabric8-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@
<artifactId>mockwebserver</artifactId>
<version>${mockwebserver.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
13 changes: 9 additions & 4 deletions components/fabric8-karaf/fabric8-karaf-itests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<name>Fabric8 :: Karaf :: Tests</name>

<properties>
<karaf.version>4.0.7</karaf.version>
<karaf.version>4.2.2-SNAPSHOT</karaf.version>
<osgi.version>6.0.0</osgi.version>
<pax.exam.version>4.9.1</pax.exam.version>
<pax.exam.version>4.13.0-SNAPSHOT</pax.exam.version>
<servlet.api.version>3.1.0</servlet.api.version>
<validation.api.version>1.1.0.Final</validation.api.version>
</properties>
Expand Down Expand Up @@ -67,9 +67,8 @@

<dependency>
<groupId>org.apache.karaf.itests</groupId>
<artifactId>itests</artifactId>
<artifactId>common</artifactId>
<version>${karaf.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

Expand All @@ -93,6 +92,12 @@
<version>${pax.exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
<version>${pax.exam.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.ops4j.pax.exam</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;

Expand Down Expand Up @@ -69,7 +71,56 @@ public void testFabric8KarafChecks() throws Exception {

@Configuration
public Option[] config() throws URISyntaxException, MalformedURLException {
return new Option[] {
if (JavaVersionUtil.getMajorVersion() >= 9) {
return new Option[] {
karafDistributionConfiguration()
.frameworkUrl(getKarafMinimalUrl())
.name("Apache Karaf")
.unpackDirectory(new File("target/exam")),
configureSecurity()
.disableKarafMBeanServerBuilder(),
keepRuntimeFolder(),
editConfigurationFilePut(
"etc/system.properties",
"features.xml",
System.getProperty("features.xml")),
editConfigurationFileExtend(
"etc/org.ops4j.pax.url.mvn.cfg",
"org.ops4j.pax.url.mvn.repositories",
"file:"+System.getProperty("features.repo")+"@id=local@snapshots@releases"),
systemProperty("kubernetes.namespace").value("my-namespace"),
systemProperty("kubernetes.master").value("http://my.kube.master:8443"),
systemProperty("kubernetes.auth.tryKubeConfig").value("false"),
logLevel(LogLevelOption.LogLevel.INFO),
new VMOption("--add-exports=java.base/"
+ "org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
new VMOption("--patch-module"),
new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-"
+ System.getProperty("karaf.version", "4.2.2-SNAPSHOT") + ".jar"),
new VMOption("--patch-module"),
new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-"
+ System.getProperty("karaf.version", "4.2.2-SNAPSHOT") + ".jar"),
new VMOption("--add-opens"),
new VMOption("java.base/java.security=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.net=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.lang=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.util=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
new VMOption("-classpath"),
new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
};
} else {
return new Option[] {
karafDistributionConfiguration()
.frameworkUrl(getKarafMinimalUrl())
.name("Apache Karaf")
Expand All @@ -89,6 +140,7 @@ public Option[] config() throws URISyntaxException, MalformedURLException {
systemProperty("kubernetes.master").value("http://my.kube.master:8443"),
systemProperty("kubernetes.auth.tryKubeConfig").value("false"),
logLevel(LogLevelOption.LogLevel.INFO),
};
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
import org.ops4j.pax.exam.ProbeBuilder;
import org.ops4j.pax.exam.TestProbeBuilder;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.ops4j.pax.exam.util.Filter;
Expand Down Expand Up @@ -89,7 +91,60 @@ public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) {

@Configuration
public Option[] config() throws URISyntaxException, MalformedURLException {
return new Option[] {
if (JavaVersionUtil.getMajorVersion() >= 9) {
return new Option[] {
karafDistributionConfiguration()
.frameworkUrl(getKarafMinimalUrl())
.name("Apache Karaf")
.unpackDirectory(new File("target/exam")),
configureSecurity()
.disableKarafMBeanServerBuilder(),
keepRuntimeFolder(),
features(
getFeaturesUrl().toString(),
"fabric8-karaf-blueprint",
"fabric8-karaf-cm"),
editConfigurationFilePut(
"etc/system.properties",
"features.xml",
System.getProperty("features.xml")),
editConfigurationFileExtend(
"etc/org.ops4j.pax.url.mvn.cfg",
"org.ops4j.pax.url.mvn.repositories",
"file:"+System.getProperty("features.repo")+"@id=local@snapshots@releases"),
systemProperty("kubernetes.namespace").value("my-namespace"),
systemProperty("kubernetes.master").value("http://my.kube.master:8443"),
systemProperty("kubernetes.auth.tryKubeConfig").value("false"),
logLevel(LogLevelOption.LogLevel.INFO),
new VMOption("--add-exports=java.base/"
+ "org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
new VMOption("--patch-module"),
new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-"
+ System.getProperty("karaf.version", "4.2.2-SNAPSHOT") + ".jar"),
new VMOption("--patch-module"),
new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-"
+ System.getProperty("karaf.version", "4.2.2-SNAPSHOT") + ".jar"),
new VMOption("--add-opens"),
new VMOption("java.base/java.security=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.net=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.lang=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.util=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
new VMOption("-classpath"),
new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
};
} else {
return new Option[] {
karafDistributionConfiguration()
.frameworkUrl(getKarafMinimalUrl())
.name("Apache Karaf")
Expand All @@ -113,6 +168,7 @@ public Option[] config() throws URISyntaxException, MalformedURLException {
systemProperty("kubernetes.master").value("http://my.kube.master:8443"),
systemProperty("kubernetes.auth.tryKubeConfig").value("false"),
logLevel(LogLevelOption.LogLevel.INFO),
};
};
}
}
}
6 changes: 6 additions & 0 deletions components/hubot-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
<artifactId>mockwebserver</artifactId>
<version>${mockwebserver.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
6 changes: 6 additions & 0 deletions components/kubernetes-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@
<artifactId>mockwebserver</artifactId>
<version>${mockwebserver.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
1 change: 0 additions & 1 deletion components/letschat-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,4 @@
</plugins>

</build>

</project>
2 changes: 1 addition & 1 deletion components/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<module>fabric8-apm</module>
<module>fabric8-arquillian</module>
<module>fabric8-cxf</module>
<module>fabric8-cxf-plugins</module>
<!--<module>fabric8-cxf-plugins</module--><!--we should use the java2swagger plugin from CXF upstream-->
<!--<module>fabric8-cxf-registry</module>--> <!-- TODO: does not work yet -->
<module>fabric8-devops</module>
<module>fabric8-devops-connector</module>
Expand Down
1 change: 0 additions & 1 deletion components/taiga-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,4 @@
</plugins>

</build>

</project>
Loading