Skip to content

Commit

Permalink
Uptake Jakarta Dependencies: istack commons, GF, Copyright plugin & m…
Browse files Browse the repository at this point in the history
…imepull (#4002)

Signed-off-by: Jan Supol <jan.supol@oracle.com>
  • Loading branch information
jansupol authored and m0mus committed Dec 10, 2018
1 parent 7aebbcf commit 100db13
Show file tree
Hide file tree
Showing 50 changed files with 158 additions and 57 deletions.
1 change: 1 addition & 0 deletions bundles/jaxrs-ri/pom.xml
Expand Up @@ -281,6 +281,7 @@
javax.servlet.annotation.*;resolution:=optional;version="[2.4,5.0)",
javax.servlet.descriptor.*;resolution:=optional;version="[2.4,5.0)",
javax.servlet.*;version="[2.4,5.0)",
javax.annotation;version="!",
javax.persistence.*;resolution:=optional,
javax.validation.*;resolution:=optional;version="${range;[==,3);${javax.validation.api.version}}",
sun.misc.*;resolution:=optional,
Expand Down
2 changes: 1 addition & 1 deletion connectors/apache-connector/pom.xml
Expand Up @@ -66,7 +66,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion connectors/grizzly-connector/pom.xml
Expand Up @@ -63,7 +63,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion connectors/jdk-connector/pom.xml
Expand Up @@ -56,7 +56,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion connectors/jetty-connector/pom.xml
Expand Up @@ -71,7 +71,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion connectors/netty-connector/pom.xml
Expand Up @@ -60,7 +60,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
3 changes: 2 additions & 1 deletion containers/glassfish/jersey-gf-ejb/pom.xml
Expand Up @@ -97,7 +97,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand All @@ -114,6 +114,7 @@
<!-- Explicitly set versions for packages from GlassFish to allow future uptake of GlassFish 5.x-->
<Import-Package>
com.sun.*;version="[4.0,6)",
javax.annotation.*;version="!",
org.glassfish.ejb.*;version="[4.0,6)",
org.glassfish.internal.*;version="[4.0,6)",
*
Expand Down
2 changes: 1 addition & 1 deletion containers/grizzly2-http/pom.xml
Expand Up @@ -47,7 +47,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion containers/jdk-http/pom.xml
Expand Up @@ -44,7 +44,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>

Expand Down
2 changes: 1 addition & 1 deletion containers/jersey-servlet-core/pom.xml
Expand Up @@ -53,7 +53,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion containers/jersey-servlet/pom.xml
Expand Up @@ -61,7 +61,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion containers/jetty-http/pom.xml
Expand Up @@ -56,7 +56,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion containers/netty-http/pom.xml
Expand Up @@ -48,7 +48,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion containers/simple-http/pom.xml
Expand Up @@ -55,7 +55,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down
11 changes: 10 additions & 1 deletion core-client/pom.xml
Expand Up @@ -37,7 +37,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down Expand Up @@ -88,6 +88,15 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<instructions>
<Import-Package>
javax.annotation.*;version="!",
*
</Import-Package>
<unpackBundle>true</unpackBundle>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
4 changes: 3 additions & 1 deletion core-common/pom.xml
Expand Up @@ -95,7 +95,7 @@
</plugin>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down Expand Up @@ -126,6 +126,8 @@
<!-- Note: When you're changing these properties change them also in bundles/jaxrs-ri/pom.xml. -->
<Import-Package>
sun.misc.*;resolution:=optional,
javax.activation.*;version="!",
javax.annotation.*;version="!",
*
</Import-Package>
<Export-Package>org.glassfish.jersey.*;version=${project.version}</Export-Package>
Expand Down
Expand Up @@ -16,6 +16,9 @@

package org.glassfish.jersey.internal.l10n;

import java.util.Locale;
import java.util.ResourceBundle;

/**
* Localizable message.
*
Expand Down Expand Up @@ -54,4 +57,11 @@ public interface Localizable {
* @return the localization messages resource bundle name.
*/
public String getResourceBundleName();

/**
* Get the resource bundle of the given localization.
* @param locale the given {@code Locale}
* @return the localization messages resource bundle for given locale.
*/
public ResourceBundle getResourceBundle(Locale locale);
}
Expand Up @@ -16,17 +16,30 @@

package org.glassfish.jersey.internal.l10n;

import java.util.Arrays;
import java.util.Locale;
import java.util.ResourceBundle;

/**
* @author WS Development Team
*/
public final class LocalizableMessage implements Localizable {

private final String _bundlename;
private final LocalizableMessageFactory.ResourceBundleSupplier _rbSupplier;

private final String _key;
private final Object[] _args;

@Deprecated
public LocalizableMessage(String bundlename, String key, Object... args) {
this(bundlename, null, key, args);
}

public LocalizableMessage(String bundlename, LocalizableMessageFactory.ResourceBundleSupplier rbSupplier,
String key, Object... args) {
_bundlename = bundlename;
_rbSupplier = rbSupplier;
_key = key;
if (args == null) {
args = new Object[0];
Expand All @@ -41,11 +54,20 @@ public String getKey() {

@Override
public Object[] getArguments() {
return _args.clone();
return Arrays.copyOf(_args, _args.length);
}

@Override
public String getResourceBundleName() {
return _bundlename;
}
}

@Override
public ResourceBundle getResourceBundle(Locale locale) {
if (_rbSupplier == null) {
return null;
}

return _rbSupplier.getResourceBundle(locale);
}
}
Expand Up @@ -16,19 +16,39 @@

package org.glassfish.jersey.internal.l10n;

import java.util.Locale;
import java.util.ResourceBundle;

/**
* @author WS Development Team
*/
public class LocalizableMessageFactory {

private final String _bundlename;
private final ResourceBundleSupplier _rbSupplier;

@Deprecated
public LocalizableMessageFactory(String bundlename) {
_bundlename = bundlename;
_rbSupplier = null;
}

public LocalizableMessageFactory(String bundlename, ResourceBundleSupplier rbSupplier) {
_bundlename = bundlename;
_rbSupplier = rbSupplier;
}

public Localizable getMessage(String key, Object... args) {
return new LocalizableMessage(_bundlename, key, args);
return new LocalizableMessage(_bundlename, _rbSupplier, key, args);
}

public interface ResourceBundleSupplier {
/**
* Gets the ResourceBundle.
* @param locale the requested bundle's locale
* @return ResourceBundle
*/
ResourceBundle getResourceBundle(Locale locale);
}

}
Expand Up @@ -86,7 +86,12 @@ public String localize(Localizable l) {
alternateBundleName,
_locale);
} catch (MissingResourceException e2) {
// try OSGi
//try context classloader
try {
bundle = ResourceBundle.getBundle(bundlename, _locale,
Thread.currentThread().getContextClassLoader());
} catch (MissingResourceException e3) {
// try OSGi
OsgiRegistry osgiRegistry = ReflectionHelper.getOsgiRegistryInstance();
if (osgiRegistry != null) {
bundle = osgiRegistry.getResourceBundle(bundlename);
Expand All @@ -101,6 +106,7 @@ public String localize(Localizable l) {
}
}
}
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion core-server/pom.xml
Expand Up @@ -73,7 +73,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand All @@ -94,6 +94,7 @@
com.sun.research.ws.wadl.*;version=${project.version}
</Export-Package>
<Import-Package>
javax.annotation.*;version="!",
javax.validation.*;resolution:=optional;version="${range;[==,3);${javax.validation.api.version}}",
*
</Import-Package>
Expand Down
4 changes: 2 additions & 2 deletions examples/osgi-http-service/functional-test/pom.xml
Expand Up @@ -108,10 +108,10 @@

<!-- Grizzly dependencies-->
<dependency>
<groupId>com.sun.grizzly.osgi</groupId>
<groupId>org.glassfish.grizzly.osgi</groupId>
<artifactId>grizzly-httpservice-bundle</artifactId>
<scope>test</scope>
<version>1.9.45</version>
<version>${grizzly2.version}</version>
</dependency>


Expand Down
Expand Up @@ -141,7 +141,7 @@ public List<Option> genericOsgiOptions() {

public List<Option> grizzlyOptions() {
return Arrays.asList(options(
mavenBundle().groupId("com.sun.grizzly.osgi").artifactId("grizzly-httpservice-bundle").versionAsInProject()
mavenBundle().groupId("org.glassfish.grizzly.osgi").artifactId("grizzly-httpservice-bundle").versionAsInProject()
));
}

Expand Down
8 changes: 6 additions & 2 deletions ext/bean-validation/pom.xml
Expand Up @@ -37,7 +37,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand All @@ -54,7 +54,11 @@
<instructions>
<!-- Note: When you're changing these properties change them also in bundles/jax-rs-ri/bundle/pom.xml. -->
<Export-Package>org.glassfish.jersey.server.validation.*;version=${project.version}</Export-Package>
<Import-Package>javax.validation.*;resolution:=optional;version="${range;[==,3);${javax.validation.api.version}}", *</Import-Package>
<Import-Package>
javax.annotation.*;version="!",
javax.validation.*;resolution:=optional;version="${range;[==,3);${javax.validation.api.version}}",
*
</Import-Package>
</instructions>
<unpackBundle>true</unpackBundle>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion ext/cdi/jersey-cdi1x-servlet/pom.xml
Expand Up @@ -76,7 +76,7 @@
<plugins>
<plugin>
<groupId>com.sun.istack</groupId>
<artifactId>maven-istack-commons-plugin</artifactId>
<artifactId>istack-commons-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
<plugin>
Expand Down

0 comments on commit 100db13

Please sign in to comment.