diff --git a/maven-scm-plugin/pom.xml b/maven-scm-plugin/pom.xml
index 6ac0b69ec..12076059c 100644
--- a/maven-scm-plugin/pom.xml
+++ b/maven-scm-plugin/pom.xml
@@ -129,6 +129,12 @@
maven-plugin-annotations
provided
+
+ javax.inject
+ javax.inject
+ 1
+ provided
+
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
index e8c2527b3..c8cdda42d 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
@@ -31,7 +31,6 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.scm.ScmBranch;
import org.apache.maven.scm.ScmException;
@@ -138,12 +137,6 @@ public abstract class AbstractScmMojo extends AbstractMojo {
@Parameter(property = "excludes")
private String excludes;
- @Component
- private ScmManager manager;
-
- @Component
- private SettingsDecrypter settingsDecrypter;
-
/**
* The base directory.
*/
@@ -186,6 +179,15 @@ public abstract class AbstractScmMojo extends AbstractMojo {
@Deprecated
private String workItem;
+ private final ScmManager manager;
+
+ private final SettingsDecrypter settingsDecrypter;
+
+ protected AbstractScmMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ this.manager = manager;
+ this.settingsDecrypter = settingsDecrypter;
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
if (systemProperties != null) {
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AddMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AddMojo.java
index 9ce8675fc..a4145e001 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AddMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AddMojo.java
@@ -18,13 +18,17 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Add a file set to the project.
@@ -33,6 +37,12 @@
*/
@Mojo(name = "add", aggregator = true)
public class AddMojo extends AbstractScmMojo {
+
+ @Inject
+ public AddMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java
index 8e6b0ec6b..b8a76a9b8 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.File;
import org.apache.commons.lang3.StringUtils;
@@ -26,6 +28,8 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.codehaus.plexus.util.Os;
import org.codehaus.plexus.util.cli.CommandLineException;
import org.codehaus.plexus.util.cli.CommandLineUtils;
@@ -40,6 +44,7 @@
*/
@Mojo(name = "bootstrap", requiresProject = false)
public class BootstrapMojo extends CheckoutMojo {
+
/**
* The goals to run on the clean checkout of a project for the bootstrap goal.
* If none are specified, then the default goal for the project is executed.
@@ -69,6 +74,11 @@ public class BootstrapMojo extends CheckoutMojo {
@Parameter(property = "mavenHome", defaultValue = "${maven.home}")
private File mavenHome;
+ @Inject
+ public BootstrapMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BranchMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BranchMojo.java
index c3efdd152..3ac8e46b1 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BranchMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BranchMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
@@ -26,8 +28,10 @@
import org.apache.maven.scm.ScmBranchParameters;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.branch.BranchScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.ScmProvider;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Branch the project.
@@ -68,6 +72,11 @@ public class BranchMojo extends AbstractScmMojo {
@Parameter(property = "pinExternals", defaultValue = "false")
private boolean pinExternals;
+ @Inject
+ public BranchMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ChangeLogMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ChangeLogMojo.java
index 172ace987..a91158e20 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ChangeLogMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ChangeLogMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -33,8 +35,10 @@
import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogSet;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.ScmProvider;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* 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 {
@Parameter(property = "numDays")
private Integer numDays;
+ @Inject
+ public ChangeLogMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java
index 32500c438..1e22fac0d 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
@@ -25,7 +27,9 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* This mojo will fail the build if there is any local modifications
@@ -50,6 +54,11 @@ public class CheckLocalModificationsMojo extends AbstractScmMojo {
@Parameter(property = "scm.checkLocalModification.skip", defaultValue = "false")
private boolean skip;
+ @Inject
+ public CheckLocalModificationsMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
public void execute() throws MojoExecutionException {
if (skip) {
getLog().info("check-local-modification execution has been skipped");
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java
index 508303d16..ed3ed12ff 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
@@ -25,7 +27,9 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.checkin.CheckInScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Commit changes to the configured scm url.
@@ -58,6 +62,11 @@ public class CheckinMojo extends AbstractScmMojo {
@Parameter(property = "scmVersion")
private String scmVersion;
+ @Inject
+ public CheckinMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
index a736326e1..af2441a33 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.File;
import java.io.IOException;
@@ -27,7 +29,9 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.codehaus.plexus.util.FileUtils;
/**
@@ -72,6 +76,11 @@ public class CheckoutMojo extends AbstractScmMojo {
*/
private ScmResult checkoutResult;
+ @Inject
+ public CheckoutMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java
index b8eeea54d..ce1de9b60 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.File;
import java.io.IOException;
@@ -26,7 +28,9 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.diff.DiffScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.codehaus.plexus.util.FileUtils;
/**
@@ -66,6 +70,11 @@ public class DiffMojo extends AbstractScmMojo {
@Parameter(property = "outputFile", defaultValue = "${project.artifactId}.diff")
private File outputFile;
+ @Inject
+ public DiffMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/EditMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/EditMojo.java
index f6c560556..29b695a7c 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/EditMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/EditMojo.java
@@ -18,13 +18,17 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.edit.EditScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Edit/lock a set of files.
@@ -33,6 +37,12 @@
*/
@Mojo(name = "edit", aggregator = true)
public class EditMojo extends AbstractScmMojo {
+
+ @Inject
+ public EditMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ExportMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ExportMojo.java
index b4e446bf0..703100178 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ExportMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ExportMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.File;
import java.io.IOException;
@@ -27,7 +29,9 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.export.ExportScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.codehaus.plexus.util.FileUtils;
/**
@@ -61,6 +65,11 @@ public class ExportMojo extends AbstractScmMojo {
@Parameter(property = "skipExportIfExists", defaultValue = "false")
private boolean skipExportIfExists = false;
+ @Inject
+ public ExportMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java
index b0c65dd37..7c7423c35 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
@@ -26,7 +28,9 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.command.list.ListScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Get the list of project files.
@@ -53,6 +57,11 @@ public class ListMojo extends AbstractScmMojo {
@Parameter(property = "recursive", defaultValue = "true")
private boolean recursive = true;
+ @Inject
+ public ListMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/RemoveMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/RemoveMojo.java
index ee9b89bed..eab54e213 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/RemoveMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/RemoveMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
@@ -25,7 +27,9 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.remove.RemoveScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Mark a set of files for deletion.
@@ -41,6 +45,11 @@ public class RemoveMojo extends AbstractScmMojo {
@Parameter(property = "message")
private String message;
+ @Inject
+ public RemoveMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/StatusMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/StatusMojo.java
index ab446d296..4453450f8 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/StatusMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/StatusMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.File;
import java.io.IOException;
@@ -27,7 +29,9 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Display the modification status of the files in the configured scm url.
@@ -37,6 +41,12 @@
*/
@Mojo(name = "status", aggregator = true)
public class StatusMojo extends AbstractScmMojo {
+
+ @Inject
+ public StatusMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/TagMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/TagMojo.java
index 548381cf3..3c72777c5 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/TagMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/TagMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -28,8 +30,10 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmTagParameters;
import org.apache.maven.scm.command.tag.TagScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.ScmProvider;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Tag the project.
@@ -103,6 +107,11 @@ public class TagMojo extends AbstractScmMojo {
@Parameter(property = "sign", defaultValue = "false")
private boolean sign;
+ @Inject
+ public TagMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UnEditMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UnEditMojo.java
index 4a7614397..55e625e5e 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UnEditMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UnEditMojo.java
@@ -18,13 +18,17 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.unedit.UnEditScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Unedit/unlock a set of files.
@@ -33,6 +37,12 @@
*/
@Mojo(name = "unedit", aggregator = true)
public class UnEditMojo extends AbstractScmMojo {
+
+ @Inject
+ public UnEditMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UntagMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UntagMojo.java
index a712dac6a..819182ced 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UntagMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UntagMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
@@ -27,8 +29,10 @@
import org.apache.maven.scm.CommandParameters;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.untag.UntagScmResult;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.ScmProvider;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Untag the project.
@@ -47,6 +51,11 @@ public class UntagMojo extends AbstractScmMojo {
@Parameter(property = "message", required = false)
private String message;
+ @Inject
+ public UntagMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java
index f15090ef0..351bcd05f 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
@@ -27,7 +29,9 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.command.update.UpdateScmResultWithRevision;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Update the local working copy with the latest source from the configured scm url.
@@ -66,6 +70,11 @@ public class UpdateMojo extends AbstractScmMojo {
@Parameter(property = "runChangelog", defaultValue = "false")
private boolean runChangelog = false;
+ @Inject
+ public UpdateMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateSubprojectsMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateSubprojectsMojo.java
index 00e6b0c76..722fa9112 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateSubprojectsMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateSubprojectsMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
@@ -27,7 +29,9 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.command.update.UpdateScmResultWithRevision;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Updates all projects in a multi project build. This is useful for users who have adopted the flat project structure
@@ -59,6 +63,11 @@ public class UpdateSubprojectsMojo extends AbstractScmMojo {
@Parameter(defaultValue = "${project}", required = true, readonly = true)
private MavenProject project;
+ @Inject
+ public UpdateSubprojectsMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/** {@inheritDoc} */
public void execute() throws MojoExecutionException {
super.execute();
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateMojo.java
index a5bfbc506..aea7ce862 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.util.Iterator;
import java.util.List;
@@ -27,7 +29,9 @@
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.svn.AbstractSvnScmProvider;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Validate scm connection string.
@@ -61,6 +65,11 @@ public class ValidateMojo extends AbstractScmMojo {
@Parameter(property = "scmCheckWorkingDirectoryUrl", defaultValue = "false")
private boolean scmCheckWorkingDirectoryUrl;
+ @Inject
+ public ValidateMojo(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateRecursively.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateRecursively.java
index cd85acf4b..b30deafad 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateRecursively.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateRecursively.java
@@ -18,9 +18,13 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
/**
* Validate scm connection string recursively for all projects
@@ -28,5 +32,9 @@
@Mojo(name = "validate-recursively", requiresProject = true)
@Execute(phase = LifecyclePhase.VALIDATE)
public class ValidateRecursively extends ValidateMojo {
- // no op
+
+ @Inject
+ public ValidateRecursively(ScmManager manager, SettingsDecrypter settingsDecrypter) {
+ super(manager, settingsDecrypter);
+ }
}
diff --git a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java
index fbb45a86a..888bf178d 100644
--- a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java
+++ b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java
@@ -56,7 +56,7 @@ public void setUp() throws Exception {
goalDir = getTestFile("target/checkout/my/project/modules/1");
goalDir.mkdirs();
- bootstrapMojo = new BootstrapMojo();
+ bootstrapMojo = new BootstrapMojo(null, null);
}
@Test