Skip to content

Commit

Permalink
#1821 Separate optional modules by jdk versions
Browse files Browse the repository at this point in the history
Splits into 3 modules - jdk6, 7, and 8 so that each module is compiled against their specific jdk versions.
Also moves test codes in the java8-test module into their respective optional packages.
  • Loading branch information
Xylus committed Jun 2, 2016
1 parent 49eac79 commit a499dc1
Show file tree
Hide file tree
Showing 31 changed files with 291 additions and 121 deletions.
2 changes: 2 additions & 0 deletions agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler-optional</artifactId>
<type>zip</type>
<scope>runtime</scope>
</dependency>

<!-- plug-ins -->
Expand Down
12 changes: 10 additions & 2 deletions agent/src/assembly/distribution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>

<fileSets>
<fileSet>
<directory>${basedir}/src/main/resources</directory>
Expand All @@ -23,7 +23,7 @@
<outputDirectory>script</outputDirectory>
</fileSet>
</fileSets>

<dependencySets>
<dependencySet>
<includes>
Expand All @@ -42,11 +42,19 @@
<exclude>com.navercorp.pinpoint:pinpoint-bootstrap-core</exclude>
<exclude>com.navercorp.pinpoint:pinpoint-bootstrap</exclude>
<exclude>com.navercorp.pinpoint:pinpoint-plugins</exclude>
<exclude>com.navercorp.pinpoint:pinpoint-profiler-optional</exclude>
</excludes>
<outputDirectory>lib</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveFiltering>true</useTransitiveFiltering>
</dependencySet>
<dependencySet>
<includes>
<include>com.navercorp.pinpoint:pinpoint-profiler-optional</include>
</includes>
<outputDirectory>lib</outputDirectory>
<unpack>true</unpack>
</dependencySet>
<dependencySet>
<includes>
<include>com.navercorp.pinpoint:pinpoint-plugins</include>
Expand Down
1 change: 1 addition & 0 deletions plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>

</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<module>thrift</module>
<module>test</module>
<module>web</module>
<module>java8-test</module>
<module>hbase</module>
</modules>

Expand Down Expand Up @@ -144,6 +143,13 @@
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler-optional</artifactId>
<type>pom</type>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler-optional</artifactId>
<type>zip</type>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
33 changes: 8 additions & 25 deletions profiler-optional/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
# pinpoint-profiler-optional

**pinpoint-profiler-optional** is an optional package for pinpoint-profiler, adding features that are implemented using APIs available in JDK 7 or later.
Modules under **pinpoint-profiler-optional** contain optional packages for pinpoint-profiler, containing features and codes that must be compiled against specific versions of JDK.

Additionally, these optional modules may contain vendor-specific stub classes compile against.
These classes are not included in in the final jar packaging, and the vendor-specific implementations that are compiled against these stubs must be loaded with vendor-supplied implementations.

## Requirements
In order to build pinpoint-profiler-optional, the following requirements must be met:
In order to build pinpoint-profiler-optional and it's child modules, the following requirements must be met:

* JDK 7+ installed
* JDK 7 installed
* `JAVA_7_HOME` environment variable set to JDK 7 home directory

Once the `JAVA_7_HOME` environment is set, the *maven-compiler-plugin* invokes the JDK 7 compiler to compile the optional package:

```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
<debug>${compiler-debug}</debug>
<optimize>true</optimize>
<fork>true</fork>
<verbose>true</verbose>
<compilerVersion>1.7</compilerVersion>
<executable>${JAVA_7_HOME}/bin/javac</executable>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
```
* JDK 8 installed
* `JAVA_8_HOME` environment variable set to JDK 8 home directory
24 changes: 24 additions & 0 deletions profiler-optional/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">

<id>optional-projects</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<includes>
<include>${project.groupId}:pinpoint-profiler-optional-jdk6</include>
<include>${project.groupId}:pinpoint-profiler-optional-jdk7</include>
<!-- Not necessary yet -->
<!--<include>${project.groupId}:pinpoint-profiler-optional-jdk8</include>-->
</includes>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>false</useTransitiveDependencies>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
72 changes: 46 additions & 26 deletions profiler-optional/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,56 @@

<artifactId>pinpoint-profiler-optional</artifactId>
<name>pinpoint-profiler-optional</name>
<packaging>pom</packaging>
<description>pinpoint profiler optional package</description>

<properties>
<jdk.version>1.7</jdk.version>
<jdk.home>${env.JAVA_7_HOME}</jdk.home>
</properties>


<modules>
<module>profiler-optional-jdk6</module>
<module>profiler-optional-jdk7</module>
<module>profiler-optional-jdk8</module>
<module>profiler-optional-parent</module>
</modules>

<dependencies>
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-commons</artifactId>
</exclusion>
<exclusion>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-bootstrap</artifactId>
</exclusion>
<exclusion>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-rpc</artifactId>
</exclusion>
<exclusion>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-thrift</artifactId>
</exclusion>
</exclusions>
<artifactId>pinpoint-profiler-optional-jdk6</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler-optional-jdk7</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler-optional-jdk8</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>assemble-optional-projects</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/.settings/
/*.iml
/.project
/target/
/.classpath
/.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RMRqrdbgbKFhbaVnDxHUdDQvrOQXxIBklnvcmahheubVC
mh2KM35CLkwUHS4DH7QVhxy52J5hnWbyEm6Cyd3KkF<mV
RmmnSVOqOMnOnMMrmMqwXomoroNrqPNRrPSsWwtUxXuUU
sRONqpnmqmUUnqonmstsmmmmmUUnqonmstsmmmmmUUGfk
RMRqrdbgbKFhbaVnDxHUdDQvrOQXxIBklnvcmahheubVC
mh2KM35CLkwUHS4DH7QVhxy52J5hnWbyEm6Cyd3KkF<mV
RmmnSVOqOMnOnMMrmMqwXomoroNrqPNRrPSsWwtUxXuUU
sRONqpnmqmUUnqonmstsmmmmmUUnqonmstsmmmmmUUGfk
mlfkqUUnmmmm
23 changes: 23 additions & 0 deletions profiler-optional/profiler-optional-jdk6/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler-optional-parent</artifactId>
<relativePath>../profiler-optional-parent</relativePath>
<version>1.6.0-SNAPSHOT</version>
</parent>

<artifactId>pinpoint-profiler-optional-jdk6</artifactId>
<name>pinpoint-profiler-optional-jdk6</name>
<packaging>jar</packaging>
<description>pinpoint profiler optional package for jdk 6</description>

<properties>
<jdk.version>1.6</jdk.version>
<jdk.home>${env.JAVA_6_HOME}</jdk.home>
</properties>

</project>
5 changes: 5 additions & 0 deletions profiler-optional/profiler-optional-jdk7/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.settings/
/*.iml
/.project
/target/
/.classpath
5 changes: 5 additions & 0 deletions profiler-optional/profiler-optional-jdk7/clover.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RMRqrdbgbKFhbaVnDxHUdDQvrOQXxIBklnvcmahheubVC
mh2KM35CLkwUHS4DH7QVhxy52J5hnWbyEm6Cyd3KkF<mV
RmmnSVOqOMnOnMMrmMqwXomoroNrqPNRrPSsWwtUxXuUU
sRONqpnmqmUUnqonmstsmmmmmUUnqonmstsmmmmmUUGfk
mlfkqUUnmmmm
36 changes: 36 additions & 0 deletions profiler-optional/profiler-optional-jdk7/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler-optional-parent</artifactId>
<relativePath>../profiler-optional-parent</relativePath>
<version>1.6.0-SNAPSHOT</version>
</parent>

<artifactId>pinpoint-profiler-optional-jdk7</artifactId>
<name>pinpoint-profiler-optional-jdk7</name>
<packaging>jar</packaging>
<description>pinpoint profiler optional package for jdk 7</description>

<properties>
<jdk.version>1.7</jdk.version>
<jdk.home>${env.JAVA_7_HOME}</jdk.home>
</properties>

<dependencies>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-debug-all</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ public String toString() {
return "CpuLoadMetricSet for Java 1.7+";
}

}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2016 Naver Corp.
*
* Licensed 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 bug_regression_jdk7.javassist;

import bug_regression_jdk7.javassist.asm.BytecodeVerifyTestClassVisitor;
Expand Down Expand Up @@ -50,7 +66,7 @@ public void bug_regression_BytecodeVerifyError_Invalid_StackMapFrame() throws Ex
try {
Class.forName(INVALID_STACK_MAP_FRAME, true, classLoader);
Assert.fail("VerifyError");
} catch (java.lang.VerifyError e) {
} catch (VerifyError e) {
logger.debug("verifyError:{}", e.getMessage(), e);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2016 Naver Corp.
*
* Licensed 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 bug_regression_jdk7.javassist.asm;

import org.objectweb.asm.ClassVisitor;
Expand All @@ -6,8 +22,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.objectweb.asm.Opcodes.ACC_PUBLIC;

/**
* @author Woonduk Kang(emeroad)
*/
Expand All @@ -17,7 +31,7 @@ public class BytecodeVerifyTestClassVisitor extends ClassVisitor {
private String name;

public BytecodeVerifyTestClassVisitor(final ClassVisitor cv) {
super(org.objectweb.asm.Opcodes.ASM5, cv);
super(Opcodes.ASM5, cv);
}

@Override
Expand Down
File renamed without changes.
Loading

0 comments on commit a499dc1

Please # to comment.