killbill-aplcache
Merge branch 'osgi-felix-webconsole' into new-paymentpluginapi Signed-off-by: …
Changes
.gitignore 1(+1 -0)
.travis.yml 2(+1 -1)
beatrix/pom.xml 4(+4 -0)
bin/start-server 5(+3 -2)
entitlement/src/main/java/com/ning/billing/entitlement/engine/dao/RepairEntitlementDao.java 8(+8 -0)
jaxrs/pom.xml 1(+0 -1)
osgi/pom.xml 51(+4 -47)
osgi-bundles/defaultbundles/pom.xml 163(+163 -0)
osgi-bundles/defaultbundles/README.md 12(+12 -0)
osgi-bundles/jruby/pom.xml 4(+4 -0)
osgi-bundles/jruby/README.md 2(+1 -1)
osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyNotificationPlugin.java 6(+2 -4)
osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPaymentPlugin.java 5(+1 -4)
osgi-bundles/pom.xml 2(+2 -0)
osgi-bundles/webconsolebranding/pom.xml 49(+49 -0)
pom.xml 511(+334 -177)
server/pom.xml 92(+0 -92)
Details
.gitignore 1(+1 -0)
diff --git a/.gitignore b/.gitignore
index ba3098e..ed2d54b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,4 @@ logs/
catalog/src/test/resources/CatalogSchema.xsd
*/test-output/
beatrix/src/test/resources/killbill-osgi-bundles-test-*-jar-with-dependencies.jar
+server/load
.travis.yml 2(+1 -1)
diff --git a/.travis.yml b/.travis.yml
index 6a9f366..add54e4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ install: mvn install -DskipTests=true
notifications:
email:
- - ri-dev@ning.com
+ - killbilling-dev@googlegroups.com
jdk:
- openjdk6
beatrix/pom.xml 4(+4 -0)
diff --git a/beatrix/pom.xml b/beatrix/pom.xml
index fb512bd..ca722bc 100644
--- a/beatrix/pom.xml
+++ b/beatrix/pom.xml
@@ -81,6 +81,10 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.skife.config</groupId>
<artifactId>config-magic</artifactId>
</dependency>
bin/start-server 5(+3 -2)
diff --git a/bin/start-server b/bin/start-server
index ff9b090..e5b6582 100755
--- a/bin/start-server
+++ b/bin/start-server
@@ -28,7 +28,8 @@ PROPERTIES="$SERVER/src/main/resources/killbill-server.properties"
DEBUG_OPTS_ECLIPSE=" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345 "
DEBUG_OPTS_ECLIPSE_WAIT=" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=12345 "
-OPTS_ECLIPSE=" -Xmx2048m -XX:+UseConcMarkSweepGC -XX:MaxPermSize=128m "
+# Default JVM settings if unset
+MAVEN_OPTS=${MAVEN_OPTS-"-Xms512m -Xmx1024m -XX:MaxPermSize=512m -XX:MaxDirectMemorySize=512m -XX:+UseConcMarkSweepGC"}
LOG="$SERVER/src/main/resources/logback.xml"
@@ -72,7 +73,7 @@ function start() {
debug_opts_eclipse=$DEBUG_OPTS_ECLIPSE
fi
fi
- export MAVEN_OPTS=" -Duser.timezone=UTC $OPTS_ECLIPSE $debug_opts_eclipse"
+ export MAVEN_OPTS="$MAVEN_OPTS -Duser.timezone=UTC $debug_opts_eclipse"
echo "Starting IRS MAVEN_OPTS = $MAVEN_OPTS"
echo "$start_cmd"
diff --git a/entitlement/src/main/java/com/ning/billing/entitlement/engine/dao/RepairEntitlementDao.java b/entitlement/src/main/java/com/ning/billing/entitlement/engine/dao/RepairEntitlementDao.java
index 2d1b530..45a9831 100644
--- a/entitlement/src/main/java/com/ning/billing/entitlement/engine/dao/RepairEntitlementDao.java
+++ b/entitlement/src/main/java/com/ning/billing/entitlement/engine/dao/RepairEntitlementDao.java
@@ -93,6 +93,14 @@ public class RepairEntitlementDao implements EntitlementDao, RepairEntitlementLi
this.events = new TreeSet<EntitlementEventWithOrderingId>(new Comparator<EntitlementEventWithOrderingId>() {
@Override
public int compare(final EntitlementEventWithOrderingId o1, final EntitlementEventWithOrderingId o2) {
+ // Work around jdk7 change: compare(o1, o1) is now invoked when inserting the first element
+ // See:
+ // - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5045147
+ // - http://hg.openjdk.java.net/jdk7/tl/jdk/rev/bf37edb38fbb
+ if (o1 == o2) {
+ return 0;
+ }
+
final int result = o1.getEvent().getEffectiveDate().compareTo(o2.getEvent().getEffectiveDate());
if (result == 0) {
if (o1.getOrderingId() < o2.getOrderingId()) {
jaxrs/pom.xml 1(+0 -1)
diff --git a/jaxrs/pom.xml b/jaxrs/pom.xml
index 653899c..f3bfabb 100644
--- a/jaxrs/pom.xml
+++ b/jaxrs/pom.xml
@@ -35,7 +35,6 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
osgi/pom.xml 51(+4 -47)
diff --git a/osgi/pom.xml b/osgi/pom.xml
index e9386f8..67db67c 100644
--- a/osgi/pom.xml
+++ b/osgi/pom.xml
@@ -15,7 +15,8 @@
~ under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ning.billing</groupId>
@@ -33,55 +34,16 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.configadmin</artifactId>
- <version>1.6.0</version>
+ <artifactId>org.apache.felix.fileinstall</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
- <version>1.0.1</version>
- </dependency>
-
- <!-- TODO PIERRE Dependencies for the Felix Web Console.
- In 4.0.1-SNAPSHOT, these are provided by the bundle,
- see https://issues.apache.org/jira/browse/FELIX-3778.
- -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.webconsole</artifactId>
- <version>4.0.0</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2.1</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20070829</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.shell</artifactId>
- <version>1.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.service.obr</artifactId>
- <version>1.0.2</version>
+ <artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
- <version>4.3.1</version>
</dependency>
-
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -115,11 +77,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <!-- Default Bundles -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>osgi-over-slf4j</artifactId>
- </dependency>
<!-- TEST SCOPE -->
<dependency>
<groupId>org.slf4j</groupId>
diff --git a/osgi/src/main/java/com/ning/billing/osgi/DefaultOSGIService.java b/osgi/src/main/java/com/ning/billing/osgi/DefaultOSGIService.java
index bacfd2d..2f2fc65 100644
--- a/osgi/src/main/java/com/ning/billing/osgi/DefaultOSGIService.java
+++ b/osgi/src/main/java/com/ning/billing/osgi/DefaultOSGIService.java
@@ -24,19 +24,16 @@ import java.util.Map;
import javax.inject.Inject;
-import org.apache.felix.cm.impl.ConfigurationManager;
+import org.apache.felix.fileinstall.internal.FileInstall;
import org.apache.felix.framework.Felix;
import org.apache.felix.framework.util.FelixConstants;
-import org.apache.felix.webconsole.internal.OsgiManagerActivator;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
import org.osgi.framework.launch.Framework;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.slf4j.osgi.logservice.impl.Activator;
import com.ning.billing.lifecycle.LifecycleHandlerType;
import com.ning.billing.lifecycle.LifecycleHandlerType.LifecycleLevel;
@@ -47,7 +44,6 @@ import com.ning.billing.osgi.api.config.PluginRubyConfig;
import com.ning.billing.osgi.pluginconf.DefaultPluginConfigServiceApi;
import com.ning.billing.osgi.pluginconf.PluginConfigException;
import com.ning.billing.osgi.pluginconf.PluginFinder;
-import com.ning.billing.payment.plugin.api.PaymentPluginApi;
import com.ning.billing.util.config.OSGIConfig;
import com.google.common.collect.ImmutableList;
@@ -64,8 +60,6 @@ public class DefaultOSGIService implements OSGIService {
private final KillbillActivator killbillActivator;
private Framework framework;
- private volatile ServiceReference[] paymentApiReferences;
- private Map<String, PaymentPluginApi> paymentPluginApis;
@Inject
public DefaultOSGIService(final OSGIConfig osgiConfig, final PluginFinder pluginFinder,
@@ -129,6 +123,8 @@ public class DefaultOSGIService implements OSGIService {
final BundleContext context = framework.getBundleContext();
// Install all bundles and create service mapping
+ // TODO PIERRE Could we leverage Felix fileinstall plugin to manage Killbill plugins?
+
final List<Bundle> installedBundles = new LinkedList<Bundle>();
installAllJavaBundles(context, installedBundles);
installAllJRubyBundles(context, installedBundles);
@@ -182,19 +178,12 @@ public class DefaultOSGIService implements OSGIService {
final Map<Object, Object> felixConfig = new HashMap<Object, Object>();
felixConfig.putAll(config);
- // Install default bundles
- // TODO PIERRE Should the Felix Web Console (and its dependencies) be rather installed at deploy time?
+ // Install default bundles in the Framework: Killbill bundle and Felix fileinstall bundle
+ // Note! Think twice before adding a bundle here as it will run inside the System bundle. This means the bundle
+ // context that the bundle will see is the System bundle one, which will break e.g. resources lookup
felixConfig.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
- ImmutableList.<BundleActivator>of(killbillActivator,
- // SLF4J LogService
- new Activator(),
- // Felix Web Console
- new OsgiManagerActivator(),
- // Felix Log Service (installed for the Web Console)
- // TODO PIERRE Does it conflict with the SLF4J one?
- new org.apache.felix.log.Activator(),
- // Felix Configuration Admin Service (installed for the Web Console)
- new ConfigurationManager()));
+ ImmutableList.<BundleActivator>of(new FileInstall(),
+ killbillActivator));
final Framework felix = new Felix(felixConfig);
felix.init();
diff --git a/osgi/src/main/java/com/ning/billing/osgi/http/DefaultServletRouter.java b/osgi/src/main/java/com/ning/billing/osgi/http/DefaultServletRouter.java
index 8196e1b..e822259 100644
--- a/osgi/src/main/java/com/ning/billing/osgi/http/DefaultServletRouter.java
+++ b/osgi/src/main/java/com/ning/billing/osgi/http/DefaultServletRouter.java
@@ -34,11 +34,18 @@ public class DefaultServletRouter implements OSGIServiceRegistration<Servlet> {
private static final Logger logger = LoggerFactory.getLogger(DefaultServletRouter.class);
// Internal Servlet routing table: map of plugin prefixes to servlet instances.
- // A plugin prefix can be foo, foo/bar, foo/bar/baz, ... and is mounted on /plugins/<pluginPrefix>
+ // A plugin prefix can be /foo, /foo/bar, /foo/bar/baz, ... and is mounted on /plugins/<pluginPrefix>
private final Map<String, Servlet> pluginServlets = new ConcurrentHashMap<String, Servlet>();
@Override
- public void registerService(final String pathPrefix, final Servlet httpServlet) {
+ public void registerService(final String originalPathPrefix, final Servlet httpServlet) {
+ // Enforce each route to start with /
+ final String pathPrefix;
+ if (originalPathPrefix.charAt(0) != '/') {
+ pathPrefix = "/" + originalPathPrefix;
+ } else {
+ pathPrefix = originalPathPrefix;
+ }
logger.info("Registering OSGI servlet at " + pathPrefix);
pluginServlets.put(pathPrefix, httpServlet);
}
diff --git a/osgi/src/main/java/com/ning/billing/osgi/KillbillActivator.java b/osgi/src/main/java/com/ning/billing/osgi/KillbillActivator.java
index 51b84d6..79f082b 100644
--- a/osgi/src/main/java/com/ning/billing/osgi/KillbillActivator.java
+++ b/osgi/src/main/java/com/ning/billing/osgi/KillbillActivator.java
@@ -85,39 +85,32 @@ public class KillbillActivator implements BundleActivator, ServiceListener {
}
}
- private <T> boolean listenForServiceType(final ServiceEvent event, Class<T> claz, final OSGIServiceRegistration<T> registation) {
-
- // Is that for us ?
- final String[] objectClass = (String[]) event.getServiceReference().getProperty("objectClass");
- if (objectClass == null || objectClass.length == 0 || !claz.getName().equals(objectClass[0])) {
- return false;
- }
-
+ private <T> boolean listenForServiceType(final ServiceEvent event, final Class<T> claz, final OSGIServiceRegistration<T> registration) {
// Make sure we can retrieve the plugin name
final ServiceReference serviceReference = event.getServiceReference();
final String pluginName = (String) serviceReference.getProperty(OSGIPluginProperties.PLUGIN_NAME_PROP);
if (pluginName == null) {
- // STEPH logger ?
+ // TODO STEPH logger ?
return true;
}
final T theService = (T) context.getService(serviceReference);
- if (theService == null) {
- return true;
+ // Is that for us? We look for a subclass here for greater flexibility (e.g. HttpServlet for a Servlet service)
+ if (theService == null || !claz.isAssignableFrom(theService.getClass())) {
+ return false;
}
switch (event.getType()) {
case ServiceEvent.REGISTERED:
- registation.registerService(pluginName, theService);
-
+ registration.registerService(pluginName, theService);
break;
case ServiceEvent.UNREGISTERING:
- registation.unregisterService(pluginName);
+ registration.unregisterService(pluginName);
break;
-
default:
break;
}
+
return true;
}
osgi-bundles/defaultbundles/pom.xml 163(+163 -0)
diff --git a/osgi-bundles/defaultbundles/pom.xml b/osgi-bundles/defaultbundles/pom.xml
new file mode 100644
index 0000000..358925e
--- /dev/null
+++ b/osgi-bundles/defaultbundles/pom.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2010-2013 Ning, Inc.
+ ~
+ ~ Ning licenses this file to you under the Apache License, version 2.0
+ ~ (the "License"); you may not use this file except in compliance with the
+ ~ License. You may obtain a copy of the License at:
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ ~ License for the specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.ning.billing</groupId>
+ <artifactId>killbill-osgi-bundles</artifactId>
+ <version>0.1.54-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>killbill-osgi-bundles-defaultbundles</artifactId>
+ <name>Killbill billing platform: OSGI default bundles</name>
+ <packaging>pom</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>com.ning.billing</groupId>
+ <artifactId>killbill-osgi-bundles-webconsolebranding</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.bundlerepository</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.configadmin</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.dependencymanager</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.dependencymanager.annotation</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.dependencymanager.compat</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.dependencymanager.runtime</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.dependencymanager.shell</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.deploymentadmin</artifactId>
+ <version>0.9.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.gogo.runtime</artifactId>
+ <version>0.10.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.log</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.metatype</artifactId>
+ <version>1.0.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr</artifactId>
+ <version>1.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.ds-annotations</artifactId>
+ <version>1.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.shell</artifactId>
+ <version>1.4.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.shell.remote</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <!--
+ TODO PIERRE Update to 4.0.1 or above when released.
+ 4.0.0 is missing various dependencies, see https://issues.apache.org/jira/browse/FELIX-3778
+ See also https://issues.apache.org/jira/browse/FELIX-3666
+ -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.webconsole</artifactId>
+ <version>3.1.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>osgi-over-slf4j</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <!-- Hack to avoid generating jar and test-jar artifacts -->
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ <descriptors>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
osgi-bundles/defaultbundles/README.md 12(+12 -0)
diff --git a/osgi-bundles/defaultbundles/README.md b/osgi-bundles/defaultbundles/README.md
new file mode 100644
index 0000000..c2d1faa
--- /dev/null
+++ b/osgi-bundles/defaultbundles/README.md
@@ -0,0 +1,12 @@
+Killbill default OSGI bundles
+-----------------------------
+
+This module is simply used as a build utility. It produces a .tar.gz
+artifact containing various useful OSGI bundles one may want to have
+available by default.
+
+For example, to install these default bundles with the start-server script, unpack
+the .tar.gz artifact under the *server/load* directory.
+
+Killbill uses the Felix fileinstall bundle to detect bundles to install, see [here](http://felix.apache.org/documentation/subprojects/apache-felix-file-install.html)
+for more information.
\ No newline at end of file
diff --git a/osgi-bundles/defaultbundles/src/main/assembly/assembly.xml b/osgi-bundles/defaultbundles/src/main/assembly/assembly.xml
new file mode 100644
index 0000000..5913e1a
--- /dev/null
+++ b/osgi-bundles/defaultbundles/src/main/assembly/assembly.xml
@@ -0,0 +1,18 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>jar-with-dependencies</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <useProjectArtifact>false</useProjectArtifact>
+ <useProjectAttachments>true</useProjectAttachments>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <unpack>false</unpack>
+ </dependencySet>
+ </dependencySets>
+</assembly>
osgi-bundles/jruby/pom.xml 4(+4 -0)
diff --git a/osgi-bundles/jruby/pom.xml b/osgi-bundles/jruby/pom.xml
index 12ba371..a5a02e5 100644
--- a/osgi-bundles/jruby/pom.xml
+++ b/osgi-bundles/jruby/pom.xml
@@ -49,6 +49,10 @@
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>osgi-over-slf4j</artifactId>
</dependency>
osgi-bundles/jruby/README.md 2(+1 -1)
diff --git a/osgi-bundles/jruby/README.md b/osgi-bundles/jruby/README.md
index f1f240d..d550a73 100644
--- a/osgi-bundles/jruby/README.md
+++ b/osgi-bundles/jruby/README.md
@@ -3,7 +3,7 @@ Testing the JRuby OSGI bridge
1. Build the jruby OSGI module and copy the bundle to:
- /var/tmp/killbill-osgi-bundles-jruby-*-jar-with-dependencies.jar
+ /var/tmp/killbill-osgi-bundles-jruby.jar
2. Build a ruby plugin, e.g. killbill-paypal-express:
diff --git a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/Activator.java b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/Activator.java
index f2e4e92..78d4cde 100644
--- a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/Activator.java
+++ b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/Activator.java
@@ -36,15 +36,16 @@ import com.ning.billing.osgi.api.config.PluginRubyConfig;
public class Activator implements BundleActivator {
private final List<ServiceReference<?>> serviceReferences = new ArrayList<ServiceReference<?>>();
+ private final Logger logger = new Logger();
private OSGIKillbill osgiKillbill;
- private LogService logger = null;
private JRubyPlugin plugin = null;
public void start(final BundleContext context) throws Exception {
- logger = retrieveApi(context, LogService.class);
+ logger.start(context);
+
osgiKillbill = retrieveApi(context, OSGIKillbill.class);
- log(LogService.LOG_INFO, "JRuby bundle activated");
+ logger.log(LogService.LOG_INFO, "JRuby bundle activated");
doMagicToMakeJRubyAndFelixHappy();
@@ -66,7 +67,7 @@ public class Activator implements BundleActivator {
killbillServices.put("logger", logger);
plugin.instantiatePlugin(killbillServices);
- log(LogService.LOG_INFO, "Starting JRuby plugin " + plugin.getPluginMainClass());
+ logger.log(LogService.LOG_INFO, "Starting JRuby plugin " + plugin.getPluginMainClass());
plugin.startPlugin(context);
}
@@ -92,12 +93,14 @@ public class Activator implements BundleActivator {
}
public void stop(final BundleContext context) throws Exception {
- log(LogService.LOG_INFO, "Stopping JRuby plugin " + plugin.getPluginMainClass());
+ logger.log(LogService.LOG_INFO, "Stopping JRuby plugin " + plugin.getPluginMainClass());
plugin.stopPlugin(context);
for (final ServiceReference apiReference : serviceReferences) {
context.ungetService(apiReference);
}
+
+ logger.close();
}
private Map<String, Object> retrieveKillbillApis(final BundleContext context) {
@@ -146,10 +149,4 @@ public class Activator implements BundleActivator {
return null;
}
}
-
- private void log(final int level, final String message) {
- if (logger != null) {
- logger.log(level, message);
- }
- }
}
diff --git a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyNotificationPlugin.java b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyNotificationPlugin.java
index 3887a80..134e4b5 100644
--- a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyNotificationPlugin.java
+++ b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyNotificationPlugin.java
@@ -16,8 +16,6 @@
package com.ning.billing.osgi.bundles.jruby;
-import javax.annotation.Nullable;
-
import org.jruby.embed.ScriptingContainer;
import org.jruby.javasupport.JavaEmbedUtils;
import org.osgi.framework.BundleContext;
@@ -33,7 +31,7 @@ import com.google.common.eventbus.Subscribe;
public class JRubyNotificationPlugin extends JRubyPlugin {
public JRubyNotificationPlugin(final PluginRubyConfig config, final ScriptingContainer container,
- final BundleContext bundleContext, @Nullable final LogService logger) {
+ final BundleContext bundleContext, final Logger logger) {
super(config, container, bundleContext, logger);
}
@@ -47,7 +45,7 @@ public class JRubyNotificationPlugin extends JRubyPlugin {
final ExternalBus externalBus = context.getService(externalBusReference);
externalBus.register(this);
} catch (Exception e) {
- log(LogService.LOG_WARNING, "Error registering notification plugin service", e);
+ logger.log(LogService.LOG_WARNING, "Error registering notification plugin service", e);
} finally {
if (externalBusReference != null) {
context.ungetService(externalBusReference);
diff --git a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPaymentPlugin.java b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPaymentPlugin.java
index 3002635..01dbf38 100644
--- a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPaymentPlugin.java
+++ b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPaymentPlugin.java
@@ -22,14 +22,11 @@ import java.util.Hashtable;
import java.util.List;
import java.util.UUID;
-import javax.annotation.Nullable;
-
import org.jruby.Ruby;
import org.jruby.embed.ScriptingContainer;
import org.jruby.javasupport.JavaEmbedUtils;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
import com.ning.billing.osgi.api.config.PluginRubyConfig;
import com.ning.billing.payment.api.PaymentMethodPlugin;
@@ -46,7 +43,7 @@ public class JRubyPaymentPlugin extends JRubyPlugin implements PaymentPluginApi
private volatile ServiceRegistration<PaymentPluginApi> paymentInfoPluginRegistration;
public JRubyPaymentPlugin(final PluginRubyConfig config, final ScriptingContainer container,
- final BundleContext bundleContext, @Nullable final LogService logger) {
+ final BundleContext bundleContext, final Logger logger) {
super(config, container, bundleContext, logger);
}
diff --git a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPlugin.java b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPlugin.java
index 562b2ea..4aaa263 100644
--- a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPlugin.java
+++ b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/JRubyPlugin.java
@@ -20,7 +20,6 @@ import java.util.Arrays;
import java.util.Hashtable;
import java.util.Map;
-import javax.annotation.Nullable;
import javax.servlet.http.HttpServlet;
import org.jruby.Ruby;
@@ -46,7 +45,7 @@ public abstract class JRubyPlugin {
private static final String KILLBILL_SERVICES = "java_apis";
private static final String ACTIVE = "@active";
- protected final LogService logger;
+ protected final Logger logger;
protected final BundleContext bundleContext;
protected final String pluginGemName;
protected final String rubyRequire;
@@ -60,7 +59,7 @@ public abstract class JRubyPlugin {
private String cachedRequireLine = null;
public JRubyPlugin(final PluginRubyConfig config, final ScriptingContainer container,
- final BundleContext bundleContext, @Nullable final LogService logger) {
+ final BundleContext bundleContext, final Logger logger) {
this.logger = logger;
this.bundleContext = bundleContext;
this.pluginGemName = config.getPluginName();
@@ -114,7 +113,7 @@ public abstract class JRubyPlugin {
// Register the rack handler
final IRubyObject rackHandler = pluginInstance.callMethod("rack_handler");
if (!rackHandler.isNil()) {
- log(LogService.LOG_INFO, String.format("Using %s as rack handler", rackHandler.getMetaClass()));
+ logger.log(LogService.LOG_INFO, String.format("Using %s as rack handler", rackHandler.getMetaClass()));
final JRubyHttpServlet jRubyHttpServlet = new JRubyHttpServlet(rackHandler);
final Hashtable<String, String> properties = new Hashtable<String, String>();
@@ -217,16 +216,4 @@ public abstract class JRubyPlugin {
protected Ruby getRuntime() {
return pluginInstance.getMetaClass().getRuntime();
}
-
- protected void log(final int level, final String message) {
- if (logger != null) {
- logger.log(level, message);
- }
- }
-
- protected void log(final int level, final String message, final Throwable throwable) {
- if (logger != null) {
- logger.log(level, message, throwable);
- }
- }
}
diff --git a/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/Logger.java b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/Logger.java
new file mode 100644
index 0000000..2b648b0
--- /dev/null
+++ b/osgi-bundles/jruby/src/main/java/com/ning/billing/osgi/bundles/jruby/Logger.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2010-2013 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.ning.billing.osgi.bundles.jruby;
+
+import javax.annotation.Nullable;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class Logger {
+
+ // The name of the LogService
+ private static final String LOG_SERVICE_NAME = "org.osgi.service.log.LogService";
+
+ // The ServiceTracker to emit log services
+ private ServiceTracker logTracker;
+
+ public void start(final BundleContext context) {
+ // Track the log service using a ServiceTracker
+ logTracker = new ServiceTracker(context, LOG_SERVICE_NAME, null);
+ logTracker.open();
+ }
+
+ public void close() {
+ if (logTracker != null) {
+ logTracker.close();
+ }
+ }
+
+ public void log(final int level, final String message) {
+ log(level, message, null);
+ }
+
+ public void log(final int level, final String message, @Nullable final Throwable t) {
+ // log using the LogService if available
+ final Object log = logTracker.getService();
+ if (log != null) {
+ if (t == null) {
+ ((LogService) log).log(level, message);
+ } else {
+ ((LogService) log).log(level, message, t);
+ }
+ } else {
+ if (level >= 2) {
+ System.out.println(message);
+ } else {
+ System.err.println(message);
+ }
+
+ if (t != null) {
+ t.printStackTrace(System.err);
+ }
+ }
+ }
+}
osgi-bundles/pom.xml 2(+2 -0)
diff --git a/osgi-bundles/pom.xml b/osgi-bundles/pom.xml
index 797ba11..30addd9 100644
--- a/osgi-bundles/pom.xml
+++ b/osgi-bundles/pom.xml
@@ -31,5 +31,7 @@
<module>jruby</module>
<module>meter</module>
<module>test</module>
+ <module>webconsolebranding</module>
+ <module>defaultbundles</module>
</modules>
</project>
osgi-bundles/webconsolebranding/pom.xml 49(+49 -0)
diff --git a/osgi-bundles/webconsolebranding/pom.xml b/osgi-bundles/webconsolebranding/pom.xml
new file mode 100644
index 0000000..68d47c9
--- /dev/null
+++ b/osgi-bundles/webconsolebranding/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2010-2013 Ning, Inc.
+ ~
+ ~ Ning licenses this file to you under the Apache License, version 2.0
+ ~ (the "License"); you may not use this file except in compliance with the
+ ~ License. You may obtain a copy of the License at:
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ ~ License for the specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.ning.billing</groupId>
+ <artifactId>killbill-osgi-bundles</artifactId>
+ <version>0.1.54-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>killbill-osgi-bundles-webconsolebranding</artifactId>
+ <name>Killbill billing platform: OSGI Web Console branding bundle</name>
+ <packaging>bundle</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Fragment-Host>
+ org.apache.felix.webconsole
+ </Fragment-Host>
+ <Export-Package>
+ !*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/osgi-bundles/webconsolebranding/src/main/resources/META-INF/webconsole.properties b/osgi-bundles/webconsolebranding/src/main/resources/META-INF/webconsole.properties
new file mode 100644
index 0000000..3993219
--- /dev/null
+++ b/osgi-bundles/webconsolebranding/src/main/resources/META-INF/webconsole.properties
@@ -0,0 +1,16 @@
+# This file contains branding properties to overwrite the default
+# branding of the Apache Felix Web Console when deployed in Killbill
+
+webconsole.brand.name = Killbill Web Console
+webconsole.product.name = Killbill
+webconsole.product.url = http://killbilling.org
+webconsole.product.image = /res/killbill/logo.png
+
+# webconsole.vendor.name = The Apache Software Foundation
+# webconsole.vendor.url = http://www.apache.org
+# webconsole.vendor.image = /res/imgs/logo.png
+
+webconsole.favicon = /res/killbill/favicon.ico
+
+# We don't have a different stylesheet yet
+# webconsole.stylesheet = /res/ui/webconsole.css
diff --git a/osgi-bundles/webconsolebranding/src/main/resources/res/killbill/favicon.ico b/osgi-bundles/webconsolebranding/src/main/resources/res/killbill/favicon.ico
new file mode 100644
index 0000000..675f906
Binary files /dev/null and b/osgi-bundles/webconsolebranding/src/main/resources/res/killbill/favicon.ico differ
diff --git a/osgi-bundles/webconsolebranding/src/main/resources/res/killbill/logo.png b/osgi-bundles/webconsolebranding/src/main/resources/res/killbill/logo.png
new file mode 100644
index 0000000..ed80710
Binary files /dev/null and b/osgi-bundles/webconsolebranding/src/main/resources/res/killbill/logo.png differ
pom.xml 511(+334 -177)
diff --git a/pom.xml b/pom.xml
index ce46a7d..0a0436a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,8 @@
~ under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
@@ -72,11 +73,26 @@
<version>4.0.3</version>
</dependency>
<dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.fileinstall</artifactId>
+ <version>3.2.6</version>
+ </dependency>
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>4.3.1</version>
+ </dependency>
+ <dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>${ehcache.version}</version>
@@ -94,12 +110,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.0.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>com.ning.billing</groupId>
<artifactId>killbill-beatrix</artifactId>
<version>${project.version}</version>
@@ -261,6 +271,16 @@
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
+ <artifactId>killbill-osgi-bundles-webconsolebranding</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ning.billing</groupId>
+ <artifactId>killbill-osgi-bundles-defaultbundles</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ning.billing</groupId>
<artifactId>killbill-osgi-bundles-jruby</artifactId>
<version>${project.version}</version>
</dependency>
@@ -288,12 +308,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
- <version>2.0.0</version>
+ <version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <version>2.0.0</version>
+ <version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
@@ -308,7 +328,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <version>2.0.0</version>
+ <version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
@@ -373,6 +393,11 @@
<version>1.2</version>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>1.2.1</version>
@@ -472,6 +497,57 @@
<pluginManagement>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>3.0.0</version>
+ </requireMavenVersion>
+ <requireJavaVersion>
+ <version>1.6</version>
+ </requireJavaVersion>
+ <bannedDependencies>
+ <excludes>
+ <exclude>com.google.collections:google-collections</exclude>
+ <exclude>com.google.guava:guava</exclude>
+ </excludes>
+ <includes>
+ <include>com.google.guava:guava:[12,)</include>
+ </includes>
+ </bannedDependencies>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.13</version>
+ <configuration>
+ <argLine>-Xms512m -Xmx1024m -XX:MaxPermSize=512m -XX:MaxDirectMemorySize=512m</argLine>
+ <useManifestOnlyJar>false</useManifestOnlyJar>
+ <systemPropertyVariables>
+ <file.encoding>UTF-8</file.encoding>
+ <user.timezone>GMT</user.timezone>
+ <killbill.version>${project.version}</killbill.version>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
@@ -479,63 +555,160 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
- <version>1.4</version>
+ <version>2.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.3</version>
+ <executions>
+ <execution>
+ <id>analyze</id>
+ <goals>
+ <goal>analyze-only</goal>
+ </goals>
+ <configuration>
+ <ignoreNonCompile>true</ignoreNonCompile>
+ <failOnWarning>false</failOnWarning>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.ning.maven.plugins</groupId>
+ <artifactId>maven-dependency-versions-check-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <failBuildInCaseOfConflict>true</failBuildInCaseOfConflict>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.ning.maven.plugins</groupId>
+ <artifactId>maven-duplicate-finder-plugin</artifactId>
+ <version>1.0.4</version>
+ <configuration>
+ <failBuildInCaseOfConflict>false</failBuildInCaseOfConflict>
+ <!-- That's for Jetty -->
+ <ignoredResources>
+ <ignoredResource>about.html</ignoredResource>
+ </ignoredResources>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.7</version>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+ <useIdeaDefaultExcludes>true</useIdeaDefaultExcludes>
+ <useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+ <excludes>
+ <!-- For some reason, useIdeaDefaultExcludes
+ doesn't pick up .idea directory -->
+ <exclude>.idea/**</exclude>
+ <exclude>**/*.iml</exclude>
+ <exclude>**/.project</exclude>
+ <exclude>.git/**</exclude>
+ <exclude>.gitignore</exclude>
+ <exclude>**/.classpath</exclude>
+ <exclude>ignore/**</exclude>
+ <exclude>API.txt</exclude>
+ <exclude>RELEASE.sh</exclude>
+ <exclude>deploy.sh</exclude>
+ <exclude>run.sh</exclude>
+ <exclude>run-local.sh</exclude>
+ <exclude>release-script</exclude>
+ <exclude>doc/**</exclude>
+ <exclude>src/site/**</exclude>
+ <exclude>*.log</exclude>
+ <exclude>README.*</exclude>
+ <exclude>TODO</exclude>
+ <exclude>logs/**</exclude>
+ <exclude>**/*.xsd</exclude>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.stg</exclude>
+ <exclude>**/*.sql</exclude>
+ <exclude>**/*.properties</exclude>
+ <exclude>**/*.dont-let-git-remove-this-directory</exclude>
+ <exclude>**/test-output/**</exclude>
+ <exclude>**/bin/**</exclude>
+ <exclude>**/target/**</exclude>
+ <exclude>**/.settings/**</exclude>
+ <exclude>.travis.yml</exclude>
+ <exclude>bin/**</exclude>
+ <!-- exclude mustache template files -->
+ <exclude>**/*.mustache</exclude>
+ <exclude>examples/**</exclude>
+ <exclude>Gemfile.lock</exclude>
+ <exclude>src/main/ruby/kbadmin/**</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar</goal>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.4</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
- <groupId>com.ning.maven.plugins</groupId>
- <artifactId>maven-dependency-versions-check-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <failBuildInCaseOfConflict>true</failBuildInCaseOfConflict>
- </configuration>
- <executions>
- <execution>
- <phase>none</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.ning.maven.plugins</groupId>
- <artifactId>maven-duplicate-finder-plugin</artifactId>
- <version>1.0.2</version>
- <configuration>
- <failBuildInCaseOfConflict>false</failBuildInCaseOfConflict>
- <!-- That's for Jetty -->
- <ignoredResources>
- <ignoredResource>about.html</ignoredResource>
- </ignoredResources>
- </configuration>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
+ <version>2.4</version>
<executions>
<execution>
<goals>
+ <goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
@@ -543,81 +716,6 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.3</version>
- <executions>
- <execution>
- <id>analyze</id>
- <goals>
- <goal>analyze-only</goal>
- </goals>
- <configuration>
- <ignoreNonCompile>true</ignoreNonCompile>
- <failOnWarning>false</failOnWarning>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>0.7</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- <configuration>
- <useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
- <useIdeaDefaultExcludes>true</useIdeaDefaultExcludes>
- <useMavenDefaultExcludes>true</useMavenDefaultExcludes>
- <excludes>
- <!-- For some reason, useIdeaDefaultExcludes
- doesn't pick up .idea directory -->
- <exclude>.idea/**</exclude>
- <exclude>**/*.iml</exclude>
- <exclude>**/.project</exclude>
- <exclude>.git/**</exclude>
- <exclude>.gitignore</exclude>
- <exclude>**/.classpath</exclude>
- <exclude>ignore/**</exclude>
- <exclude>API.txt</exclude>
- <exclude>RELEASE.sh</exclude>
- <exclude>deploy.sh</exclude>
- <exclude>run.sh</exclude>
- <exclude>run-local.sh</exclude>
- <exclude>release-script</exclude>
- <exclude>doc/**</exclude>
- <exclude>src/site/**</exclude>
- <exclude>*.log</exclude>
- <exclude>README.*</exclude>
- <exclude>TODO</exclude>
- <exclude>logs/**</exclude>
- <exclude>**/*.xsd</exclude>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.stg</exclude>
- <exclude>**/*.sql</exclude>
- <exclude>**/*.properties</exclude>
- <exclude>**/*.dont-let-git-remove-this-directory</exclude>
- <exclude>**/test-output/**</exclude>
- <exclude>**/bin/**</exclude>
- <exclude>**/target/**</exclude>
- <exclude>**/.settings/**</exclude>
- <exclude>.travis.yml</exclude>
- <exclude>bin/**</exclude>
- <!-- exclude mustache template files -->
- <exclude>**/*.mustache</exclude>
- <exclude>examples/**</exclude>
- <exclude>Gemfile.lock</exclude>
- <exclude>src/main/ruby/kbadmin/**</exclude>
- </excludes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
<configuration>
@@ -645,15 +743,8 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.11</version>
<configuration>
- <useManifestOnlyJar>false</useManifestOnlyJar>
<groups>fast,slow,mysql</groups>
- <systemPropertyVariables>
- <propertyName>propertyValue</propertyName>
- <log4j.configuration>file:${project.basedir}/src/test/resources/log4j.xml</log4j.configuration>
- <killbill.version>${project.version}</killbill.version>
- </systemPropertyVariables>
</configuration>
</plugin>
<plugin>
@@ -664,21 +755,6 @@
<attachClasses>true</attachClasses>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>verify</phase>
- <goals>
- <goal>jar</goal>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
<profiles>
@@ -689,14 +765,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.11</version>
<configuration>
<groups>fast,slow</groups>
<excludedGroups>mysql</excludedGroups>
<systemPropertyVariables>
<com.ning.billing.dbi.test.h2>true</com.ning.billing.dbi.test.h2>
- <file.encoding>UTF-8</file.encoding>
- <user.timezone>GMT</user.timezone>
</systemPropertyVariables>
</configuration>
</plugin>
@@ -710,19 +783,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.11</version>
<configuration>
<groups>fast,slow,mysql</groups>
- <useManifestOnlyJar>false</useManifestOnlyJar>
<systemPropertyVariables>
- <log4j.configuration>file:${project.basedir}/src/test/resources/log4j.xml
- </log4j.configuration>
<com.ning.billing.dbi.test.useLocalDb>true</com.ning.billing.dbi.test.useLocalDb>
<com.ning.billing.dbi.jdbc.url>jdbc:mysql://127.0.0.1:3306/killbill
</com.ning.billing.dbi.jdbc.url>
- <file.encoding>UTF-8</file.encoding>
- <user.timezone>GMT</user.timezone>
- <killbill.version>${project.version}</killbill.version>
</systemPropertyVariables>
</configuration>
</plugin>
@@ -735,16 +801,35 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.11</version>
<configuration>
<groups>fast</groups>
- <systemPropertyVariables>
- <file.encoding>UTF-8</file.encoding>
- <user.timezone>GMT</user.timezone>
- </systemPropertyVariables>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>com.ning.maven.plugins</groupId>
+ <artifactId>maven-dependency-versions-check-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>com.ning.maven.plugins</groupId>
+ <artifactId>maven-duplicate-finder-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
</plugins>
</build>
</profile>
@@ -755,7 +840,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.11</version>
<configuration>
<groups>stress</groups>
</configuration>
@@ -769,6 +853,10 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<executions>
@@ -784,13 +872,82 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.11</version>
<configuration>
- <groups>fast</groups>
- <systemPropertyVariables>
- <file.encoding>UTF-8</file.encoding>
- <user.timezone>GMT</user.timezone>
- </systemPropertyVariables>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>com.ning.maven.plugins</groupId>
+ <artifactId>maven-dependency-versions-check-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>com.ning.maven.plugins</groupId>
+ <artifactId>maven-duplicate-finder-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jdk16</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <fork>true</fork>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jdk17</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <classifier>jdk17</classifier>
+ </configuration>
+ <goals>
+ <goal>jar</goal>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <fork>true</fork>
</configuration>
</plugin>
</plugins>
@@ -807,7 +964,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8</version>
+ <version>2.9</version>
<configuration>
<source>1.6</source>
<encoding>UTF-8</encoding>
@@ -838,22 +995,22 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.6</version>
+ <version>2.13</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.4</version>
+ <version>2.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <version>2.5.1</version>
+ <version>2.5.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
- <version>2.3.2</version>
+ <version>2.5.2</version>
<configuration>
<threshold>Low</threshold>
<effort>Max</effort>
@@ -887,6 +1044,6 @@
</reporting>
<issueManagement>
<system>Github</system>
- <url>http://github.com/ning/killbill</url>
+ <url>http://github.com/killbill/killbill</url>
</issueManagement>
</project>
server/pom.xml 92(+0 -92)
diff --git a/server/pom.xml b/server/pom.xml
index d1e653e..f6aaeca 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -117,7 +117,6 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>com.ning.jetty</groupId>
@@ -217,7 +216,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>11.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -322,7 +320,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
- <version>1.4</version>
<executions>
<execution>
<id>assemble-killbill</id>
@@ -344,98 +341,9 @@
</executions>
</plugin>
<plugin>
- <groupId>com.ning.maven.plugins</groupId>
- <artifactId>maven-dependency-versions-check-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <failBuildInCaseOfConflict>true</failBuildInCaseOfConflict>
- </configuration>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
<!-- To make eclipse happy -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.5</version>
- </plugin>
- <plugin>
- <groupId>com.ning.maven.plugins</groupId>
- <artifactId>maven-duplicate-finder-plugin</artifactId>
- <version>1.0.2</version>
- <configuration>
- <failBuildInCaseOfConflict>false</failBuildInCaseOfConflict>
- <!-- That's for Jetty -->
- <ignoredResources>
- <ignoredResource>about.html</ignoredResource>
- </ignoredResources>
- </configuration>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.3</version>
- <executions>
- <execution>
- <id>analyze</id>
- <goals>
- <goal>analyze-only</goal>
- </goals>
- <configuration>
- <ignoreNonCompile>true</ignoreNonCompile>
- <failOnWarning>false</failOnWarning>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.2.1</version>
- <configuration>
- <mavenExecutorId>forked-path</mavenExecutorId>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.scm</groupId>
- <artifactId>maven-scm-provider-gitexe</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>1.5.9</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <!-- TODO: fix for http://jira.codehaus.org/browse/MSITE-286? -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/util/src/main/java/com/ning/billing/util/config/OSGIConfig.java b/util/src/main/java/com/ning/billing/util/config/OSGIConfig.java
index c135656..2e18f38 100644
--- a/util/src/main/java/com/ning/billing/util/config/OSGIConfig.java
+++ b/util/src/main/java/com/ning/billing/util/config/OSGIConfig.java
@@ -63,12 +63,20 @@ public interface OSGIConfig extends KillbillConfig {
// Note: bundles should mark javax.servlet:servlet-api as provided
"javax.servlet;version=3.0," +
"javax.servlet.http;version=3.0," +
- "org.osgi.service.log;version=1.3")
+ "org.osgi.service.log;version=1.3," +
+ // Let the world know the System bundle exposes (via org.osgi.compendium) the requirement (osgi.wiring.package=org.osgi.service.http)
+ "org.osgi.service.http," +
+ // Let the world know the System bundle exposes (via org.osgi.compendium) the requirement (&(osgi.wiring.package=org.osgi.service.deploymentadmin)(version>=1.1.0)(!(version>=2.0.0)))
+ "org.osgi.service.deploymentadmin;version=1.1.0," +
+ // Let the world know the System bundle exposes (via org.osgi.compendium) the requirement (&(osgi.wiring.package=org.osgi.service.event)(version>=1.2.0)(!(version>=2.0.0)))
+ "org.osgi.service.event;version=1.2.0," +
+ // Let the world know the System bundle exposes the requirement (&(osgi.wiring.package=org.slf4j)(version>=1.7.0)(!(version>=2.0.0)))
+ "org.slf4j;version=1.7.2")
public String getSystemBundleExportPackages();
// TODO FIXME OSGI
@Config("killbill.osgi.jruby.bundle.path")
- @Default("file:/var/tmp/killbill-osgi-bundles-jruby-0.1.52-SNAPSHOT-jar-with-dependencies.jar")
+ @Default("file:/var/tmp/killbill-osgi-bundles-jruby.jar")
public String getJrubyBundlePath();
}