byte-buddy-gradle-plugin
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>net.bytebuddy</groupId> <artifactId>byte-buddy-gradle-plugin</artifactId> <version>1.17.5</version> </dependency>
<?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>net.bytebuddy</groupId> <artifactId>byte-buddy-parent</artifactId> <version>1.17.5</version> </parent> <artifactId>byte-buddy-gradle-plugin</artifactId> <name>Byte Buddy Gradle plugin</name> <description>A plugin for post-processing class files via Byte Buddy in a Gradle build.</description> <!-- This subproject is built by Gradle as the Gradle plugin API requires a Gradle build. This POM triggers the Gradle build via a Gradle execution plugin in order to keep the build seamless. The built artifacts are then attached to this Maven project once the build completed successfully. IDEs are typically confused by this setup and this subproject should be directly imported as a Gradle project to avoid errors. Alternatively, this project should be ignored. When running Maven clean, this module might fail if the dependencies were never packaged before. This is due to the resolution scope of the maven-exec-plugin where the byte-buddy dependency is attempted to be resolved what fails if the project was never build on the current machine for a given snapshot version. --> <properties> <gradle.exec>gradlew</gradle.exec> <gradle.disabled>false</gradle.disabled> <gradle.release>false</gradle.release> <skipTests>false</skipTests> <androidTests>false</androidTests> <japicmp.skip>true</japicmp.skip> <!-- Actual values must be set via settings.xml or using command line arguments since they cannot be published. --> <gradle.publish.key /> <gradle.publish.secret /> </properties> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>byte-buddy</artifactId> </dependency> </dependencies> <build> <resources> <resource> <directory>src/main/resources-maven</directory> </resource> </resources> <plugins> <!-- The Gradle plugin must be built by Gradle; therefore the compilation is skipped. --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${version.plugin.compiler}</version> <configuration> <skipMain>true</skipMain> <skip>true</skip> </configuration> </plugin> <!-- Gradle is also responsible for creating javadoc such that this task is skipped here. --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>${version.plugin.javadoc}</version> <configuration> <skip>true</skip> </configuration> </plugin> <!-- Tie Maven executions into the Gradle life-cycle. --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>${version.plugin.exec}</version> <configuration> <skip>${gradle.disabled}</skip> </configuration> <executions> <execution> <id>gradle-clean</id> <phase>clean</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>${project.basedir}/${gradle.exec}</executable> <arguments> <argument>clean</argument> <argument>--info</argument> <argument>-Dnet.bytebuddy.gradle.release=${gradle.release}</argument> </arguments> </configuration> </execution> <execution> <id>gradle-build</id> <phase>compile</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>${project.basedir}/${gradle.exec}</executable> <arguments> <argument>build</argument> <argument>copyJavadoc</argument> <argument>--info</argument> <argument>-Dnet.bytebuddy.test.integration=${bytebuddy.integration}</argument> <argument>-Dnet.bytebuddy.misc.extras=${bytebuddy.extras}</argument> <argument>-Dnet.bytebuddy.gradle.release=${gradle.release}</argument> <argument>-Dnet.bytebuddy.gradle.source=${sourcecode.main.version}</argument> <argument>-Dnet.bytebuddy.gradle.target=${bytecode.main.version}</argument> <argument>-Dnet.bytebuddy.test.disabled=${skipTests}</argument> <argument>-Dnet.bytebuddy.build.gradle.android.test=${androidTests}</argument> </arguments> </configuration> </execution> <execution> <id>gradle-publish</id> <phase>deploy</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>${project.basedir}/${gradle.exec}</executable> <arguments> <argument>publishPlugins</argument> <argument>--info</argument> <argument>-Dnet.bytebuddy.test.integration=${bytebuddy.integration}</argument> <argument>-Dnet.bytebuddy.misc.extras=${bytebuddy.extras}</argument> <argument>-Dnet.bytebuddy.gradle.release=${gradle.release}</argument> <argument>-Pgradle.publish.key=${gradle.publish.key}</argument> <argument>-Pgradle.publish.secret=${gradle.publish.secret}</argument> </arguments> </configuration> </execution> </executions> </plugin> <!-- Copies the artifact created by Gradle back to the Maven target folder. --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>${version.plugin.antrun}</version> <executions> <execution> <id>copy-jar</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <skip>${gradle.disabled}</skip> <target> <copy file="${project.basedir}/build/libs/${project.artifactId}-${project.version}.jar" todir="${project.build.directory}" overwrite="true" /> </target> </configuration> </execution> </executions> </plugin> </plugins> </build> <profiles> <!-- Defines the correct Gradle wrapper binary to use when run on Windows. --> <profile> <id>gradle-windows</id> <activation> <activeByDefault>false</activeByDefault> <os> <family>Windows</family> </os> </activation> <properties> <gradle.exec>gradlew.bat</gradle.exec> </properties> </profile> <!-- Activates the Gradle release configuration. --> <profile> <id>gradle-release</id> <activation> <activeByDefault>false</activeByDefault> </activation> <properties> <gradle.release>true</gradle.release> </properties> </profile> <!-- Avoids triggering Gradle on JDK versions that Gradle does not currently support. --> <profile> <id>gradle-disabled</id> <activation> <activeByDefault>false</activeByDefault> <jdk>[22,)</jdk> </activation> <properties> <gradle.disabled>true</gradle.disabled> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>${version.plugin.antrun}</version> <executions> <execution> <id>log-skip</id> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <echo message="Skipping Gradle build since it does not support the current JDK version" /> </target> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>extras</id> <build> <plugins> <!-- If the javadoc artifact is built by Gradle, we copy it back to the Maven target. --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>${version.plugin.antrun}</version> <executions> <execution> <id>copy-javadoc</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <skip>${gradle.disabled}</skip> <target> <copy file="${project.basedir}/build/libs/${project.artifactId}-${project.version}-javadoc.jar" todir="${project.build.directory}" overwrite="true" /> </target> </configuration> </execution> </executions> </plugin> <!-- As the javadoc artifact is built by Gradle, it needs to be attached to Maven manually. --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>${version.plugin.buildhelper}</version> <executions> <execution> <phase>package</phase> <goals> <goal>attach-artifact</goal> </goals> <configuration> <artifacts> <artifact> <file>build/libs/${project.artifactId}-${project.version}-javadoc.jar</file> <type>jar</type> <classifier>javadoc</classifier> </artifact> </artifacts> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> </project>