GERONIMO-6650 extract common logic in a common module
authorRomain Manni-Bucau <rmannibucau@gmail.com>
Fri, 19 Oct 2018 07:46:40 +0000 (09:46 +0200)
committerRomain Manni-Bucau <rmannibucau@gmail.com>
Fri, 19 Oct 2018 07:46:40 +0000 (09:46 +0200)
24 files changed:
geronimo-metrics-common/pom.xml [new file with mode: 0644]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/BaseMetrics.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/impl/BaseMetrics.java with 99% similarity]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/CounterImpl.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/impl/CounterImpl.java with 96% similarity]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/GaugeImpl.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/impl/GaugeImpl.java with 96% similarity]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/HistogramImpl.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/impl/HistogramImpl.java with 99% similarity]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/MeterImpl.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/impl/MeterImpl.java with 98% similarity]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/RegistryImpl.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/impl/RegistryImpl.java with 99% similarity]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/TimerImpl.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/impl/TimerImpl.java with 97% similarity]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/jaxrs/MetricsEndpoints.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/MetricsEndpoints.java with 91% similarity]
geronimo-metrics-common/src/main/java/org/apache/geronimo/microprofile/metrics/common/prometheus/PrometheusFormatter.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/PrometheusFormatter.java with 99% similarity]
geronimo-metrics/pom.xml [new file with mode: 0644]
geronimo-metrics/src/main/java/org/apache/geronimo/microprofile/metrics/cdi/CountedInterceptor.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/cdi/CountedInterceptor.java with 100% similarity]
geronimo-metrics/src/main/java/org/apache/geronimo/microprofile/metrics/cdi/MeteredInterceptor.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/cdi/MeteredInterceptor.java with 100% similarity]
geronimo-metrics/src/main/java/org/apache/geronimo/microprofile/metrics/cdi/MetricsExtension.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/cdi/MetricsExtension.java with 98% similarity]
geronimo-metrics/src/main/java/org/apache/geronimo/microprofile/metrics/cdi/Names.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/cdi/Names.java with 100% similarity]
geronimo-metrics/src/main/java/org/apache/geronimo/microprofile/metrics/cdi/TimedInterceptor.java [moved from src/main/java/org/apache/geronimo/microprofile/metrics/cdi/TimedInterceptor.java with 100% similarity]
geronimo-metrics/src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/CdiMetricsEndpoints.java [new file with mode: 0644]
geronimo-metrics/src/main/resources/META-INF/beans.xml [moved from src/main/resources/META-INF/beans.xml with 100% similarity]
geronimo-metrics/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension [moved from src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension with 100% similarity]
geronimo-metrics/src/test/java/org/apache/geronimo/microprofile/metrics/test/ArquillianSetup.java [moved from src/test/java/org/apache/geronimo/microprofile/metrics/test/ArquillianSetup.java with 100% similarity]
geronimo-metrics/src/test/java/org/apache/geronimo/microprofile/metrics/test/TckContainer.java [moved from src/test/java/org/apache/geronimo/microprofile/metrics/test/TckContainer.java with 100% similarity]
geronimo-metrics/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension [moved from src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension with 100% similarity]
geronimo-metrics/src/test/resources/arquillian.xml [moved from src/test/resources/arquillian.xml with 100% similarity]
pom.xml

diff --git a/geronimo-metrics-common/pom.xml b/geronimo-metrics-common/pom.xml
new file mode 100644 (file)
index 0000000..2ac0449
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF 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">
+  <parent>
+    <artifactId>geronimo-metrics-parent</artifactId>
+    <groupId>org.apache.geronimo</groupId>
+    <version>1.0.1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>geronimo-metrics-common</artifactId>
+  <name>Geronimo Metrics :: Common</name>
+
+  <properties>
+    <geronimo-metrics.Automatic-Module-Name>org.apache.geronimo.microprofile.metrics.common</geronimo-metrics.Automatic-Module-Name>
+  </properties>
+</project>
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.impl;
+package org.apache.geronimo.microprofile.metrics.common;
 
 import static java.lang.String.format;
 
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.impl;
+package org.apache.geronimo.microprofile.metrics.common;
 
 import java.util.concurrent.atomic.LongAdder;
 
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.impl;
+package org.apache.geronimo.microprofile.metrics.common;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.impl;
+package org.apache.geronimo.microprofile.metrics.common;
 
 import java.io.IOException;
 import java.io.OutputStream;
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.impl;
+package org.apache.geronimo.microprofile.metrics.common;
 
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.impl;
+package org.apache.geronimo.microprofile.metrics.common;
 
 import static java.util.stream.Collectors.toMap;
 
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.impl;
+package org.apache.geronimo.microprofile.metrics.common;
 
 import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
@@ -24,7 +24,6 @@ import javax.json.bind.annotation.JsonbTransient;
 
 import org.eclipse.microprofile.metrics.Histogram;
 import org.eclipse.microprofile.metrics.Meter;
-import org.eclipse.microprofile.metrics.MetricUnits;
 import org.eclipse.microprofile.metrics.Snapshot;
 import org.eclipse.microprofile.metrics.Timer;
 
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.jaxrs;
+package org.apache.geronimo.microprofile.metrics.common.jaxrs;
 
 import static java.util.Collections.emptyMap;
 import static java.util.Collections.singletonMap;
 import static java.util.Optional.ofNullable;
 import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toMap;
-import static org.eclipse.microprofile.metrics.MetricRegistry.Type.BASE;
-import static org.eclipse.microprofile.metrics.MetricRegistry.Type.VENDOR;
 
 import java.util.Collections;
 import java.util.Map;
 import java.util.stream.Stream;
 
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
 import javax.ws.rs.GET;
 import javax.ws.rs.OPTIONS;
 import javax.ws.rs.Path;
@@ -39,29 +35,32 @@ import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.apache.geronimo.microprofile.metrics.common.prometheus.PrometheusFormatter;
 import org.eclipse.microprofile.metrics.Counter;
 import org.eclipse.microprofile.metrics.Gauge;
 import org.eclipse.microprofile.metrics.Metadata;
 import org.eclipse.microprofile.metrics.Metric;
 import org.eclipse.microprofile.metrics.MetricRegistry;
-import org.eclipse.microprofile.metrics.annotation.RegistryType;
 
 @Path("metrics")
-@ApplicationScoped
 public class MetricsEndpoints {
-    @Inject
-    @RegistryType(type = BASE)
     private MetricRegistry baseRegistry;
-
-    @Inject
-    @RegistryType(type = VENDOR)
     private MetricRegistry vendorRegistry;
-
-    @Inject
     private MetricRegistry applicationRegistry;
 
-    @Inject
-    private PrometheusFormatter prometheus;
+    private final PrometheusFormatter prometheus = new PrometheusFormatter();
+
+    public void setBaseRegistry(final MetricRegistry baseRegistry) {
+        this.baseRegistry = baseRegistry;
+    }
+
+    public void setVendorRegistry(final MetricRegistry vendorRegistry) {
+        this.vendorRegistry = vendorRegistry;
+    }
+
+    public void setApplicationRegistry(final MetricRegistry applicationRegistry) {
+        this.applicationRegistry = applicationRegistry;
+    }
 
     @GET
     @Produces(MediaType.APPLICATION_JSON)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.microprofile.metrics.jaxrs;
+package org.apache.geronimo.microprofile.metrics.common.prometheus;
 
 import static java.lang.Math.pow;
 import static java.util.Collections.singletonMap;
@@ -26,8 +26,6 @@ import java.util.Map;
 import java.util.function.Function;
 import java.util.stream.Stream;
 
-import javax.enterprise.context.ApplicationScoped;
-
 import org.eclipse.microprofile.metrics.Counter;
 import org.eclipse.microprofile.metrics.Gauge;
 import org.eclipse.microprofile.metrics.Histogram;
@@ -42,7 +40,6 @@ import org.eclipse.microprofile.metrics.Timer;
 // this is so weird to have this format built-in but not mainstream ones,
 // todo: pby make it dropped from the spec
 // note: this is a simplified serialization flavor and it can need some more love
-@ApplicationScoped
 public class PrometheusFormatter {
     public StringBuilder toText(final MetricRegistry registry,
                                 final String registryKey,
diff --git a/geronimo-metrics/pom.xml b/geronimo-metrics/pom.xml
new file mode 100644 (file)
index 0000000..9f2d066
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF 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">
+  <parent>
+    <artifactId>geronimo-metrics-parent</artifactId>
+    <groupId>org.apache.geronimo</groupId>
+    <version>1.0.1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>geronimo-metrics</artifactId>
+
+  <properties>
+    <geronimo-metrics.Automatic-Module-Name>org.apache.geronimo.microprofile.metrics
+    </geronimo-metrics.Automatic-Module-Name>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-interceptor_1.2_spec</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-atinject_1.0_spec</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+      <version>1.0.1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-annotation_1.3_spec</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.microprofile.config</groupId>
+      <artifactId>microprofile-config-api</artifactId>
+      <version>1.2</version>
+      <scope>provided</scope>
+      <optional>true</optional>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.geronimo</groupId>
+      <artifactId>geronimo-metrics-common</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.arquillian.junit</groupId>
+      <artifactId>arquillian-junit-container</artifactId>
+      <version>${arquillian.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.meecrowave</groupId>
+      <artifactId>meecrowave-arquillian</artifactId>
+      <version>1.2.3</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.microprofile.metrics</groupId>
+      <artifactId>microprofile-metrics-api-tck</artifactId>
+      <version>${spec.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.microprofile.metrics</groupId>
+      <artifactId>microprofile-metrics-rest-tck</artifactId>
+      <version>${spec.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.config</groupId>
+      <artifactId>geronimo-config-impl</artifactId>
+      <version>1.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.22.1</version>
+        <configuration>
+          <reuseForks>false</reuseForks>
+          <dependenciesToScan>
+            <dependency>org.eclipse.microprofile.metrics:microprofile-metrics-api-tck</dependency>
+            <dependency>org.eclipse.microprofile.metrics:microprofile-metrics-rest-tck</dependency>
+          </dependenciesToScan>
+          <environmentVariables>
+            <MP_METRICS_TAGS>tier=integration</MP_METRICS_TAGS>
+          </environmentVariables>
+          <systemPropertyVariables>
+            <geronimo.metrics.jaxrs.activated>true</geronimo.metrics.jaxrs.activated>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file
@@ -20,7 +20,6 @@ import static java.util.Optional.of;
 import static java.util.Optional.ofNullable;
 
 import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
@@ -58,10 +57,10 @@ import javax.enterprise.inject.spi.WithAnnotations;
 import javax.enterprise.util.AnnotationLiteral;
 import javax.enterprise.util.Nonbinding;
 
-import org.apache.geronimo.microprofile.metrics.impl.BaseMetrics;
-import org.apache.geronimo.microprofile.metrics.impl.GaugeImpl;
-import org.apache.geronimo.microprofile.metrics.impl.RegistryImpl;
-import org.apache.geronimo.microprofile.metrics.jaxrs.MetricsEndpoints;
+import org.apache.geronimo.microprofile.metrics.common.BaseMetrics;
+import org.apache.geronimo.microprofile.metrics.common.GaugeImpl;
+import org.apache.geronimo.microprofile.metrics.common.RegistryImpl;
+import org.apache.geronimo.microprofile.metrics.jaxrs.CdiMetricsEndpoints;
 import org.eclipse.microprofile.metrics.Counter;
 import org.eclipse.microprofile.metrics.Gauge;
 import org.eclipse.microprofile.metrics.Histogram;
@@ -77,8 +76,6 @@ import org.eclipse.microprofile.metrics.annotation.RegistryType;
 import org.eclipse.microprofile.metrics.annotation.Timed;
 
 public class MetricsExtension implements Extension {
-    private static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
-
     private final MetricRegistry applicationRegistry = new RegistryImpl();
     private final MetricRegistry baseRegistry = new RegistryImpl();
     private final MetricRegistry vendorRegistry = new RegistryImpl();
@@ -88,7 +85,7 @@ public class MetricsExtension implements Extension {
     private final Collection<Runnable> producersRegistrations = new ArrayList<>();
     private final Collection<CreationalContext<?>> creationalContexts = new ArrayList<>();
 
-    void letOtherExtensionsUseRegistries(@Observes final ProcessAnnotatedType<MetricsEndpoints> processAnnotatedType) {
+    void letOtherExtensionsUseRegistries(@Observes final ProcessAnnotatedType<CdiMetricsEndpoints> processAnnotatedType) {
         if (!Boolean.getBoolean("geronimo.metrics.jaxrs.activated")) {
             processAnnotatedType.veto();
         }
diff --git a/geronimo-metrics/src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/CdiMetricsEndpoints.java b/geronimo-metrics/src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/CdiMetricsEndpoints.java
new file mode 100644 (file)
index 0000000..1e9a0e6
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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 org.apache.geronimo.microprofile.metrics.jaxrs;
+
+import static org.eclipse.microprofile.metrics.MetricRegistry.Type.BASE;
+import static org.eclipse.microprofile.metrics.MetricRegistry.Type.VENDOR;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Path;
+
+import org.apache.geronimo.microprofile.metrics.common.jaxrs.MetricsEndpoints;
+import org.eclipse.microprofile.metrics.MetricRegistry;
+import org.eclipse.microprofile.metrics.annotation.RegistryType;
+
+@Path("metrics")
+@ApplicationScoped
+public class CdiMetricsEndpoints extends MetricsEndpoints {
+    @Inject
+    @RegistryType(type = BASE)
+    private MetricRegistry baseRegistry;
+
+    @Inject
+    @RegistryType(type = VENDOR)
+    private MetricRegistry vendorRegistry;
+
+    @Inject
+    private MetricRegistry applicationRegistry;
+
+    @PostConstruct
+    private void init() {
+        setApplicationRegistry(applicationRegistry);
+        setBaseRegistry(baseRegistry);
+        setVendorRegistry(vendorRegistry);
+    }
+}
diff --git a/pom.xml b/pom.xml
index e55a46e..c688d81 100644 (file)
--- a/pom.xml
+++ b/pom.xml
   <parent>
     <groupId>org.apache</groupId>
     <artifactId>apache</artifactId>
-    <version>18</version>
+    <version>21</version>
   </parent>
 
   <groupId>org.apache.geronimo</groupId>
-  <artifactId>geronimo-metrics</artifactId>
+  <artifactId>geronimo-metrics-parent</artifactId>
   <version>1.0.1-SNAPSHOT</version>
   <name>Geronimo Metrics</name>
+  <packaging>pom</packaging>
 
   <description>
     Apache Geronimo implementation of the Microprofile Metrics Specification
     <arquillian.version>1.1.8.Final</arquillian.version>
   </properties>
 
+  <modules>
+    <module>geronimo-metrics-common</module>
+    <module>geronimo-metrics</module>
+  </modules>
+
   <dependencies>
     <dependency>
       <groupId>org.eclipse.microprofile.metrics</groupId>
     </dependency>
     <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-interceptor_1.2_spec</artifactId>
-      <version>1.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-atinject_1.0_spec</artifactId>
-      <version>1.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-jcdi_2.0_spec</artifactId>
-      <version>1.0.1</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-annotation_1.3_spec</artifactId>
-      <version>1.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.microprofile.config</groupId>
-      <artifactId>microprofile-config-api</artifactId>
-      <version>1.2</version>
-      <scope>provided</scope>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-jsonb_1.0_spec</artifactId>
       <version>1.0</version>
       <scope>provided</scope>
     </dependency>
-
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.12</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.arquillian.junit</groupId>
-      <artifactId>arquillian-junit-container</artifactId>
-      <version>${arquillian.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.meecrowave</groupId>
-      <artifactId>meecrowave-arquillian</artifactId>
-      <version>1.2.1</version>
-      <scope>test</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.inject</groupId>
-          <artifactId>javax.inject</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.openwebbeans</groupId>
-      <artifactId>openwebbeans-impl</artifactId>
-      <version>2.0.6</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.microprofile.metrics</groupId>
-      <artifactId>microprofile-metrics-api-tck</artifactId>
-      <version>${spec.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.microprofile.metrics</groupId>
-      <artifactId>microprofile-metrics-rest-tck</artifactId>
-      <version>${spec.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.config</groupId>
-      <artifactId>geronimo-config-impl</artifactId>
-      <version>1.1</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.7.0</version>
+        <version>3.8.0</version>
         <configuration>
           <source>1.8</source>
           <target>1.8</target>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.21.0</version>
-        <configuration>
-          <reuseForks>false</reuseForks>
-          <dependenciesToScan>
-            <dependency>org.eclipse.microprofile.metrics:microprofile-metrics-api-tck</dependency>
-            <dependency>org.eclipse.microprofile.metrics:microprofile-metrics-rest-tck</dependency>
-          </dependenciesToScan>
-          <environmentVariables>
-            <MP_METRICS_TAGS>tier=integration</MP_METRICS_TAGS>
-          </environmentVariables>
-          <systemPropertyVariables>
-            <geronimo.metrics.jaxrs.activated>true</geronimo.metrics.jaxrs.activated>
-          </systemPropertyVariables>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
         <version>3.0.2</version>
         <configuration>
           <archive combine.children="append">
             <manifestEntries>
-              <Automatic-Module-Name>org.apache.geronimo.microprofile.metrics</Automatic-Module-Name>
+              <Automatic-Module-Name>${geronimo-metrics.Automatic-Module-Name}</Automatic-Module-Name>
             </manifestEntries>
           </archive>
         </configuration>