|
14 | 14 | import java.util.Properties;
|
15 | 15 | import java.util.Set;
|
16 | 16 | import java.util.concurrent.ExecutionException;
|
| 17 | +import java.util.function.Consumer; |
17 | 18 |
|
18 | 19 | import javax.inject.Inject;
|
19 | 20 | import javax.inject.Named;
|
@@ -126,7 +127,13 @@ public QuarkusMavenAppBootstrap bootstrapper(QuarkusBootstrapMojo mojo) {
|
126 | 127 |
|
127 | 128 | public CuratedApplication bootstrapApplication(QuarkusBootstrapMojo mojo, LaunchMode mode)
|
128 | 129 | throws MojoExecutionException {
|
129 |
| - return bootstrapper(mojo).bootstrapApplication(mojo, mode); |
| 130 | + return bootstrapApplication(mojo, mode, null); |
| 131 | + } |
| 132 | + |
| 133 | + public CuratedApplication bootstrapApplication(QuarkusBootstrapMojo mojo, LaunchMode mode, |
| 134 | + Consumer<QuarkusBootstrap.Builder> builderCustomizer) |
| 135 | + throws MojoExecutionException { |
| 136 | + return bootstrapper(mojo).bootstrapApplication(mojo, mode, builderCustomizer); |
130 | 137 | }
|
131 | 138 |
|
132 | 139 | public ApplicationModel getResolvedApplicationModel(ArtifactKey projectId, LaunchMode mode, String bootstrapId) {
|
@@ -203,7 +210,8 @@ private MavenArtifactResolver artifactResolver(QuarkusBootstrapMojo mojo, Launch
|
203 | 210 | }
|
204 | 211 | }
|
205 | 212 |
|
206 |
| - private CuratedApplication doBootstrap(QuarkusBootstrapMojo mojo, LaunchMode mode) |
| 213 | + private CuratedApplication doBootstrap(QuarkusBootstrapMojo mojo, LaunchMode mode, |
| 214 | + Consumer<QuarkusBootstrap.Builder> builderCustomizer) |
207 | 215 | throws MojoExecutionException {
|
208 | 216 |
|
209 | 217 | final BootstrapAppModelResolver modelResolver = new BootstrapAppModelResolver(artifactResolver(mojo, mode))
|
@@ -253,6 +261,9 @@ private CuratedApplication doBootstrap(QuarkusBootstrapMojo mojo, LaunchMode mod
|
253 | 261 | .setForcedDependencies(forcedDependencies);
|
254 | 262 |
|
255 | 263 | try {
|
| 264 | + if (builderCustomizer != null) { |
| 265 | + builderCustomizer.accept(builder); |
| 266 | + } |
256 | 267 | return builder.build().bootstrap();
|
257 | 268 | } catch (BootstrapException e) {
|
258 | 269 | throw new MojoExecutionException("Failed to bootstrap the application", e);
|
@@ -346,15 +357,16 @@ private String toManifestSectionAttributeKey(String section, String key) throws
|
346 | 357 | key);
|
347 | 358 | }
|
348 | 359 |
|
349 |
| - protected CuratedApplication bootstrapApplication(QuarkusBootstrapMojo mojo, LaunchMode mode) |
| 360 | + protected CuratedApplication bootstrapApplication(QuarkusBootstrapMojo mojo, LaunchMode mode, |
| 361 | + Consumer<QuarkusBootstrap.Builder> builderCustomizer) |
350 | 362 | throws MojoExecutionException {
|
351 | 363 | if (mode == LaunchMode.DEVELOPMENT) {
|
352 |
| - return devApp == null ? devApp = doBootstrap(mojo, mode) : devApp; |
| 364 | + return devApp == null ? devApp = doBootstrap(mojo, mode, builderCustomizer) : devApp; |
353 | 365 | }
|
354 | 366 | if (mode == LaunchMode.TEST) {
|
355 |
| - return testApp == null ? testApp = doBootstrap(mojo, mode) : testApp; |
| 367 | + return testApp == null ? testApp = doBootstrap(mojo, mode, builderCustomizer) : testApp; |
356 | 368 | }
|
357 |
| - return prodApp == null ? prodApp = doBootstrap(mojo, mode) : prodApp; |
| 369 | + return prodApp == null ? prodApp = doBootstrap(mojo, mode, builderCustomizer) : prodApp; |
358 | 370 | }
|
359 | 371 |
|
360 | 372 | protected ArtifactCoords managingProject(QuarkusBootstrapMojo mojo) {
|
|
0 commit comments