@@ -372,11 +372,11 @@ To run a project in place without building a jar first you can use the ``bootRun
372
372
Running this way makes your static classpath resources (i.e. in `src/main/resources` by
373
373
default) reloadable in the live application, which can be helpful at development time.
374
374
375
- [[build-tool-plugins-gradle-repackage -configuration]]
376
- === Repackage configuration
375
+ [[build-tool-plugins-gradle-global -configuration]]
376
+ === Spring Boot Plugin configuration
377
377
The gradle plugin automatically extends your build script DSL with a `springBoot` element
378
- for configuration. Simply set the appropriate properties as you would with any other Gradle
379
- extension (see below for a list of configuration options):
378
+ for global configuration of the Boot plugin. Set the appropriate properties as you would
379
+ with any other Gradle extension (see below for a list of configuration options):
380
380
381
381
[source,groovy,indent=0,subs="verbatim,attributes"]
382
382
----
@@ -386,6 +386,47 @@ extension (see below for a list of configuration options):
386
386
----
387
387
388
388
389
+ [[build-tool-plugins-gradle-repackage-configuration]]
390
+ === Repackage configuration
391
+ The plugin adds a `bootRepackage` task which you can also configure directly, e.g.:
392
+
393
+ [source,groovy,indent=0,subs="verbatim,attributes"]
394
+ ----
395
+ bootRepackage {
396
+ mainClass = 'demo.Application'
397
+ }
398
+ ----
399
+
400
+ The following configuration options are available:
401
+
402
+ [cols="2,4"]
403
+ |===
404
+ |Name |Description
405
+
406
+ |`mainClass`
407
+ |The main class that should be run. If not specified the `mainClassName` project property
408
+ will be used or, if the no `mainClassName` id defined the archive will be searched for a
409
+ suitable class. "Suitable" means a unique class with a well-formed `main()` method (if
410
+ more than one is found the build will fail). You should also be able to specify the main
411
+ class name via the "run" task (`main` property) and/or the "startScripts" (`mainClassName`
412
+ property) as an alternative to using the "springBoot" configuration.
413
+
414
+ |`classifier`
415
+ |A file name segment (before the extension) to add to the archive, so that the original is
416
+ preserved in its original location. Defaults to null in which case the archive is repackaged
417
+ in place. The default is convenient for many purposes, but if you want to use the
418
+ original jar as a dependency in another project, it's best to use an extension to define the
419
+ executable archive.
420
+
421
+ |`withJarTask`
422
+ |The name of the `Jar` task (defaults to all) which is used to locate the archive to repackage.
423
+
424
+ |`customConfiguration`
425
+ |The name of the custom configuration whuch is used to populate the nested lib directory
426
+ (without specifying this you get all compile and runtime dependencies).
427
+
428
+ |===
429
+
389
430
390
431
[[build-tool-plugins-gradle-repackage-custom-configuration]]
391
432
=== Repackage with custom Gradle configuration
@@ -449,12 +490,7 @@ The following configuration options are available:
449
490
|Name |Description
450
491
451
492
|`mainClass`
452
- |The main class that should be run. If not specified the `mainClassName` project property
453
- will be used or, if the no `mainClassName` id defined the archive will be searched for a
454
- suitable class. "Suitable" means a unique class with a well-formed `main()` method (if
455
- more than one is found the build will fail). You should also be able to specify the main
456
- class name via the "run" task (`main` property) and/or the "startScripts" (`mainClassName`
457
- property) as an alternative to using the "springBoot" configuration.
493
+ |The main class that should be run by the executable archive.
458
494
459
495
|`providedConfiguration`
460
496
|The name of the provided configuration (defaults to `providedRuntime`).
@@ -486,7 +522,7 @@ usually this is not an issue; however, if you are planning to create a more comp
486
522
project setup, with custom `Jar` and `BootRepackage` tasks, there are few tweaks to
487
523
consider.
488
524
489
- If you are 'just' creating custom jar files from your project you can simply disables
525
+ If you are 'just' creating custom jar files from your project you can simply disable
490
526
default `jar` and `bootRepackage` tasks:
491
527
492
528
[source,groovy,indent=0,subs="verbatim,attributes"]
0 commit comments