/
pom.xml
260 lines (247 loc) · 12 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<?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>
<artifactId>byte-buddy-parent</artifactId>
<groupId>net.bytebuddy</groupId>
<version>1.12.7</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 sub project 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 sub project 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>
<version.plugin.antrun>1.8</version.plugin.antrun>
<gradle.exec>gradlew</gradle.exec>
<gradle.disabled>false</gradle.disabled>
<!-- 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>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<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>--build-file=build.simple.gradle</argument>
<argument>--info</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>javadocJar</argument>
<argument>--build-file=build.simple.gradle</argument>
<argument>--info</argument>
<argument>-Dnet.bytebuddy.test.integration=${bytebuddy.integration}</argument>
<argument>-Dnet.bytebuddy.misc.extras=${bytebuddy.extras}</argument>
<argument>-Dnet.bytebuddy.gradle.source=${sourcecode.main.version}</argument>
<argument>-Dnet.bytebuddy.gradle.target=${bytecode.main.version}</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>--build-file=build.gradle</argument>
<argument>--info</argument>
<argument>-Dnet.bytebuddy.test.integration=${bytebuddy.integration}</argument>
<argument>-Dnet.bytebuddy.misc.extras=${bytebuddy.extras}</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>
<!-- Avoids triggering Gradle on JDK versions that Gradle does not currently support. -->
<profile>
<id>gradle-disabled</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>[14,)</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.buildhelp}</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>