Mr java8 (#1719) · raphw/byte-buddy@a6a286d (original) (raw)
File tree
- src/test/java/net/bytebuddy/implementation
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -155,7 +155,7 @@ jobs: | ||
| 155 | 155 | architecture: x64 |
| 156 | 156 | cache: maven |
| 157 | 157 | - name: Build project |
| 158 | -run: ./mvnw jacoco:prepare-agent verify jacoco:report coveralls:report -DrepoToken=${{ secrets.coveralls }} -Pextras -Pchecks -Panalysis -Pintegration -Pchecksum-enforce | |
| 158 | +run: ./mvnw jacoco:prepare-agent verify jacoco:report coveralls:report -DrepoToken=${{ secrets.coveralls }} -Pextras -Pchecks -Panalysis -Pintegration -Pmulti-release -Pchecksum-enforce | |
| 159 | 159 | release: |
| 160 | 160 | name: Release new version |
| 161 | 161 | runs-on: ubuntu-24.04 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -292,6 +292,17 @@ version conflicts. | ||
| 292 | 292 | |
| 293 | 293 | Please note the [security policy](https://github.com/raphw/byte-buddy/blob/master/SECURITY.md) of this project. |
| 294 | 294 | |
| 295 | +Byte Buddy supports execution on all JVM versions from version five and onwards in a single jar. This is done to ease | |
| 296 | +the development of Java agents which often require to support older, or unknown, applications which are not actively | |
| 297 | +updated. To allow for this while also supporting modern Java and features like CDS or class validation with stack | |
| 298 | +map frames, the main jars for Byte Buddy ship as multi-release jars that contain class files in version five and eight. | |
| 299 | +As a result, the jar size of Byte Buddy is higher as one would expect. Jar file size is not normally a problem, as | |
| 300 | +the majority of Byte Buddy's classes will never be loaded. Yet, file size might be an issue when distributing Java | |
| 301 | +agents. As agents already need to be bundled as a single jar, it is therefore recommended to remove either the basic | |
| 302 | +Java five version, or the multi-release Java eight version of the contained class files, to reduce this issue. This | |
| 303 | +is supported by most build plugins for this purpose, such as the | |
| 304 | +[Maven Shade plugin](https://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html#filters). | |
| 305 | + | |
| 295 | 306 | License and development |
| 296 | 307 | ----------------------- |
| 297 | 308 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -227,5 +227,32 @@ | ||
| 227 | 227 | </plugins> |
| 228 | 228 | </build> |
| 229 | 229 | </profile> |
| 230 | + <profile> | |
| 231 | + <id>multi-release</id> | |
| 232 | + <activation> | |
| 233 | + <activeByDefault>false</activeByDefault> | |
| 234 | + </activation> | |
| 235 | + <build> | |
| 236 | + <plugins> | |
| 237 | + <plugin> | |
| 238 | + <groupId>org.apache.maven.plugins</groupId> | |
| 239 | + <artifactId>maven-compiler-plugin</artifactId> | |
| 240 | + <version>${version.plugin.compiler}</version> | |
| 241 | + <executions> | |
| 242 | + <execution> | |
| 243 | + <id>java8-multi-release</id> | |
| 244 | + <goals> | |
| 245 | + <goal>compile</goal> | |
| 246 | + </goals> | |
| 247 | + <configuration> | |
| 248 | + <outputDirectory>${project.build.outputDirectory}/META-INF/versions/8</outputDirectory> | |
| 249 | + <target>1.8</target> | |
| 250 | + </configuration> | |
| 251 | + </execution> | |
| 252 | + </executions> | |
| 253 | + </plugin> | |
| 254 | + </plugins> | |
| 255 | + </build> | |
| 256 | + </profile> | |
| 230 | 257 | </profiles> |
| 231 | 258 | </project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -357,6 +357,33 @@ | ||
| 357 | 357 | </plugins> |
| 358 | 358 | </build> |
| 359 | 359 | </profile> |
| 360 | + <profile> | |
| 361 | + <id>multi-release</id> | |
| 362 | + <activation> | |
| 363 | + <activeByDefault>false</activeByDefault> | |
| 364 | + </activation> | |
| 365 | + <build> | |
| 366 | + <plugins> | |
| 367 | + <plugin> | |
| 368 | + <groupId>org.apache.maven.plugins</groupId> | |
| 369 | + <artifactId>maven-compiler-plugin</artifactId> | |
| 370 | + <version>${version.plugin.compiler}</version> | |
| 371 | + <executions> | |
| 372 | + <execution> | |
| 373 | + <id>java8-multi-release</id> | |
| 374 | + <goals> | |
| 375 | + <goal>compile</goal> | |
| 376 | + </goals> | |
| 377 | + <configuration> | |
| 378 | + <outputDirectory>${project.build.outputDirectory}/META-INF/versions/8</outputDirectory> | |
| 379 | + <target>1.8</target> | |
| 380 | + </configuration> | |
| 381 | + </execution> | |
| 382 | + </executions> | |
| 383 | + </plugin> | |
| 384 | + </plugins> | |
| 385 | + </build> | |
| 386 | + </profile> | |
| 360 | 387 | |
| 361 | 388 | <profile> |
| 362 | 389 | <id>java-4-precompile</id> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -95,7 +95,6 @@ public void testIdentityField() throws Exception { | ||
| 95 | 95 | .defineField(FOO, Object.class, Visibility.PUBLIC) |
| 96 | 96 | .method(isEquals()) |
| 97 | 97 | .intercept(EqualsMethod.isolated().withIdentityFields(named(FOO))) |
| 98 | - .visit(DebuggingWrapper.makeDefault(true)) | |
| 99 | 98 | .make() |
| 100 | 99 | .load(ClassLoadingStrategy.BOOTSTRAP_LOADER, ClassLoadingStrategy.Default.WRAPPER); |
| 101 | 100 | assertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0)); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -73,7 +73,7 @@ | ||
| 73 | 73 | <version.junit>4.13.2</version.junit> |
| 74 | 74 | <version.mockito>2.28.2</version.mockito> |
| 75 | 75 | <version.plugin.clean>3.2.0</version.plugin.clean> |
| 76 | - <version.plugin.bundle>5.1.7</version.plugin.bundle> | |
| 76 | + <version.plugin.bundle>5.1.9</version.plugin.bundle> | |
| 77 | 77 | <version.plugin.compiler>3.10.1</version.plugin.compiler> |
| 78 | 78 | <version.plugin.install>3.0.1</version.plugin.install> |
| 79 | 79 | <version.plugin.deploy>3.0.0</version.plugin.deploy> |
| @@ -183,7 +183,7 @@ | ||
| 183 | 183 | <version>${version.plugin.release}</version> |
| 184 | 184 | <configuration> |
| 185 | 185 | <useReleaseProfile>false</useReleaseProfile> |
| 186 | - <releaseProfiles>extras,gpg,gradle-release</releaseProfiles> | |
| 186 | + <releaseProfiles>extras,gpg,gradle-release,multi-release</releaseProfiles> | |
| 187 | 187 | <autoVersionSubmodules>true</autoVersionSubmodules> |
| 188 | 188 | <tagNameFormat>byte-buddy-@{project.version}</tagNameFormat> |
| 189 | 189 | </configuration> |