Skip to content

Commit 42d5555

Browse files
committed
Inline constants in AbstractGenerateMojo
1 parent 364f374 commit 42d5555

1 file changed

Lines changed: 21 additions & 28 deletions

File tree

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/mojo/AbstractGenerateMojo.java

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@
6161
*/
6262
public abstract class AbstractGenerateMojo extends AbstractMojo {
6363

64-
private static final String DEFAULT_FALSE = "false";
65-
private static final String DEFAULT_TRUE = "true";
66-
private static final String DEFAULT_TRANSITIVE = "TRANSITIVE";
67-
68-
private static final String COMPILER_VERSION_PROPERTY = "protobuf.compiler.version";
69-
70-
private static final Logger log = LoggerFactory.getLogger(AbstractGenerateMojo.class);
7164

7265
public AbstractGenerateMojo() {
7366
// Nothing to do here.
@@ -129,7 +122,7 @@ public AbstractGenerateMojo() {
129122
*
130123
* @since 3.6.0
131124
*/
132-
@Parameter(defaultValue = DEFAULT_FALSE)
125+
@Parameter(defaultValue = "false")
133126
boolean cleanOutputDirectories;
134127

135128
/**
@@ -145,7 +138,7 @@ public AbstractGenerateMojo() {
145138
*
146139
* @since 1.2.0
147140
*/
148-
@Parameter(defaultValue = DEFAULT_TRANSITIVE)
141+
@Parameter(defaultValue = "TRANSITIVE")
149142
DependencyResolutionDepth dependencyResolutionDepth;
150143

151144
/**
@@ -176,7 +169,7 @@ public AbstractGenerateMojo() {
176169
*
177170
* @since 2.1.0
178171
*/
179-
@Parameter(defaultValue = DEFAULT_TRUE)
172+
@Parameter(defaultValue = "true")
180173
boolean embedSourcesInClassOutputs;
181174

182175
/**
@@ -241,7 +234,7 @@ public AbstractGenerateMojo() {
241234
*
242235
* @since 0.5.0
243236
*/
244-
@Parameter(defaultValue = DEFAULT_TRUE)
237+
@Parameter(defaultValue = "true")
245238
boolean failOnMissingSources;
246239

247240
/**
@@ -254,7 +247,7 @@ public AbstractGenerateMojo() {
254247
*
255248
* @since 2.0.0
256249
*/
257-
@Parameter(defaultValue = DEFAULT_TRUE)
250+
@Parameter(defaultValue = "true")
258251
boolean failOnMissingTargets;
259252

260253
/**
@@ -265,7 +258,7 @@ public AbstractGenerateMojo() {
265258
*
266259
* @since 0.0.1
267260
*/
268-
@Parameter(defaultValue = DEFAULT_FALSE)
261+
@Parameter(defaultValue = "false")
269262
boolean fatalWarnings;
270263

271264
/**
@@ -277,7 +270,7 @@ public AbstractGenerateMojo() {
277270
*
278271
* @since 1.2.0
279272
*/
280-
@Parameter(defaultValue = DEFAULT_FALSE)
273+
@Parameter(defaultValue = "false")
281274
boolean ignoreProjectDependencies;
282275

283276
/**
@@ -379,7 +372,7 @@ public AbstractGenerateMojo() {
379372
*
380373
* @since 2.7.0
381374
*/
382-
@Parameter(defaultValue = DEFAULT_TRUE, property = "protobuf.compiler.incremental")
375+
@Parameter(defaultValue = "true", property = "protobuf.compiler.incremental")
383376
boolean incrementalCompilation;
384377

385378
/**
@@ -390,7 +383,7 @@ public AbstractGenerateMojo() {
390383
*
391384
* @since 0.1.1
392385
*/
393-
@Parameter(defaultValue = DEFAULT_TRUE)
386+
@Parameter(defaultValue = "true")
394387
boolean javaEnabled;
395388

396389
/**
@@ -401,7 +394,7 @@ public AbstractGenerateMojo() {
401394
*
402395
* @since 0.1.0
403396
*/
404-
@Parameter(defaultValue = DEFAULT_FALSE)
397+
@Parameter(defaultValue = "false")
405398
boolean kotlinEnabled;
406399

407400
/**
@@ -414,7 +407,7 @@ public AbstractGenerateMojo() {
414407
*
415408
* @since 0.0.1
416409
*/
417-
@Parameter(defaultValue = DEFAULT_FALSE)
410+
@Parameter(defaultValue = "false")
418411
boolean liteOnly;
419412

420413
/**
@@ -441,7 +434,7 @@ public AbstractGenerateMojo() {
441434
* @see #outputDescriptorFile
442435
* @since 2.11.0
443436
*/
444-
@Parameter(defaultValue = DEFAULT_FALSE)
437+
@Parameter(defaultValue = "false")
445438
boolean outputDescriptorAttached;
446439

447440
/**
@@ -478,7 +471,7 @@ public AbstractGenerateMojo() {
478471
* @see #outputDescriptorFile
479472
* @since 2.10.0
480473
*/
481-
@Parameter(defaultValue = DEFAULT_FALSE)
474+
@Parameter(defaultValue = "false")
482475
boolean outputDescriptorIncludeImports;
483476

484477
/**
@@ -490,7 +483,7 @@ public AbstractGenerateMojo() {
490483
* @see #outputDescriptorFile
491484
* @since 2.10.0
492485
*/
493-
@Parameter(defaultValue = DEFAULT_FALSE)
486+
@Parameter(defaultValue = "false")
494487
boolean outputDescriptorIncludeSourceInfo;
495488

496489
/**
@@ -501,7 +494,7 @@ public AbstractGenerateMojo() {
501494
* @see #outputDescriptorFile
502495
* @since 2.10.0
503496
*/
504-
@Parameter(defaultValue = DEFAULT_FALSE)
497+
@Parameter(defaultValue = "false")
505498
boolean outputDescriptorRetainOptions;
506499

507500
/**
@@ -579,7 +572,7 @@ public AbstractGenerateMojo() {
579572
@Parameter(
580573
alias = "protocVersion",
581574
required = true,
582-
property = COMPILER_VERSION_PROPERTY
575+
property = "protobuf.compiler.version"
583576
)
584577
String protoc;
585578

@@ -591,7 +584,7 @@ public AbstractGenerateMojo() {
591584
*
592585
* @since 1.1.0
593586
*/
594-
@Parameter(defaultValue = DEFAULT_FALSE)
587+
@Parameter(defaultValue = "false")
595588
boolean pythonEnabled;
596589

597590
/**
@@ -603,7 +596,7 @@ public AbstractGenerateMojo() {
603596
*
604597
* @since 1.1.0
605598
*/
606-
@Parameter(defaultValue = DEFAULT_FALSE)
599+
@Parameter(defaultValue = "false")
607600
boolean pythonStubsEnabled;
608601

609602
/**
@@ -617,15 +610,15 @@ public AbstractGenerateMojo() {
617610
*
618611
* @since 0.5.0
619612
*/
620-
@Parameter(defaultValue = DEFAULT_TRUE)
613+
@Parameter(defaultValue = "true")
621614
boolean registerAsCompilationRoot;
622615

623616
/**
624617
* Generate Ruby sources from the protobuf sources.
625618
*
626619
* @since 1.1.0
627620
*/
628-
@Parameter(defaultValue = DEFAULT_FALSE)
621+
@Parameter(defaultValue = "false")
629622
boolean rubyEnabled;
630623

631624
/**
@@ -653,7 +646,7 @@ public AbstractGenerateMojo() {
653646
*
654647
* @since 2.0.0
655648
*/
656-
@Parameter(defaultValue = DEFAULT_FALSE, property = "protobuf.skip")
649+
@Parameter(defaultValue = "false", property = "protobuf.skip")
657650
boolean skip;
658651

659652
/**

0 commit comments

Comments
 (0)