2121
2222import java .io .File ;
2323
24+ import javax .inject .Inject ;
25+
2426import org .apache .commons .lang3 .StringUtils ;
27+ import org .apache .commons .lang3 .Strings ;
2528import org .apache .maven .execution .MavenSession ;
2629import org .apache .maven .model .Plugin ;
2730import org .apache .maven .plugin .AbstractMojo ;
3336import org .apache .maven .plugin .descriptor .MojoDescriptor ;
3437import org .apache .maven .plugin .descriptor .PluginDescriptor ;
3538import org .apache .maven .plugin .logging .Log ;
36- import org .apache .maven .plugins .annotations .Component ;
3739import org .apache .maven .plugins .annotations .Execute ;
3840import org .apache .maven .plugins .annotations .LifecyclePhase ;
3941import org .apache .maven .plugins .annotations .Mojo ;
@@ -95,9 +97,9 @@ public class InstallMojo extends AbstractMojo {
9597 @ Parameter (defaultValue = "${session}" , readonly = true )
9698 private MavenSession session ;
9799
98- @ Component ( role = MavenPluginManager . class )
100+ @ Inject
99101 private MavenPluginManager pluginManager ;
100- @ Component ( role = BuildPluginManager . class )
102+ @ Inject
101103 private BuildPluginManager buildPluginManager ;
102104
103105 @ Override
@@ -120,7 +122,7 @@ else if (isContentPackageProject()) {
120122 private boolean isBundleProject () {
121123 // check for "bundle" packaging as used by maven-bundle-plugin
122124 String packaging = project .getPackaging ();
123- if (StringUtils .equals (packaging , "bundle" )) {
125+ if (Strings . CS .equals (packaging , "bundle" )) {
124126 return true ;
125127 }
126128
@@ -130,13 +132,13 @@ private boolean isBundleProject() {
130132 }
131133
132134 private boolean isBndMavenPlugin (Plugin plugin ) {
133- return StringUtils .equals (plugin .getGroupId (), "biz.aQute.bnd" )
134- && StringUtils .equals (plugin .getArtifactId (), "bnd-maven-plugin" );
135+ return Strings . CS .equals (plugin .getGroupId (), "biz.aQute.bnd" )
136+ && Strings . CS .equals (plugin .getArtifactId (), "bnd-maven-plugin" );
135137 }
136138
137139 private boolean isContentPackageProject () {
138140 String packaging = project .getPackaging ();
139- return StringUtils .equals (packaging , "content-package" );
141+ return Strings . CS .equals (packaging , "content-package" );
140142 }
141143
142144 /**
@@ -225,16 +227,16 @@ private void executeWithMavenInvoker(String goal) throws MojoExecutionException
225227 private void setupInvokerLogger (InvocationRequest request ) {
226228 Log log = getLog ();
227229 request .setOutputHandler (line -> {
228- if (StringUtils .startsWith (line , "[ERROR] " )) {
230+ if (Strings . CS .startsWith (line , "[ERROR] " )) {
229231 log .error (StringUtils .substringAfter (line , "[ERROR] " ));
230232 }
231- else if (StringUtils .startsWith (line , "[WARNING] " )) {
233+ else if (Strings . CS .startsWith (line , "[WARNING] " )) {
232234 log .warn (StringUtils .substringAfter (line , "[WARNING] " ));
233235 }
234- else if (StringUtils .startsWith (line , "[INFO] " )) {
236+ else if (Strings . CS .startsWith (line , "[INFO] " )) {
235237 log .info (StringUtils .substringAfter (line , "[INFO] " ));
236238 }
237- else if (StringUtils .startsWith (line , "[DEBUG] " )) {
239+ else if (Strings . CS .startsWith (line , "[DEBUG] " )) {
238240 log .debug (StringUtils .substringAfter (line , "[DEBUG] " ));
239241 }
240242 else {
0 commit comments