Skip to content

Commit

Permalink
Fix Extended Wadl Example OSGi Test for JDK11 (eclipse-ee4j#4430)
Browse files Browse the repository at this point in the history
* Fix Extended Wadl Example OSGi Test for JDK11

Signed-off-by: Jan Supol <[email protected]>
  • Loading branch information
jansupol authored and Cousjava committed Sep 15, 2020
1 parent 9152429 commit 96aca09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
24 changes: 8 additions & 16 deletions examples/extended-wadl-webapp/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -235,24 +235,16 @@

<profiles>
<profile>
<id>testsSkipJdk11</id>
<id>testsJdk11</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Exclude unit tests on jdk 11 for now -->
<excludes>
<exclude>**/ExtendedWadlWebappOsgiTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>pre-release</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -36,6 +36,7 @@
import org.glassfish.jersey.examples.extendedwadl.resources.MyApplication;
import org.glassfish.jersey.examples.extendedwadl.util.Examples;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.internal.util.JdkVersion;
import org.glassfish.jersey.internal.util.PropertiesHelper;
import org.glassfish.jersey.internal.util.SimpleNamespaceResolver;
import org.glassfish.jersey.message.internal.MediaTypes;
Expand Down Expand Up @@ -129,6 +130,7 @@ public static Option[] configuration() {

//SUN JAXB IMPL OSGI
mavenBundle().groupId("com.sun.xml.bind").artifactId("jaxb-osgi").versionAsInProject().versionAsInProject(),
getActivationBundle(),
systemPackage("com.sun.source.tree"),
systemPackage("com.sun.source.util"),

Expand Down Expand Up @@ -180,6 +182,12 @@ public static Option[] configuration() {
return options.toArray(new Option[options.size()]);
}

private static Option getActivationBundle() {
return JdkVersion.getJdkVersion().getMajor() > 8
? mavenBundle().groupId("com.sun.activation").artifactId("jakarta.activation").versionAsInProject()
: null;
}

private ResourceConfig createResourceConfig() {
final ResourceConfig resourceConfig = new ResourceConfig(new MyApplication().getClasses());
resourceConfig.property(ServerProperties.WADL_GENERATOR_CONFIG, SampleWadlGeneratorConfig.class.getName());
Expand Down

0 comments on commit 96aca09

Please sign in to comment.