|
30 | 30 |
|
31 | 31 | <properties> |
32 | 32 | <quickbuild>true</quickbuild> |
| 33 | + <generatedSourceDir>${project.build.directory}/src</generatedSourceDir> |
| 34 | + <dependencyVersionDir>${project.build.directory}/versions</dependencyVersionDir> |
33 | 35 | </properties> |
34 | 36 |
|
35 | 37 | <profiles> |
|
188 | 190 | <plugin> |
189 | 191 | <artifactId>maven-dependency-plugin</artifactId> |
190 | 192 | <executions> |
| 193 | + <!-- Populate the properties whose key is groupId:artifactId:type |
| 194 | + and whose value is the path to the artifact --> |
| 195 | + <execution> |
| 196 | + <id>locate-dependencies</id> |
| 197 | + <phase>initialize</phase> |
| 198 | + <goals> |
| 199 | + <goal>properties</goal> |
| 200 | + </goals> |
| 201 | + </execution> |
| 202 | + |
| 203 | + <!-- Unpack all source files --> |
191 | 204 | <execution> |
192 | 205 | <id>unpack-sources</id> |
193 | 206 | <phase>prepare-package</phase> |
|
198 | 211 | <classifier>sources</classifier> |
199 | 212 | <includes>io/netty/**</includes> |
200 | 213 | <includeGroupIds>${project.groupId}</includeGroupIds> |
201 | | - <outputDirectory>${project.build.directory}/src</outputDirectory> |
| 214 | + <outputDirectory>${generatedSourceDir}</outputDirectory> |
202 | 215 | </configuration> |
203 | 216 | </execution> |
| 217 | + |
| 218 | + <!-- Unpack all class files --> |
204 | 219 | <execution> |
205 | 220 | <id>unpack-jars</id> |
206 | 221 | <phase>prepare-package</phase> |
|
215 | 230 | </execution> |
216 | 231 | </executions> |
217 | 232 | </plugin> |
| 233 | + |
| 234 | + <plugin> |
| 235 | + <artifactId>maven-antrun-plugin</artifactId> |
| 236 | + <executions> |
| 237 | + <!-- Instead of generating a new version property file, merge others' version property files into one. --> |
| 238 | + <execution> |
| 239 | + <id>write-version-properties</id> |
| 240 | + <phase>none</phase> |
| 241 | + </execution> |
| 242 | + <execution> |
| 243 | + <id>merge-version-properties</id> |
| 244 | + <phase>prepare-package</phase> |
| 245 | + <goals> |
| 246 | + <goal>run</goal> |
| 247 | + </goals> |
| 248 | + <configuration> |
| 249 | + <target> |
| 250 | + <taskdef resource="net/sf/antcontrib/antlib.xml" /> |
| 251 | + <propertyselector |
| 252 | + property="versions" |
| 253 | + match="^(${project.groupId}:(?!netty-example)[^:]+:jar)$" select="\1"/> |
| 254 | + <for list="${versions}" param="x"> |
| 255 | + <sequential> |
| 256 | + <unzip src="${@{x}}" dest="${dependencyVersionsDir}"> |
| 257 | + <patternset> |
| 258 | + <include name="META-INF/${project.groupId}.versions.properties"/> |
| 259 | + </patternset> |
| 260 | + </unzip> |
| 261 | + <concat destfile="${project.build.outputDirectory}/META-INF/${project.groupId}.versions.properties" |
| 262 | + append="true"> |
| 263 | + <path path="${dependencyVersionsDir}/META-INF/${project.groupId}.versions.properties"/> |
| 264 | + </concat> |
| 265 | + </sequential> |
| 266 | + </for> |
| 267 | + <delete dir="${dependencyVersionsDir}" quiet="true"/> |
| 268 | + </target> |
| 269 | + </configuration> |
| 270 | + </execution> |
| 271 | + |
| 272 | + <!-- Clean everything once finished so that IDE doesn't find the unpacked files. --> |
| 273 | + <execution> |
| 274 | + <id>clean-source-directory</id> |
| 275 | + <phase>package</phase> |
| 276 | + <goals> |
| 277 | + <goal>run</goal> |
| 278 | + </goals> |
| 279 | + <configuration> |
| 280 | + <target> |
| 281 | + <delete dir="${generatedSourceDir}" quiet="true" /> |
| 282 | + <delete dir="${dependencyVersionDir}" quiet="true" /> |
| 283 | + <delete dir="${project.build.outputDirectory}" quiet="true" /> |
| 284 | + </target> |
| 285 | + </configuration> |
| 286 | + </execution> |
| 287 | + </executions> |
| 288 | + </plugin> |
| 289 | + |
| 290 | + <!-- Include the directory where the source files were unpacked --> |
218 | 291 | <plugin> |
219 | 292 | <groupId>org.codehaus.mojo</groupId> |
220 | 293 | <artifactId>build-helper-maven-plugin</artifactId> |
|
227 | 300 | </goals> |
228 | 301 | <configuration> |
229 | 302 | <sources> |
230 | | - <source>target/src</source> |
| 303 | + <source>${generatedSourceDir}</source> |
231 | 304 | </sources> |
232 | 305 | </configuration> |
233 | 306 | </execution> |
234 | 307 | </executions> |
235 | 308 | </plugin> |
236 | 309 |
|
| 310 | + <!-- Disable OSGi bundle manifest generation --> |
| 311 | + <plugin> |
| 312 | + <groupId>org.apache.felix</groupId> |
| 313 | + <artifactId>maven-bundle-plugin</artifactId> |
| 314 | + <executions> |
| 315 | + <execution> |
| 316 | + <id>generate-manifest</id> |
| 317 | + <phase>none</phase> |
| 318 | + </execution> |
| 319 | + </executions> |
| 320 | + </plugin> |
| 321 | + <!-- Override the default JAR configuration --> |
| 322 | + <plugin> |
| 323 | + <artifactId>maven-jar-plugin</artifactId> |
| 324 | + <executions> |
| 325 | + <execution> |
| 326 | + <id>default-jar</id> |
| 327 | + <phase>none</phase> |
| 328 | + </execution> |
| 329 | + <execution> |
| 330 | + <id>all-in-one-jar</id> |
| 331 | + <phase>package</phase> |
| 332 | + <goals> |
| 333 | + <goal>jar</goal> |
| 334 | + </goals> |
| 335 | + <configuration> |
| 336 | + <archive> |
| 337 | + <manifest> |
| 338 | + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> |
| 339 | + </manifest> |
| 340 | + <index>true</index> |
| 341 | + </archive> |
| 342 | + </configuration> |
| 343 | + </execution> |
| 344 | + </executions> |
| 345 | + </plugin> |
| 346 | + |
237 | 347 | <!-- Disable animal sniffer --> |
238 | 348 | <plugin> |
239 | 349 | <groupId>org.codehaus.mojo</groupId> |
|
245 | 355 | </execution> |
246 | 356 | </executions> |
247 | 357 | </plugin> |
| 358 | + |
248 | 359 | <!-- Disable checkstyle --> |
249 | 360 | <plugin> |
250 | 361 | <artifactId>maven-checkstyle-plugin</artifactId> |
|
255 | 366 | </execution> |
256 | 367 | </executions> |
257 | 368 | </plugin> |
| 369 | + |
258 | 370 | <!-- Disable all plugin executions configured by jar packaging --> |
259 | 371 | <plugin> |
260 | 372 | <artifactId>maven-resources-plugin</artifactId> |
|
291 | 403 | </execution> |
292 | 404 | </executions> |
293 | 405 | </plugin> |
| 406 | + |
| 407 | + <!-- Generate Xref --> |
294 | 408 | <plugin> |
295 | 409 | <artifactId>maven-jxr-plugin</artifactId> |
296 | 410 | <executions> |
|
318 | 432 | </dependency> |
319 | 433 | </dependencies> |
320 | 434 | </plugin> |
| 435 | + |
| 436 | + <!-- Generate Javadoc --> |
321 | 437 | <plugin> |
322 | 438 | <artifactId>maven-javadoc-plugin</artifactId> |
323 | 439 | <executions> |
|
333 | 449 | <excludePackageNames>*.internal,*.example</excludePackageNames> |
334 | 450 | <docfilessubdirs>true</docfilessubdirs> |
335 | 451 | <outputDirectory>${project.build.directory}/api</outputDirectory> |
336 | | - <overview>${basedir}/src/javadoc/overview.html</overview> |
| 452 | + <overview>${project.basedir}/src/javadoc/overview.html</overview> |
337 | 453 | <doctitle>Netty API Reference (${project.version})</doctitle> |
338 | 454 | <windowtitle>Netty API Reference (${project.version})</windowtitle> |
339 | 455 | <detectJavaApiLink>false</detectJavaApiLink> |
|
354 | 470 | <locale>en_US</locale> |
355 | 471 | </configuration> |
356 | 472 | </plugin> |
357 | | - <plugin> |
358 | | - <artifactId>maven-antrun-plugin</artifactId> |
359 | | - <executions> |
360 | | - <execution> |
361 | | - <id>clean-source-directory</id> |
362 | | - <phase>package</phase> |
363 | | - <goals> |
364 | | - <goal>run</goal> |
365 | | - </goals> |
366 | | - </execution> |
367 | | - </executions> |
368 | | - <configuration> |
369 | | - <target> |
370 | | - <delete dir="${project.build.directory}/src" quiet="true" /> |
371 | | - <delete dir="${project.build.directory}/classes" quiet="true" /> |
372 | | - </target> |
373 | | - </configuration> |
374 | | - </plugin> |
375 | 473 | </plugins> |
376 | 474 | </build> |
377 | 475 | </project> |
|
0 commit comments