Skip to content

Commit ad63ac5

Browse files
authored
guicify (#229)
1 parent 5a4d136 commit ad63ac5

23 files changed

+201
-9
lines changed

maven-scm-plugin/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@
129129
<artifactId>maven-plugin-annotations</artifactId>
130130
<scope>provided</scope>
131131
</dependency>
132+
<dependency>
133+
<groupId>javax.inject</groupId>
134+
<artifactId>javax.inject</artifactId>
135+
<version>1</version>
136+
<scope>provided</scope>
137+
</dependency>
132138

133139
<!-- Test -->
134140
<dependency>

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.apache.commons.lang3.StringUtils;
3232
import org.apache.maven.plugin.AbstractMojo;
3333
import org.apache.maven.plugin.MojoExecutionException;
34-
import org.apache.maven.plugins.annotations.Component;
3534
import org.apache.maven.plugins.annotations.Parameter;
3635
import org.apache.maven.scm.ScmBranch;
3736
import org.apache.maven.scm.ScmException;
@@ -138,12 +137,6 @@ public abstract class AbstractScmMojo extends AbstractMojo {
138137
@Parameter(property = "excludes")
139138
private String excludes;
140139

141-
@Component
142-
private ScmManager manager;
143-
144-
@Component
145-
private SettingsDecrypter settingsDecrypter;
146-
147140
/**
148141
* The base directory.
149142
*/
@@ -186,6 +179,15 @@ public abstract class AbstractScmMojo extends AbstractMojo {
186179
@Deprecated
187180
private String workItem;
188181

182+
private final ScmManager manager;
183+
184+
private final SettingsDecrypter settingsDecrypter;
185+
186+
protected AbstractScmMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
187+
this.manager = manager;
188+
this.settingsDecrypter = settingsDecrypter;
189+
}
190+
189191
/** {@inheritDoc} */
190192
public void execute() throws MojoExecutionException {
191193
if (systemProperties != null) {

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AddMojo.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@
1818
*/
1919
package org.apache.maven.scm.plugin;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.IOException;
2224

2325
import org.apache.maven.plugin.MojoExecutionException;
2426
import org.apache.maven.plugins.annotations.Mojo;
2527
import org.apache.maven.scm.ScmException;
2628
import org.apache.maven.scm.command.add.AddScmResult;
29+
import org.apache.maven.scm.manager.ScmManager;
2730
import org.apache.maven.scm.repository.ScmRepository;
31+
import org.apache.maven.settings.crypto.SettingsDecrypter;
2832

2933
/**
3034
* Add a file set to the project.
@@ -33,6 +37,12 @@
3337
*/
3438
@Mojo(name = "add", aggregator = true)
3539
public class AddMojo extends AbstractScmMojo {
40+
41+
@Inject
42+
public AddMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
43+
super(manager, settingsDecrypter);
44+
}
45+
3646
/** {@inheritDoc} */
3747
public void execute() throws MojoExecutionException {
3848
super.execute();

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.apache.maven.scm.plugin;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.File;
2224

2325
import org.apache.commons.lang3.StringUtils;
@@ -26,6 +28,8 @@
2628
import org.apache.maven.plugins.annotations.Parameter;
2729
import org.apache.maven.scm.ScmResult;
2830
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
31+
import org.apache.maven.scm.manager.ScmManager;
32+
import org.apache.maven.settings.crypto.SettingsDecrypter;
2933
import org.codehaus.plexus.util.Os;
3034
import org.codehaus.plexus.util.cli.CommandLineException;
3135
import org.codehaus.plexus.util.cli.CommandLineUtils;
@@ -40,6 +44,7 @@
4044
*/
4145
@Mojo(name = "bootstrap", requiresProject = false)
4246
public class BootstrapMojo extends CheckoutMojo {
47+
4348
/**
4449
* The goals to run on the clean checkout of a project for the bootstrap goal.
4550
* If none are specified, then the default goal for the project is executed.
@@ -69,6 +74,11 @@ public class BootstrapMojo extends CheckoutMojo {
6974
@Parameter(property = "mavenHome", defaultValue = "${maven.home}")
7075
private File mavenHome;
7176

77+
@Inject
78+
public BootstrapMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
79+
super(manager, settingsDecrypter);
80+
}
81+
7282
/** {@inheritDoc} */
7383
public void execute() throws MojoExecutionException {
7484
super.execute();

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BranchMojo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.apache.maven.scm.plugin;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.IOException;
2224

2325
import org.apache.maven.plugin.MojoExecutionException;
@@ -26,8 +28,10 @@
2628
import org.apache.maven.scm.ScmBranchParameters;
2729
import org.apache.maven.scm.ScmException;
2830
import org.apache.maven.scm.command.branch.BranchScmResult;
31+
import org.apache.maven.scm.manager.ScmManager;
2932
import org.apache.maven.scm.provider.ScmProvider;
3033
import org.apache.maven.scm.repository.ScmRepository;
34+
import org.apache.maven.settings.crypto.SettingsDecrypter;
3135

3236
/**
3337
* Branch the project.
@@ -68,6 +72,11 @@ public class BranchMojo extends AbstractScmMojo {
6872
@Parameter(property = "pinExternals", defaultValue = "false")
6973
private boolean pinExternals;
7074

75+
@Inject
76+
public BranchMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
77+
super(manager, settingsDecrypter);
78+
}
79+
7180
/** {@inheritDoc} */
7281
public void execute() throws MojoExecutionException {
7382
super.execute();

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ChangeLogMojo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.apache.maven.scm.plugin;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.IOException;
2224
import java.text.ParseException;
2325
import java.text.SimpleDateFormat;
@@ -33,8 +35,10 @@
3335
import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
3436
import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
3537
import org.apache.maven.scm.command.changelog.ChangeLogSet;
38+
import org.apache.maven.scm.manager.ScmManager;
3639
import org.apache.maven.scm.provider.ScmProvider;
3740
import org.apache.maven.scm.repository.ScmRepository;
41+
import org.apache.maven.settings.crypto.SettingsDecrypter;
3842

3943
/**
4044
* Dump changelog contents to console. It is mainly used to test maven-scm-api's changelog command.
@@ -125,6 +129,11 @@ public class ChangeLogMojo extends AbstractScmMojo {
125129
@Parameter(property = "numDays")
126130
private Integer numDays;
127131

132+
@Inject
133+
public ChangeLogMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
134+
super(manager, settingsDecrypter);
135+
}
136+
128137
/**
129138
* {@inheritDoc}
130139
*/

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@
1818
*/
1919
package org.apache.maven.scm.plugin;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.IOException;
2224

2325
import org.apache.maven.plugin.MojoExecutionException;
2426
import org.apache.maven.plugins.annotations.Mojo;
2527
import org.apache.maven.plugins.annotations.Parameter;
2628
import org.apache.maven.scm.ScmException;
2729
import org.apache.maven.scm.command.status.StatusScmResult;
30+
import org.apache.maven.scm.manager.ScmManager;
2831
import org.apache.maven.scm.repository.ScmRepository;
32+
import org.apache.maven.settings.crypto.SettingsDecrypter;
2933

3034
/**
3135
* This mojo will fail the build if there is any local modifications
@@ -50,6 +54,11 @@ public class CheckLocalModificationsMojo extends AbstractScmMojo {
5054
@Parameter(property = "scm.checkLocalModification.skip", defaultValue = "false")
5155
private boolean skip;
5256

57+
@Inject
58+
public CheckLocalModificationsMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
59+
super(manager, settingsDecrypter);
60+
}
61+
5362
public void execute() throws MojoExecutionException {
5463
if (skip) {
5564
getLog().info("check-local-modification execution has been skipped");

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@
1818
*/
1919
package org.apache.maven.scm.plugin;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.IOException;
2224

2325
import org.apache.maven.plugin.MojoExecutionException;
2426
import org.apache.maven.plugins.annotations.Mojo;
2527
import org.apache.maven.plugins.annotations.Parameter;
2628
import org.apache.maven.scm.ScmException;
2729
import org.apache.maven.scm.command.checkin.CheckInScmResult;
30+
import org.apache.maven.scm.manager.ScmManager;
2831
import org.apache.maven.scm.repository.ScmRepository;
32+
import org.apache.maven.settings.crypto.SettingsDecrypter;
2933

3034
/**
3135
* Commit changes to the configured scm url.
@@ -58,6 +62,11 @@ public class CheckinMojo extends AbstractScmMojo {
5862
@Parameter(property = "scmVersion")
5963
private String scmVersion;
6064

65+
@Inject
66+
public CheckinMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
67+
super(manager, settingsDecrypter);
68+
}
69+
6170
/** {@inheritDoc} */
6271
public void execute() throws MojoExecutionException {
6372
super.execute();

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.apache.maven.scm.plugin;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.File;
2224
import java.io.IOException;
2325

@@ -27,7 +29,9 @@
2729
import org.apache.maven.scm.ScmException;
2830
import org.apache.maven.scm.ScmFileSet;
2931
import org.apache.maven.scm.ScmResult;
32+
import org.apache.maven.scm.manager.ScmManager;
3033
import org.apache.maven.scm.repository.ScmRepository;
34+
import org.apache.maven.settings.crypto.SettingsDecrypter;
3135
import org.codehaus.plexus.util.FileUtils;
3236

3337
/**
@@ -72,6 +76,11 @@ public class CheckoutMojo extends AbstractScmMojo {
7276
*/
7377
private ScmResult checkoutResult;
7478

79+
@Inject
80+
public CheckoutMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
81+
super(manager, settingsDecrypter);
82+
}
83+
7584
/** {@inheritDoc} */
7685
public void execute() throws MojoExecutionException {
7786
super.execute();

maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.apache.maven.scm.plugin;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.File;
2224
import java.io.IOException;
2325

@@ -26,7 +28,9 @@
2628
import org.apache.maven.plugins.annotations.Parameter;
2729
import org.apache.maven.scm.ScmException;
2830
import org.apache.maven.scm.command.diff.DiffScmResult;
31+
import org.apache.maven.scm.manager.ScmManager;
2932
import org.apache.maven.scm.repository.ScmRepository;
33+
import org.apache.maven.settings.crypto.SettingsDecrypter;
3034
import org.codehaus.plexus.util.FileUtils;
3135

3236
/**
@@ -66,6 +70,11 @@ public class DiffMojo extends AbstractScmMojo {
6670
@Parameter(property = "outputFile", defaultValue = "${project.artifactId}.diff")
6771
private File outputFile;
6872

73+
@Inject
74+
public DiffMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
75+
super(manager, settingsDecrypter);
76+
}
77+
6978
/** {@inheritDoc} */
7079
public void execute() throws MojoExecutionException {
7180
super.execute();

0 commit comments

Comments
 (0)