changeset 1434:1ddf31f810a3 tip

7902041: Make sure JMH builds and runs with JDK 9 GA
author shade
date Fri, 22 Sep 2017 18:11:47 +0200
parents cf406468989e
children
files jmh-archetypes/pom.xml jmh-core-benchmarks/pom.xml jmh-core-ct/pom.xml jmh-core-it/pom.xml jmh-core/pom.xml jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotClassloadingProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotCompilationProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotMemoryProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotRuntimeProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotThreadProfiler.java jmh-generator-annprocess/pom.xml jmh-generator-asm/pom.xml jmh-generator-bytecode/pom.xml jmh-generator-reflection/pom.xml jmh-samples/pom.xml pom.xml
diffstat 17 files changed, 221 insertions(+), 123 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-archetypes/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-archetypes/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -52,7 +52,7 @@
                     <plugins>
                         <plugin>
                             <artifactId>maven-archetype-plugin</artifactId>
-                            <version>2.2</version>
+                            <version>3.0.1</version>
                             <goals>
                                 <goal>integration-test</goal>
                             </goals>
@@ -74,7 +74,7 @@
                     <plugins>
                         <plugin>
                             <artifactId>maven-archetype-plugin</artifactId>
-                            <version>2.2</version>
+                            <version>3.0.1</version>
                             <goals>
                                 <goal>integration-test</goal>
                             </goals>
@@ -94,7 +94,6 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-resources-plugin</artifactId>
-                    <version>2.5</version>
                     <configuration>
                         <escapeString>\</escapeString>
                     </configuration>
--- a/jmh-core-benchmarks/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core-benchmarks/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -66,7 +66,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.0</version>
                 <configuration>
                     <compilerVersion>1.7</compilerVersion>
                     <source>1.7</source>
@@ -76,7 +75,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.14.1</version>
                 <configuration>
                     <forkMode>always</forkMode>
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
@@ -85,7 +83,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
-                <version>2.0</version>
                 <executions>
                     <execution>
                         <id>benchmarks</id>
@@ -127,7 +124,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
--- a/jmh-core-ct/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core-ct/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -67,7 +67,6 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.10</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
@@ -81,7 +80,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
@@ -103,7 +101,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.0</version>
                 <configuration>
                     <compilerVersion>1.7</compilerVersion>
                     <source>1.7</source>
@@ -131,7 +128,6 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
-                        <version>2.14.1</version>
                         <configuration>
                             <redirectTestOutputToFile>true</redirectTestOutputToFile>
                             <argLine>-Djmh.ct.generator=annprocess</argLine>
@@ -148,7 +144,6 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
-                        <version>2.14.1</version>
                         <configuration>
                             <redirectTestOutputToFile>true</redirectTestOutputToFile>
                             <argLine>-Djmh.ct.generator=asm</argLine>
@@ -165,7 +160,6 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
-                        <version>2.14.1</version>
                         <configuration>
                             <redirectTestOutputToFile>true</redirectTestOutputToFile>
                             <argLine>-Djmh.ct.generator=reflection</argLine>
--- a/jmh-core-it/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core-it/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -52,7 +52,6 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.10</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
@@ -66,7 +65,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.14.1</version>
                 <configuration>
                     <!-- Integration tests are not measuring performance, OK to run them concurrently -->
                     <argLine>-Djmh.ignoreLock=true -Xms256m -Xmx256m -Djmh.core.it.profile=${jmh.core.it.profile}</argLine>
@@ -79,7 +77,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
@@ -122,7 +119,6 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-compiler-plugin</artifactId>
-                        <version>3.0</version>
                         <configuration>
                             <compilerVersion>1.7</compilerVersion>
                             <source>1.7</source>
@@ -150,7 +146,6 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-compiler-plugin</artifactId>
-                        <version>3.0</version>
                         <configuration>
                             <compilerVersion>1.7</compilerVersion>
                             <source>1.7</source>
@@ -181,7 +176,6 @@
                     <plugin>
                         <groupId>org.codehaus.mojo</groupId>
                         <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.8</version>
                         <executions>
                             <execution>
                                 <id>add-source</id>
@@ -200,7 +194,6 @@
                     <plugin>
                         <groupId>org.codehaus.mojo</groupId>
                         <artifactId>exec-maven-plugin</artifactId>
-                        <version>1.2.1</version>
                         <executions>
                             <execution>
                                 <phase>process-test-sources</phase>
@@ -240,7 +233,6 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-compiler-plugin</artifactId>
-                        <version>3.0</version>
                         <configuration>
                             <compilerVersion>1.7</compilerVersion>
                             <source>1.7</source>
@@ -271,7 +263,6 @@
                     <plugin>
                         <groupId>org.codehaus.mojo</groupId>
                         <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.8</version>
                         <executions>
                             <execution>
                                 <id>add-source</id>
@@ -290,7 +281,6 @@
                     <plugin>
                         <groupId>org.codehaus.mojo</groupId>
                         <artifactId>exec-maven-plugin</artifactId>
-                        <version>1.2.1</version>
                         <executions>
                             <execution>
                                 <phase>process-test-sources</phase>
--- a/jmh-core/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -54,18 +54,15 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.10</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>net.sf.jopt-simple</groupId>
             <artifactId>jopt-simple</artifactId>
-            <version>4.6</version>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-math3</artifactId>
-            <version>3.2</version>
         </dependency>
     </dependencies>
 
@@ -80,7 +77,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
                 <configuration>
                     <compilerVersion>1.7</compilerVersion>
                     <source>1.7</source>
@@ -92,7 +88,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.14.1</version>
                 <configuration>
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
                 </configuration>
@@ -101,7 +96,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
@@ -123,7 +117,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-site-plugin</artifactId>
-                <version>3.2</version>
             </plugin>
         </plugins>
 
@@ -154,13 +147,11 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-site-plugin</artifactId>
-                <version>3.0</version>
             </plugin>
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.9</version>
                 <reportSets>
                     <reportSet>
                         <reports>
@@ -180,25 +171,21 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>cobertura-maven-plugin</artifactId>
-                <version>2.5.2</version>
             </plugin>
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-report-plugin</artifactId>
-                <version>2.14.1</version>
             </plugin>
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jxr-plugin</artifactId>
-                <version>2.3</version>
             </plugin>
 
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>findbugs-maven-plugin</artifactId>
-                <version>2.5.2</version>
                 <configuration>
                     <effort>Max</effort>
                     <threshold>Low</threshold>
@@ -209,7 +196,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>2.10</version>
                 <configuration>
                     <consoleOutput>false</consoleOutput>
                     <configLocation>${project.basedir}/src/main/resources/checkstyle.xml</configLocation>
@@ -219,7 +205,6 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>taglist-maven-plugin</artifactId>
-                <version>2.4</version>
                 <configuration>
                     <tagListOptions>
                         <tagClasses>
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java	Fri Sep 22 18:11:47 2017 +0200
@@ -27,26 +27,27 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.*;
-import sun.management.counter.Counter;
 
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.*;
 
 abstract class AbstractHotspotProfiler implements InternalProfiler {
 
+    private final Method getListMethod;
+    private final Object bean;
+
     private Map<String, Long> prevs;
 
-    /**
-     * Returns internal counters for specific MXBean
-     * @return list of internal counters.
-     */
-    protected abstract Collection<Counter> getCounters();
-
-    public AbstractHotspotProfiler() throws ProfilerException {
+    public AbstractHotspotProfiler(String beanName) throws ProfilerException {
         try {
-            Class.forName("sun.management.ManagementFactoryHelper");
-        } catch (ClassNotFoundException e) {
-            throw new ProfilerException("Class not found: " + e.getMessage() + ", are you running HotSpot VM?");
+            Class<?> helper = Class.forName("sun.management.ManagementFactoryHelper");
+            bean = helper.getMethod("get" + beanName).invoke(null);
+            getListMethod = bean.getClass().getMethod("getInternalRuntimeCounters");
+            getListMethod.setAccessible(true);
+            getListMethod.invoke(bean); // try
+        } catch (ClassNotFoundException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
+            throw new ProfilerException("Problem initializing profiler (" + e.getMessage() + "), are you running HotSpot VM?");
         }
     }
 
@@ -63,7 +64,7 @@
     @Override
     public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
         prevs = new HashMap<>();
-        for (Counter counter : getCounters()) {
+        for (HotspotCounter counter : getCounters()) {
             prevs.put(counter.getName(), convert(counter.getValue()));
         }
     }
@@ -79,7 +80,7 @@
     protected HotspotInternalResult counters() {
         Map<String, Long> difference = new TreeMap<>();
         Map<String, Long> current = new TreeMap<>();
-        for (Counter counter : getCounters()) {
+        for (HotspotCounter counter : getCounters()) {
             Long prev = prevs.get(counter.getName());
             if (prev != null) {
                 long diff = convert(counter.getValue()) - prev;
@@ -91,12 +92,19 @@
         return new HotspotInternalResult(current, difference);
     }
 
-    public static <T> T getInstance(String name) {
+    public List<HotspotCounter> getCounters() {
         try {
-            Object o = Class.forName("sun.management.ManagementFactoryHelper").getMethod("get" + name).invoke(null);
-            return (T) o;
-        } catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
-            throw new IllegalStateException("Should not be here");
+            List<HotspotCounter> counters = new ArrayList<>();
+            for (Object c : (List) getListMethod.invoke(bean)) {
+                try {
+                    counters.add(new HotspotCounter(c));
+                } catch (UnsupportedOperationException e) {
+                    // ignore this counter
+                }
+            }
+            return counters;
+        } catch (IllegalAccessException | InvocationTargetException e) {
+            throw new IllegalStateException("Should not be here", e);
         }
     }
 
@@ -125,4 +133,71 @@
             return "difference: " + diff.toString();
         }
     }
+
+    /**
+     * Reflective proxy for Hotspot counters to dodge compatibility problems.
+     */
+    private static class HotspotCounter {
+        private static final Method GET_VALUE;
+        private static final Method GET_NAME;
+
+        static {
+            Method name = null;
+            Method value = null;
+            try {
+                Class<?> cntClass = Class.forName("sun.management.counter.Counter");
+                if (cntClass != null) {
+                    try {
+                        name = cntClass.getMethod("getName");
+                    } catch (NoSuchMethodException e) {
+                        // do nothing
+                    }
+                    try {
+                        value = cntClass.getMethod("getValue");
+                    } catch (NoSuchMethodException e) {
+                        // do nothing
+                    }
+                }
+            } catch (ClassNotFoundException e) {
+                // no nothing
+            }
+
+            GET_NAME = name;
+            GET_VALUE = value;
+        }
+
+        private final Object proxy;
+
+        public HotspotCounter(Object proxy) throws UnsupportedOperationException {
+            this.proxy = proxy;
+
+            // Try these right now
+            if (GET_NAME == null || GET_VALUE == null)  {
+                throw new UnsupportedOperationException();
+            }
+            try {
+                String k = (String) GET_NAME.invoke(proxy);
+                Object v = GET_VALUE.invoke(proxy);
+            } catch (IllegalAccessException | InvocationTargetException e) {
+                throw new UnsupportedOperationException(e);
+            }
+        }
+
+        public String getName() {
+            try {
+                return (String) GET_NAME.invoke(proxy);
+            } catch (IllegalAccessException | InvocationTargetException e) {
+                throw new IllegalStateException("Cannot be here");
+            }
+        }
+
+        public Object getValue() {
+            try {
+                return GET_VALUE.invoke(proxy);
+            } catch (IllegalAccessException | InvocationTargetException e) {
+                throw new IllegalStateException("Cannot be here");
+            }
+        }
+    }
+
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotClassloadingProfiler.java	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotClassloadingProfiler.java	Fri Sep 22 18:11:47 2017 +0200
@@ -24,19 +24,10 @@
  */
 package org.openjdk.jmh.profile;
 
-import sun.management.HotspotClassLoadingMBean;
-import sun.management.counter.Counter;
-
-import java.util.List;
-
 public class HotspotClassloadingProfiler extends AbstractHotspotProfiler {
 
     public HotspotClassloadingProfiler() throws ProfilerException {
-    }
-
-    @Override
-    public List<Counter> getCounters() {
-        return AbstractHotspotProfiler.<HotspotClassLoadingMBean>getInstance("HotspotClassLoadingMBean").getInternalClassLoadingCounters();
+        super("HotspotClassLoadingMBean");
     }
 
     @Override
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotCompilationProfiler.java	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotCompilationProfiler.java	Fri Sep 22 18:11:47 2017 +0200
@@ -27,23 +27,16 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.*;
-import sun.management.HotspotCompilationMBean;
-import sun.management.counter.Counter;
 
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 public class HotspotCompilationProfiler extends AbstractHotspotProfiler {
 
     public HotspotCompilationProfiler() throws ProfilerException {
-    }
-
-    @Override
-    public List<Counter> getCounters() {
-        return AbstractHotspotProfiler.<HotspotCompilationMBean>getInstance("HotspotCompilationMBean").getInternalCompilerCounters();
+        super("HotspotCompilationMBean");
     }
 
     @Override
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotMemoryProfiler.java	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotMemoryProfiler.java	Fri Sep 22 18:11:47 2017 +0200
@@ -24,19 +24,10 @@
  */
 package org.openjdk.jmh.profile;
 
-import sun.management.HotspotMemoryMBean;
-import sun.management.counter.Counter;
-
-import java.util.List;
-
 public class HotspotMemoryProfiler extends AbstractHotspotProfiler {
 
     public HotspotMemoryProfiler() throws ProfilerException {
-    }
-
-    @Override
-    public List<Counter> getCounters() {
-        return AbstractHotspotProfiler.<HotspotMemoryMBean>getInstance("HotspotMemoryMBean").getInternalMemoryCounters();
+        super("HotspotMemoryMBean");
     }
 
     @Override
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotRuntimeProfiler.java	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotRuntimeProfiler.java	Fri Sep 22 18:11:47 2017 +0200
@@ -27,23 +27,16 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.*;
-import sun.management.HotspotRuntimeMBean;
-import sun.management.counter.Counter;
 
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 public class HotspotRuntimeProfiler extends AbstractHotspotProfiler {
 
     public HotspotRuntimeProfiler() throws ProfilerException {
-    }
-
-    @Override
-    public List<Counter> getCounters() {
-        return AbstractHotspotProfiler.<HotspotRuntimeMBean>getInstance("HotspotRuntimeMBean").getInternalRuntimeCounters();
+        super("HotspotRuntimeMBean");
     }
 
     @Override
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotThreadProfiler.java	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotThreadProfiler.java	Fri Sep 22 18:11:47 2017 +0200
@@ -27,22 +27,15 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.*;
-import sun.management.HotspotThreadMBean;
-import sun.management.counter.Counter;
 
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
 import java.util.Map;
 
 public class HotspotThreadProfiler extends AbstractHotspotProfiler {
 
     public HotspotThreadProfiler() throws ProfilerException {
-    }
-
-    @Override
-    public List<Counter> getCounters() {
-        return AbstractHotspotProfiler.<HotspotThreadMBean>getInstance("HotspotThreadMBean").getInternalThreadingCounters();
+        super("HotspotThreadMBean");
     }
 
     @Override
--- a/jmh-generator-annprocess/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-generator-annprocess/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -59,7 +59,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
                 <configuration>
                     <compilerVersion>1.7</compilerVersion>
                     <source>1.7</source>
@@ -71,7 +70,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.14.1</version>
                 <configuration>
                     <useFile>false</useFile>
                 </configuration>
@@ -80,7 +78,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
--- a/jmh-generator-asm/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-generator-asm/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -55,7 +55,6 @@
         <dependency>
             <groupId>org.ow2.asm</groupId>
             <artifactId>asm</artifactId>
-            <version>5.0.3</version>
         </dependency>
     </dependencies>
 
@@ -68,7 +67,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
                 <configuration>
                     <compilerVersion>1.7</compilerVersion>
                     <source>1.7</source>
@@ -80,7 +78,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.14.1</version>
                 <configuration>
                     <useFile>false</useFile>
                 </configuration>
@@ -89,7 +86,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
--- a/jmh-generator-bytecode/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-generator-bytecode/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -68,7 +68,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
                 <configuration>
                     <compilerVersion>1.7</compilerVersion>
                     <source>1.7</source>
@@ -80,7 +79,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.14.1</version>
                 <configuration>
                     <useFile>false</useFile>
                 </configuration>
@@ -89,7 +87,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
@@ -111,7 +108,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
-                <version>2.0</version>
                 <executions>
                     <execution>
                         <phase>package</phase>
--- a/jmh-generator-reflection/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-generator-reflection/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -58,7 +58,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
                 <configuration>
                     <compilerVersion>1.7</compilerVersion>
                     <source>1.7</source>
@@ -70,7 +69,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.14.1</version>
                 <configuration>
                     <useFile>false</useFile>
                 </configuration>
@@ -79,7 +77,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
--- a/jmh-samples/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/jmh-samples/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -73,7 +73,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.0</version>
                 <configuration>
                     <compilerVersion>1.7</compilerVersion>
                     <source>1.7</source>
@@ -83,7 +82,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.14.1</version>
                 <configuration>
                     <forkMode>always</forkMode>
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
@@ -92,7 +90,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
-                <version>2.0</version>
                 <executions>
                     <execution>
                         <phase>package</phase>
@@ -115,7 +112,6 @@
             <plugin>
                 <groupId>com.mycila.maven-license-plugin</groupId>
                 <artifactId>maven-license-plugin</artifactId>
-                <version>1.10.b1</version>
                 <executions>
                     <execution>
                         <goals>
--- a/pom.xml	Fri Sep 22 14:30:27 2017 +0200
+++ b/pom.xml	Fri Sep 22 18:11:47 2017 +0200
@@ -60,7 +60,7 @@
         <developer>
             <id>shade</id>
             <name>Aleksey Shipilev</name>
-            <organization>Oracle/Sun</organization>
+            <organization>Oracle/Sun, Red Hat</organization>
             <roles>
                 <role>current-development</role>
             </roles>
@@ -105,7 +105,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-source-plugin</artifactId>
-                <version>2.2.1</version>
                 <executions>
                     <execution>
                         <id>attach-sources</id>
@@ -121,7 +120,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.9</version>
                 <configuration>
                     <quiet>true</quiet>
                 </configuration>
@@ -140,7 +138,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-eclipse-plugin</artifactId>
-                <version>2.9</version>
                 <configuration>
                     <downloadSources>true</downloadSources>
                     <downloadJavadocs>true</downloadJavadocs>
@@ -150,7 +147,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-enforcer-plugin</artifactId>
-                <version>1.4.1</version>
                 <executions>
                     <execution>
                         <id>enforce-maven</id>
@@ -168,8 +164,128 @@
                 </executions>
             </plugin>
         </plugins>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>3.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.16</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-shade-plugin</artifactId>
+                    <version>2.2</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-enforcer-plugin</artifactId>
+                    <version>1.4.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-eclipse-plugin</artifactId>
+                    <version>2.10</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                    <version>3.0.0-M1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-source-plugin</artifactId>
+                    <version>3.0.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-resources-plugin</artifactId>
+                    <version>2.6</version>
+                </plugin>
+                <plugin>
+                    <groupId>com.mycila.maven-license-plugin</groupId>
+                    <artifactId>maven-license-plugin</artifactId>
+                    <version>1.10.b1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>build-helper-maven-plugin</artifactId>
+                    <version>1.8</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>exec-maven-plugin</artifactId>
+                    <version>1.3.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-site-plugin</artifactId>
+                    <version>3.3</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>cobertura-maven-plugin</artifactId>
+                    <version>2.6</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-jxr-plugin</artifactId>
+                    <version>2.4</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>findbugs-maven-plugin</artifactId>
+                    <version>2.5.3</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-checkstyle-plugin</artifactId>
+                    <version>2.12.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>taglist-maven-plugin</artifactId>
+                    <version>2.4</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
     </build>
 
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>junit</groupId>
+                <artifactId>junit</artifactId>
+                <version>4.10</version>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
+                <groupId>net.sf.jopt-simple</groupId>
+                <artifactId>jopt-simple</artifactId>
+                <version>4.6</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-math3</artifactId>
+                <version>3.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.ow2.asm</groupId>
+                <artifactId>asm</artifactId>
+                <version>5.0.3</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <prerequisites>
+        <maven>3.0</maven>
+    </prerequisites>
+
     <modules>
         <module>jmh-core</module>
         <module>jmh-core-it</module>