You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by eo...@apache.org on 2020/04/05 10:58:02 UTC

[maven-studies] branch maven-metrics updated (8e065e6 -> 90cd0a6)

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a change to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git.


 discard 8e065e6  Move DefaultMetricsSystem to the right directory
 discard fa326e0  Add MetricsSystem components
 discard 0813bed  Start Metrics Module
     new 9f070e7  [MNG-6866] extract methods, apply SLA, introduce mass mojo adding
     new 2628d71  [MNG-6882] - Change the URL's in tests etc. from http to https
     new b962ff3  [MNG-5577] Simplify tests to reduce use of wiring.
     new d420774  [MNG-5577] Don't use LegacyRepositoryLayout in tests.
     new 9567da2  [MNG-5577] Convert maven-core to JSR 330
     new c423a09  [MNG-6867] extract methods, apply SLA
     new d127bce  Revert "[MNG-6867] extract methods, apply SLA"
     new bf7b99a  [MNG-6884] - Cleanup POM File after version upgrade
     new 0174885  Start Metrics Module
     new c5cddee  Add MetricsSystem components
     new 90cd0a6  Move DefaultMetricsSystem to the right directory

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (8e065e6)
            \
             N -- N -- N   refs/heads/maven-metrics (90cd0a6)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../factory/DefaultArtifactFactoryTest.java        |  10 ++
 .../transform/TransformationManagerTest.java       |  10 ++
 .../project/AbstractMavenProjectTestCase.java      |   2 +-
 .../apache/maven/project/ProjectClasspathTest.java |  13 ++-
 .../apache/maven/project/TestProjectBuilder.java   |  28 -----
 .../maven/repository/LegacyRepositoryLayout.java   |  89 --------------
 .../repository/legacy/DefaultWagonManagerTest.java |  10 ++
 .../resolver/DefaultArtifactCollectorTest.java     |  10 ++
 .../conflict/AbstractConflictResolverTest.java     |  10 ++
 .../DefaultGraphConflictResolutionPolicyTest.java  |   7 +-
 maven-core/pom.xml                                 |   4 -
 .../main/java/org/apache/maven/DefaultMaven.java   |  28 +++--
 .../maven/DefaultProjectDependenciesResolver.java  |  13 ++-
 .../artifact/factory/DefaultArtifactFactory.java   |  11 +-
 .../artifact/handler/DefaultArtifactHandler.java   |   6 +-
 .../manager/DefaultArtifactHandlerManager.java     |  11 +-
 .../repository/layout/DefaultRepositoryLayout.java |   7 +-
 .../metadata/io/DefaultMetadataReader.java         |   7 +-
 .../resolver/DefaultResolutionErrorHandler.java    |   6 +-
 .../apache/maven/bridge/MavenRepositorySystem.java |  23 ++--
 .../internal/DefaultBeanConfigurator.java          |   7 +-
 .../eventspy/internal/EventSpyDispatcher.java      |  13 ++-
 .../maven/exception/DefaultExceptionHandler.java   |   7 +-
 .../DefaultMavenExecutionRequestPopulator.java     |   2 +
 .../apache/maven/graph/DefaultGraphBuilder.java    |  13 ++-
 .../maven/lifecycle/DefaultLifecycleExecutor.java  |  33 +++---
 .../apache/maven/lifecycle/DefaultLifecycles.java  |  13 ++-
 .../lifecycle/internal/BuildListCalculator.java    |  15 ++-
 .../internal/DefaultExecutionEventCatapult.java    |   7 +-
 .../DefaultLifecycleExecutionPlanCalculator.java   |  26 +++--
 .../internal/DefaultLifecycleMappingDelegate.java  |  18 ++-
 .../internal/DefaultLifecyclePluginAnalyzer.java   |  16 +--
 .../DefaultLifecycleTaskSegmentCalculator.java     |  21 ++--
 .../internal/DefaultMojoExecutionConfigurator.java |   7 +-
 .../lifecycle/internal/LifecycleDebugLogger.java   |  23 ++--
 .../lifecycle/internal/LifecycleModuleBuilder.java |  23 ++--
 .../internal/LifecyclePluginResolver.java          |  17 ++-
 .../maven/lifecycle/internal/LifecycleStarter.java |  25 ++--
 .../lifecycle/internal/MojoDescriptorCreator.java  |  27 +++--
 .../maven/lifecycle/internal/MojoExecutor.java     |  35 +++---
 .../lifecycle/internal/builder/BuilderCommon.java  |  21 ++--
 .../multithreaded/MultiThreadedBuilder.java        |  13 ++-
 .../singlethreaded/SingleThreadedBuilder.java      |  18 ++-
 .../plugin/DefaultLifecycleBindingsInjector.java   |  11 +-
 .../maven/plugin/DefaultBuildPluginManager.java    |  21 ++--
 .../maven/plugin/DefaultExtensionRealmCache.java   |   7 +-
 .../maven/plugin/DefaultPluginArtifactsCache.java  |   7 +-
 .../maven/plugin/DefaultPluginDescriptorCache.java |   7 +-
 .../maven/plugin/DefaultPluginRealmCache.java      |   7 +-
 .../plugin/internal/DefaultLegacySupport.java      |   8 +-
 .../plugin/internal/DefaultMavenPluginManager.java |  31 ++---
 .../DefaultPluginDependenciesResolver.java         |  13 ++-
 .../plugin/internal/DefaultPluginManager.java      |  23 ++--
 .../internal/DefaultPluginPrefixResolver.java      |  19 +--
 .../internal/DefaultPluginVersionResolver.java     |  19 +--
 .../maven/project/DefaultMavenProjectHelper.java   |  18 ++-
 .../maven/project/DefaultProjectBuilder.java       |  25 ++--
 .../project/DefaultProjectBuildingHelper.java      |  21 ++--
 .../DefaultProjectDependenciesResolver.java        |  15 ++-
 .../maven/project/DefaultProjectRealmCache.java    |   7 +-
 .../artifact/DefaultMavenMetadataCache.java        |   7 +-
 .../project/artifact/DefaultMetadataSource.java    |   7 +-
 .../artifact/DefaultProjectArtifactsCache.java     |   7 +-
 .../project/artifact/MavenMetadataSource.java      |  23 ++--
 .../rtinfo/internal/DefaultRuntimeInformation.java |  11 +-
 .../settings/DefaultMavenSettingsBuilder.java      |  11 +-
 .../maven/toolchain/DefaultToolchainManager.java   |  13 ++-
 .../toolchain/DefaultToolchainManagerPrivate.java  |   7 +-
 .../maven/toolchain/DefaultToolchainsBuilder.java  |  11 +-
 .../maven/toolchain/java/JavaToolchainFactory.java |  11 +-
 .../configuration/DefaultBeanConfiguratorTest.java |   8 +-
 .../maven/lifecycle/DefaultLifecyclesTest.java     |  10 ++
 .../apache/maven/project/PomConstructionTest.java  | 114 +++++++++---------
 .../apache/maven/project/TestMetadataSource.java   |  10 +-
 .../artifact/DefaultMavenMetadataCacheTest.java    |   2 +-
 .../artifact/DefaultProjectArtifactsCacheTest.java |   7 +-
 .../maven/repository/LegacyRepositoryLayout.java   |  89 --------------
 .../repository/TestRepositoryConnectorFactory.java |   7 +-
 .../maven/repository/TestRepositorySystem.java     |  22 ++--
 .../internal/DefaultRuntimeInformationTest.java    |  11 ++
 .../artifact-id-inheritance/child/pom.xml          |   2 +-
 .../artifact-id-inheritance/pom.xml                |   4 +-
 .../basedir-aligned-interpolation/pom.xml          |   2 +-
 .../pom-with-unusual-name.xml                      |   2 +-
 .../baseuri-interpolation/pom.xml                  |   2 +-
 .../boolean-interpolation/pom.xml                  |   2 +-
 .../build-extension-inheritance/pom.xml            |   2 +-
 .../build-extension-inheritance/sub/pom.xml        |   2 +-
 .../complete-model/w-parent/pom.xml                |   2 +-
 .../complete-model/w-parent/sub/pom.xml            |  34 +++---
 .../complete-model/wo-parent/pom.xml               |  34 +++---
 .../contributors-inheritance/child-2/pom.xml       |   2 +-
 .../contributors-inheritance/pom.xml               |   2 +-
 .../dependency-inheritance/maven-parent.xml        |   2 +-
 .../dependency-inheritance/pom.xml                 |   2 +-
 .../dependency-inheritance/sub/pom.xml             |   2 +-
 .../dependency-order/w-plugin-mgmt/pom.xml         |   2 +-
 .../dependency-order/wo-plugin-mgmt/pom.xml        |   2 +-
 .../developers-inheritance/child-2/pom.xml         |   2 +-
 .../developers-inheritance/pom.xml                 |   2 +-
 .../distribution-management/pom.xml                |   2 +-
 .../resources-project-builder/empty-scm/pom.xml    |   2 +-
 .../equal-plugin-deps/pom.xml                      |   2 +-
 .../equal-plugin-exec-ids/pom.xml                  |   2 +-
 .../full-interpolation/pom.xml                     |   2 +-
 .../pom.xml                                        |   4 +-
 .../sub/pom.xml                                    |   2 +-
 .../active-profile/pom.xml                         |   2 +-
 .../active-profile/sub/pom.xml                     |   2 +-
 .../no-profile/pom.xml                             |   2 +-
 .../no-profile/sub/pom.xml                         |   2 +-
 .../interpolation-cli-wins/pom.xml                 |   2 +-
 .../jdk-activation/pom.xml                         |   2 +-
 .../join-different-containers-same-id/pom.xml      |   2 +-
 .../licenses-inheritance/child-2/pom.xml           |   4 +-
 .../licenses-inheritance/pom.xml                   |   4 +-
 .../limited-inheritance/child/pom.xml              |   6 +-
 .../limited-inheritance/pom.xml                    |  10 +-
 .../mailing-lists-inheritance/child-2/pom.xml      |   2 +-
 .../mailing-lists-inheritance/pom.xml              |   2 +-
 .../managed-profile-dependency/pom.xml             |   2 +-
 .../managed-profile-dependency/sub/pom.xml         |   2 +-
 .../merged-filter-order/pom.xml                    |   2 +-
 .../merged-filter-order/sub/pom.xml                |   2 +-
 .../w-plugin-mgmt/pom.xml                          |   2 +-
 .../w-plugin-mgmt/sub/pom.xml                      |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../wo-plugin-mgmt/sub/pom.xml                     |   2 +-
 .../w-plugin-mgmt/pom.xml                          |   2 +-
 .../w-plugin-mgmt/sub/pom.xml                      |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../wo-plugin-mgmt/sub/pom.xml                     |   2 +-
 .../merged-plugin-exec-order/w-plugin-mgmt/pom.xml |   2 +-
 .../w-plugin-mgmt/sub/pom.xml                      |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../wo-plugin-mgmt/sub/pom.xml                     |   2 +-
 .../resources-project-builder/micromailer/pom.xml  |   2 +-
 .../micromailer/spice-parent-9.pom                 |   2 +-
 .../multiple-repos/pom.xml                         |   4 +-
 .../multiple-repos/sub/pom.xml                     |   4 +-
 .../nested-build-dir-interpolation/pom.xml         |   2 +-
 .../parent-pom-packaging/pom.xml                   |   2 +-
 .../parent-pom-packaging/sub/pom.xml               |   2 +-
 .../platform-file-separator/pom.xml                |   2 +-
 .../plugin-config-append/no-profile/pom.xml        |   2 +-
 .../no-profile/subproject/pom.xml                  |   2 +-
 .../plugin-config-append/with-profile/pom.xml      |   2 +-
 .../with-profile/subproject/pom.xml                |   2 +-
 .../plugin-config-attributes/w-plugin-mgmt/pom.xml |   2 +-
 .../plugin-config-attributes/w-profile/pom.xml     |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../plugin-config-merging/child/pom.xml            |   2 +-
 .../plugin-config-merging/pom.xml                  |   2 +-
 .../plugin-config-order/w-plugin-mgmt/pom.xml      |   2 +-
 .../plugin-config-order/wo-plugin-mgmt/pom.xml     |   2 +-
 .../plugin-exec-config-order/w-plugin-mgmt/pom.xml |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../plugin-exec-goals-order/w-plugin-mgmt/pom.xml  |   2 +-
 .../plugin-exec-goals-order/wo-plugin-mgmt/pom.xml |   2 +-
 .../plugin-exec-inheritance/pom.xml                |   2 +-
 .../plugin-exec-inheritance/w-merge/pom.xml        |   2 +-
 .../plugin-exec-inheritance/wo-merge/pom.xml       |   2 +-
 .../pom.xml                                        |   2 +-
 .../sub/pom.xml                                    |   2 +-
 .../plugin-exec-merging-wo-version/pom.xml         |   2 +-
 .../plugin-exec-merging-wo-version/sub/pom.xml     |   2 +-
 .../plugin-exec-merging/w-plugin-mgmt/pom.xml      |   2 +-
 .../plugin-exec-merging/w-plugin-mgmt/sub/pom.xml  |   2 +-
 .../plugin-exec-merging/wo-plugin-mgmt/pom.xml     |   2 +-
 .../plugin-exec-merging/wo-plugin-mgmt/sub/pom.xml |   2 +-
 .../plugin-exec-order-and-default-exec/pom.xml     |   2 +-
 .../plugin-exec-order-with-lifecycle/pom.xml       |   2 +-
 .../plugin-exec-order/w-plugin-mgmt/pom.xml        |   2 +-
 .../plugin-exec-order/wo-plugin-mgmt/pom.xml       |   2 +-
 .../plugin-exec-w-and-wo-id/w-plugin-mgmt/pom.xml  |   2 +-
 .../plugin-exec-w-and-wo-id/wo-plugin-mgmt/pom.xml |   2 +-
 .../plugin-inheritance-merge-order/pom.xml         |   2 +-
 .../plugin-inheritance-merge-order/sub/pom.xml     |   2 +-
 .../plugin-inheritance-order/child/pom.xml         |   2 +-
 .../plugin-inheritance-order/pom.xml               |   2 +-
 .../plugin-injection-merge-order/pom.xml           |   2 +-
 .../plugin-management-duplicate/pom.xml            |   2 +-
 .../plugin-management-duplicate/sub/pom.xml        |   2 +-
 .../child/pom.xml                                  |   2 +-
 .../plugin-management-for-implicit-plugin/pom.xml  |   2 +-
 .../plugin-management-inheritance/pom.xml          |   2 +-
 .../pom-encoding/latin-1/pom.xml                   |   2 +-
 .../pom-encoding/utf-8/pom.xml                     |   2 +-
 .../pom-inheritance/pom.xml                        |  22 ++--
 .../pom-inheritance/sub/pom.xml                    |   2 +-
 .../prerequisites-inheritance/child/pom.xml        |   2 +-
 .../prerequisites-inheritance/pom.xml              |   2 +-
 .../profile-dependencies-multiple-profiles/pom.xml |   2 +-
 .../profile-injected-dependencies/pom.xml          |   2 +-
 .../profile-injection-order/pom.xml                |   2 +-
 .../profile-plugin-mng-dependencies/pom.xml        |   2 +-
 .../profile-plugin-mng-dependencies/sub/pom.xml    |   2 +-
 .../profile-plugins/pom.xml                        |   2 +-
 .../profile-properties-interpolation/pom.xml       |   4 +-
 .../properties-inheritance/pom.xml                 |   2 +-
 .../properties-inheritance/sub/pom.xml             |   2 +-
 .../repo-inheritance/pom.xml                       |   2 +-
 .../reporting-plugin-config/pom.xml                |   2 +-
 .../reporting-plugin-config/sub/pom.xml            |   2 +-
 .../system-property-interpolation/pom.xml          |   2 +-
 .../resources-project-builder/unc-path/pom.xml     |   2 +-
 .../resources-project-builder/unc-path/sub/pom.xml |   2 +-
 .../dep-mgmt-in-profile/pom.xml                    |   2 +-
 .../unique-dependency-key/dep-mgmt/pom.xml         |   2 +-
 .../unique-dependency-key/deps-in-profile/pom.xml  |   2 +-
 .../unique-dependency-key/deps/pom.xml             |   2 +-
 .../artifact-repo-in-profile/pom.xml               |   6 +-
 .../unique-repo-id/artifact-repo/pom.xml           |   6 +-
 .../unique-repo-id/plugin-repo-in-profile/pom.xml  |   6 +-
 .../unique-repo-id/plugin-repo/pom.xml             |   6 +-
 .../child/pom.xml                                  |  14 +--
 .../unprefixed-expression-interpolation/pom.xml    |   2 +-
 .../url-append/child/pom.xml                       |   2 +-
 .../url-append/parent/pom.xml                      |  10 +-
 .../url-inheritance/another-parent/pom.xml         |   2 +-
 .../url-inheritance/another-parent/sub/pom.xml     |   2 +-
 .../url-inheritance/pom.xml                        |  24 ++--
 .../url-inheritance/sub/pom.xml                    |   2 +-
 .../url-no-decoding/pom.xml                        |  10 +-
 .../xml-coalesce-text/pom.xml                      |   2 +-
 .../xml-markup-interpolation/pom.xml               |   2 +-
 .../xml-whitespace/pom.xml                         |   2 +-
 .../xml-whitespace/sub/pom.xml                     |   2 +-
 .../java/org/apache/maven/cli/MavenCliTest.java    |  19 ++-
 .../maven/plugin/descriptor/PluginDescriptor.java  |  10 ++
 .../plugin/descriptor/PluginDescriptorBuilder.java | 128 +++++++++++++++------
 pom.xml                                            |  16 ---
 232 files changed, 1062 insertions(+), 935 deletions(-)
 delete mode 100644 maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java
 delete mode 100644 maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java


[maven-studies] 10/11: Add MetricsSystem components

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit c5cddeebaf5761692f1c8261a5d0749ee4403c8d
Author: Enrico Olivelli <eo...@apache.org>
AuthorDate: Sat Mar 28 15:52:25 2020 +0100

    Add MetricsSystem components
---
 maven-core/pom.xml                                 |  4 ++
 .../main/java/org/apache/maven/DefaultMaven.java   |  9 +++
 .../maven/lifecycle/internal/LifecycleStarter.java |  7 ++-
 .../metrics/internal/DefaultMetricsSystem.java     | 64 ++++++++++++++++++++++
 .../org/apache/maven/metrics/MetricsSystem.java    | 40 ++++++++++++++
 pom.xml                                            |  6 ++
 6 files changed, 129 insertions(+), 1 deletion(-)

diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index cd363f5..28ce91e 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -39,6 +39,10 @@ under the License.
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-model</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-metrics</artifactId>
+    </dependency>
     <!-- Remove the following two deps to see how to remove Settings from the core -->
     <dependency>
       <groupId>org.apache.maven</groupId>
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index fc26290..6a847c8 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -46,6 +46,7 @@ import org.apache.maven.graph.GraphBuilder;
 import org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory;
 import org.apache.maven.lifecycle.internal.ExecutionEventCatapult;
 import org.apache.maven.lifecycle.internal.LifecycleStarter;
+import org.apache.maven.metrics.MetricsSystem;
 import org.apache.maven.model.Prerequisites;
 import org.apache.maven.model.building.ModelProblem;
 import org.apache.maven.model.building.Result;
@@ -98,6 +99,9 @@ public class DefaultMaven
     @Inject
     @Named( GraphBuilder.HINT )
     private GraphBuilder graphBuilder;
+    
+    @Requirement
+    private MetricsSystem metricsSystem;
 
     @Override
     public MavenExecutionResult execute( MavenExecutionRequest request )
@@ -128,6 +132,11 @@ public class DefaultMaven
         finally
         {
             legacySupport.setSession( null );
+            
+            logger.info("Dumping metrics provider info ("+metricsSystem.getMetricsProvider()+"): ");
+            metricsSystem.getMetricsProvider().dump((k,v) -> {
+                logger.info(k+": "+v);
+            });
         }
 
         return result;
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
index f616654..c0c1278 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
@@ -34,6 +34,7 @@ import org.apache.maven.lifecycle.MissingProjectException;
 import org.apache.maven.lifecycle.NoGoalSpecifiedException;
 import org.apache.maven.lifecycle.internal.builder.Builder;
 import org.apache.maven.lifecycle.internal.builder.BuilderNotFoundException;
+import org.apache.maven.metrics.MetricsSystem;
 import org.apache.maven.session.scope.internal.SessionScope;
 import org.codehaus.plexus.logging.Logger;
 
@@ -71,6 +72,9 @@ public class LifecycleStarter
     
     @Inject
     private SessionScope sessionScope;
+    
+    @Requirement
+    private MetricsSystem metricsSystem;
 
     public void execute( MavenSession session )
     {
@@ -128,8 +132,9 @@ public class LifecycleStarter
                 logger.info( String.format( "Using the %s implementation with a thread count of %d",
                                             builder.getClass().getSimpleName(), degreeOfConcurrency ) );
             }
+            long startBuild = System.currentTimeMillis();
             builder.build( session, reactorContext, projectBuilds, taskSegments, reactorBuildStatus );
-
+            metricsSystem.getMetricsContext().getSummary("buildTime").add(System.currentTimeMillis() - startBuild);
         }
         catch ( Exception e )
         {
diff --git a/maven-core/src/test/java/org/apache/maven/metrics/internal/DefaultMetricsSystem.java b/maven-core/src/test/java/org/apache/maven/metrics/internal/DefaultMetricsSystem.java
new file mode 100644
index 0000000..2e45c85
--- /dev/null
+++ b/maven-core/src/test/java/org/apache/maven/metrics/internal/DefaultMetricsSystem.java
@@ -0,0 +1,64 @@
+package org.apache.maven.metrics.internal;
+
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+import org.apache.maven.classrealm.ClassRealmManager;
+import org.apache.maven.metrics.MetricsContext;
+import org.apache.maven.metrics.MetricsProvider;
+import org.apache.maven.metrics.MetricsSystem;
+import org.apache.maven.metrics.impl.NullMetricsProvider;
+import org.codehaus.plexus.logging.Logger;
+
+/**
+ * Default Implementation of Metrics System Runtime
+ * @author Enrico Olivelli
+ */
+@Singleton
+@Named
+public class DefaultMetricsSystem implements MetricsSystem {
+ 
+    private final Logger log;
+    private final MetricsProvider metricsProvider;
+
+    @Inject
+    public DefaultMetricsSystem(Logger log, ClassRealmManager classRealmManager) throws Exception {
+        this.log = log;
+        String metricsProviderClass = System.getProperty("maven.metrics.provider", NullMetricsProvider.class.getName());
+        log.info("Starting DefaultMetricsSystem maven.metrics.provider="+metricsProviderClass);
+        metricsProvider = (MetricsProvider) Class.forName(metricsProviderClass, true, classRealmManager.getCoreRealm()).getConstructor().newInstance();
+        log.info("Metrics provider: "+metricsProvider);
+    }
+    
+    @Override
+    public MetricsContext getMetricsContext() {
+        return metricsProvider.getRootContext();
+    }
+
+    @Override
+    public MetricsProvider getMetricsProvider() {
+        return metricsProvider;
+    }
+    
+}
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsSystem.java b/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsSystem.java
new file mode 100644
index 0000000..d24a580
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsSystem.java
@@ -0,0 +1,40 @@
+package org.apache.maven.metrics;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Component to access Metrics System
+ * @author Enrico Olivelli
+ */
+public interface MetricsSystem
+{
+
+    /**
+     * Access current metrics context.
+     * @return the metrics context
+     */
+    MetricsContext getMetricsContext();
+    
+    /**
+     * Low level Access to the Provider
+     * @return the provider
+     */
+    MetricsProvider getMetricsProvider();
+}
diff --git a/pom.xml b/pom.xml
index d718abc..d903572 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,6 +85,7 @@ under the License.
     <module>maven-builder-support</module>
     <module>maven-model</module>
     <module>maven-model-builder</module>
+    <module>maven-metrics</module>
     <module>maven-core</module>
     <module>maven-settings</module>
     <module>maven-settings-builder</module>
@@ -181,6 +182,11 @@ under the License.
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
+        <artifactId>maven-metrics</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
         <artifactId>maven-settings</artifactId>
         <version>${project.version}</version>
       </dependency>


[maven-studies] 04/11: [MNG-5577] Don't use LegacyRepositoryLayout in tests.

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit d4207748a80b7fa0953ba8281d890c35d6cf39c4
Author: Joseph Walton <jo...@kafsemo.org>
AuthorDate: Sat Feb 22 22:40:31 2020 +1100

    [MNG-5577] Don't use LegacyRepositoryLayout in tests.
    
    This class was deleted, but retained in tests. We don't need
    it anymore, so drop it.
---
 .../project/AbstractMavenProjectTestCase.java      |  2 +-
 .../maven/repository/LegacyRepositoryLayout.java   | 89 ---------------------
 .../maven/repository/LegacyRepositoryLayout.java   | 92 ----------------------
 3 files changed, 1 insertion(+), 182 deletions(-)

diff --git a/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
index 7e3f7e6..4caeb6f 100644
--- a/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
+++ b/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
@@ -121,7 +121,7 @@ public abstract class AbstractMavenProjectTestCase
     protected ArtifactRepository getLocalRepository()
         throws Exception
     {
-        ArtifactRepositoryLayout repoLayout = lookup( ArtifactRepositoryLayout.class, "legacy" );
+        ArtifactRepositoryLayout repoLayout = lookup( ArtifactRepositoryLayout.class );
 
         ArtifactRepository r = repositorySystem.createArtifactRepository( "local", "file://" + getLocalRepositoryPath().getAbsolutePath(), repoLayout, null, null );
 
diff --git a/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java b/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java
deleted file mode 100644
index 77a6bae..0000000
--- a/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.apache.maven.repository;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.codehaus.plexus.component.annotations.Component;
-
-/**
- * @author jdcasey
- */
-@Component(role=ArtifactRepositoryLayout.class, hint="legacy")
-public class LegacyRepositoryLayout
-    implements ArtifactRepositoryLayout
-{
-    private static final String PATH_SEPARATOR = "/";
-
-    public String getId()
-    {
-        return "legacy";
-    }
-
-    public String pathOf( Artifact artifact )
-    {
-        ArtifactHandler artifactHandler = artifact.getArtifactHandler();
-
-        StringBuilder path = new StringBuilder( 128 );
-
-        path.append( artifact.getGroupId() ).append( '/' );
-        path.append( artifactHandler.getDirectory() ).append( '/' );
-        path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() );
-
-        if ( artifact.hasClassifier() )
-        {
-            path.append( '-' ).append( artifact.getClassifier() );
-        }
-
-        if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
-        {
-            path.append( '.' ).append( artifactHandler.getExtension() );
-        }
-
-        return path.toString();
-    }
-
-    public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata,
-                                                 ArtifactRepository repository )
-    {
-        return pathOfRepositoryMetadata( metadata, metadata.getLocalFilename( repository ) );
-    }
-
-    private String pathOfRepositoryMetadata( ArtifactMetadata metadata,
-                                             String filename )
-    {
-        StringBuilder path = new StringBuilder( 128 );
-
-        path.append( metadata.getGroupId() ).append( PATH_SEPARATOR ).append( "poms" ).append( PATH_SEPARATOR );
-
-        path.append( filename );
-
-        return path.toString();
-    }
-
-    public String pathOfRemoteRepositoryMetadata( ArtifactMetadata metadata )
-    {
-        return pathOfRepositoryMetadata( metadata, metadata.getRemoteFilename() );
-    }
-
-}
diff --git a/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java b/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java
deleted file mode 100644
index bef400e..0000000
--- a/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.apache.maven.repository;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-
-/**
- * @author jdcasey
- */
-@Named( "legacy" )
-@Singleton
-public class LegacyRepositoryLayout
-    implements ArtifactRepositoryLayout
-{
-    private static final String PATH_SEPARATOR = "/";
-
-    public String getId()
-    {
-        return "legacy";
-    }
-
-    public String pathOf( Artifact artifact )
-    {
-        ArtifactHandler artifactHandler = artifact.getArtifactHandler();
-
-        StringBuilder path = new StringBuilder( 128 );
-
-        path.append( artifact.getGroupId() ).append( '/' );
-        path.append( artifactHandler.getDirectory() ).append( '/' );
-        path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() );
-
-        if ( artifact.hasClassifier() )
-        {
-            path.append( '-' ).append( artifact.getClassifier() );
-        }
-
-        if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
-        {
-            path.append( '.' ).append( artifactHandler.getExtension() );
-        }
-
-        return path.toString();
-    }
-
-    public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata,
-                                                 ArtifactRepository repository )
-    {
-        return pathOfRepositoryMetadata( metadata, metadata.getLocalFilename( repository ) );
-    }
-
-    private String pathOfRepositoryMetadata( ArtifactMetadata metadata,
-                                             String filename )
-    {
-        StringBuilder path = new StringBuilder( 128 );
-
-        path.append( metadata.getGroupId() ).append( PATH_SEPARATOR ).append( "poms" ).append( PATH_SEPARATOR );
-
-        path.append( filename );
-
-        return path.toString();
-    }
-
-    public String pathOfRemoteRepositoryMetadata( ArtifactMetadata metadata )
-    {
-        return pathOfRepositoryMetadata( metadata, metadata.getRemoteFilename() );
-    }
-
-}


[maven-studies] 01/11: [MNG-6866] extract methods, apply SLA, introduce mass mojo adding

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit 9f070e7dc151d46502ac59ed1b8152aa2efc8305
Author: Lewinski, Arne <ar...@DE-L072609.groupinfra.com>
AuthorDate: Sun Feb 16 20:42:47 2020 +0100

    [MNG-6866] extract methods, apply SLA, introduce mass mojo adding
---
 .../maven/plugin/descriptor/PluginDescriptor.java  |  10 ++
 .../plugin/descriptor/PluginDescriptorBuilder.java | 128 +++++++++++++++------
 2 files changed, 101 insertions(+), 37 deletions(-)

diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
index e05d86a..01ead82 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
@@ -436,4 +436,14 @@ public class PluginDescriptor
         }
     }
 
+    public void addMojos( List<MojoDescriptor> mojos )
+        throws DuplicateMojoDescriptorException
+    {
+        for ( MojoDescriptor mojoDescriptor : mojos )
+        {
+            addMojo( mojoDescriptor );
+        }
+
+    }
+
 }
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java
index 3df7ab4..5747d16 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java
@@ -46,49 +46,102 @@ public class PluginDescriptorBuilder
     public PluginDescriptor build( Reader reader, String source )
         throws PlexusConfigurationException
     {
-        PlexusConfiguration c = buildConfiguration( reader );
+        return build( source, buildConfiguration( reader ) );
+    }
 
+    private PluginDescriptor build( String source, PlexusConfiguration c )
+        throws PlexusConfigurationException
+    {
         PluginDescriptor pluginDescriptor = new PluginDescriptor();
 
         pluginDescriptor.setSource( source );
-        pluginDescriptor.setGroupId( c.getChild( "groupId" ).getValue() );
-        pluginDescriptor.setArtifactId( c.getChild( "artifactId" ).getValue() );
-        pluginDescriptor.setVersion( c.getChild( "version" ).getValue() );
-        pluginDescriptor.setGoalPrefix( c.getChild( "goalPrefix" ).getValue() );
+        pluginDescriptor.setGroupId( extractGroupId( c ) );
+        pluginDescriptor.setArtifactId( extractArtifactId( c ) );
+        pluginDescriptor.setVersion( extractVersion( c ) );
+        pluginDescriptor.setGoalPrefix( extractGoalPrefix( c ) );
 
-        pluginDescriptor.setName( c.getChild( "name" ).getValue() );
-        pluginDescriptor.setDescription( c.getChild( "description" ).getValue() );
+        pluginDescriptor.setName( extractName( c ) );
+        pluginDescriptor.setDescription( extractDescription( c ) );
 
-        String isolatedRealm = c.getChild( "isolatedRealm" ).getValue();
+        pluginDescriptor.setIsolatedRealm( extractIsolatedRealm( c ) );
+        pluginDescriptor.setInheritedByDefault( extractInheritedByDefault( c ) );
 
-        if ( isolatedRealm != null )
+        pluginDescriptor.addMojos( extractMojos( c, pluginDescriptor ) );
+
+        pluginDescriptor.setDependencies( extractComponentDependencies( c ) );
+
+        return pluginDescriptor;
+    }
+
+    private String extractGroupId( PlexusConfiguration c )
+    {
+        return c.getChild( "groupId" ).getValue();
+    }
+
+    private String extractArtifactId( PlexusConfiguration c )
+    {
+        return c.getChild( "artifactId" ).getValue();
+    }
+
+    private String extractVersion( PlexusConfiguration c )
+    {
+        return c.getChild( "version" ).getValue();
+    }
+
+    private String extractGoalPrefix( PlexusConfiguration c )
+    {
+        return c.getChild( "goalPrefix" ).getValue();
+    }
+
+    private String extractName( PlexusConfiguration c )
+    {
+        return c.getChild( "name" ).getValue();
+    }
+
+    private String extractDescription( PlexusConfiguration c )
+    {
+        return c.getChild( "description" ).getValue();
+    }
+
+    private List<MojoDescriptor> extractMojos( PlexusConfiguration c, PluginDescriptor pluginDescriptor )
+        throws PlexusConfigurationException
+    {
+        List<MojoDescriptor> mojos = new ArrayList<>();
+
+        PlexusConfiguration[] mojoConfigurations = c.getChild( "mojos" ).getChildren( "mojo" );
+
+        for ( PlexusConfiguration component : mojoConfigurations )
         {
-            pluginDescriptor.setIsolatedRealm( Boolean.parseBoolean( isolatedRealm ) );
+            mojos.add( buildComponentDescriptor( component, pluginDescriptor ) );
+
         }
+        return mojos;
+    }
 
+    private boolean extractInheritedByDefault( PlexusConfiguration c )
+    {
         String inheritedByDefault = c.getChild( "inheritedByDefault" ).getValue();
 
         if ( inheritedByDefault != null )
         {
-            pluginDescriptor.setInheritedByDefault( Boolean.parseBoolean( inheritedByDefault ) );
+            return Boolean.parseBoolean( inheritedByDefault );
         }
+        return false;
+    }
 
-        // ----------------------------------------------------------------------
-        // Components
-        // ----------------------------------------------------------------------
-
-        PlexusConfiguration[] mojoConfigurations = c.getChild( "mojos" ).getChildren( "mojo" );
+    private boolean extractIsolatedRealm( PlexusConfiguration c )
+    {
+        String isolatedRealm = c.getChild( "isolatedRealm" ).getValue();
 
-        for ( PlexusConfiguration component : mojoConfigurations )
+        if ( isolatedRealm != null )
         {
-            MojoDescriptor mojoDescriptor = buildComponentDescriptor( component, pluginDescriptor );
-
-            pluginDescriptor.addMojo( mojoDescriptor );
+            return Boolean.parseBoolean( isolatedRealm );
         }
+        return false;
+    }
 
-        // ----------------------------------------------------------------------
-        // Dependencies
-        // ----------------------------------------------------------------------
+    private List<ComponentDependency> extractComponentDependencies( PlexusConfiguration c )
+    {
 
         PlexusConfiguration[] dependencyConfigurations = c.getChild( "dependencies" ).getChildren( "dependency" );
 
@@ -96,22 +149,23 @@ public class PluginDescriptorBuilder
 
         for ( PlexusConfiguration d : dependencyConfigurations )
         {
-            ComponentDependency cd = new ComponentDependency();
-
-            cd.setArtifactId( d.getChild( "artifactId" ).getValue() );
-
-            cd.setGroupId( d.getChild( "groupId" ).getValue() );
+            dependencies.add( extractComponentDependency( d ) );
+        }
+        return dependencies;
+    }
 
-            cd.setType( d.getChild( "type" ).getValue() );
+    private ComponentDependency extractComponentDependency( PlexusConfiguration d )
+    {
+        ComponentDependency cd = new ComponentDependency();
 
-            cd.setVersion( d.getChild( "version" ).getValue() );
+        cd.setArtifactId( extractArtifactId( d ) );
 
-            dependencies.add( cd );
-        }
+        cd.setGroupId( extractGroupId( d ) );
 
-        pluginDescriptor.setDependencies( dependencies );
+        cd.setType( d.getChild( "type" ).getValue() );
 
-        return pluginDescriptor;
+        cd.setVersion( extractVersion( d ) );
+        return cd;
     }
 
     @SuppressWarnings( "checkstyle:methodlength" )
@@ -190,7 +244,7 @@ public class PluginDescriptorBuilder
 
         mojo.setInstantiationStrategy( c.getChild( "instantiationStrategy" ).getValue() );
 
-        mojo.setDescription( c.getChild( "description" ).getValue() );
+        mojo.setDescription( extractDescription( c ) );
 
         PlexusConfiguration dependencyResolution = c.getChild( "requiresDependencyResolution", false );
 
@@ -274,7 +328,7 @@ public class PluginDescriptorBuilder
         {
             Parameter parameter = new Parameter();
 
-            parameter.setName( d.getChild( "name" ).getValue() );
+            parameter.setName( extractName( d ) );
 
             parameter.setAlias( d.getChild( "alias" ).getValue() );
 
@@ -294,7 +348,7 @@ public class PluginDescriptorBuilder
                 parameter.setEditable( editable == null || Boolean.parseBoolean( editable ) );
             }
 
-            parameter.setDescription( d.getChild( "description" ).getValue() );
+            parameter.setDescription( extractDescription( d ) );
 
             parameter.setDeprecated( d.getChild( "deprecated" ).getValue() );
 


[maven-studies] 11/11: Move DefaultMetricsSystem to the right directory

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit 90cd0a6e944c0f00a44306aed99961bed8f4f362
Author: Enrico Olivelli <eo...@apache.org>
AuthorDate: Sun Mar 29 10:25:01 2020 +0200

    Move DefaultMetricsSystem to the right directory
---
 .../java/org/apache/maven/metrics/internal/DefaultMetricsSystem.java      | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/maven-core/src/test/java/org/apache/maven/metrics/internal/DefaultMetricsSystem.java b/maven-core/src/main/java/org/apache/maven/metrics/internal/DefaultMetricsSystem.java
similarity index 100%
rename from maven-core/src/test/java/org/apache/maven/metrics/internal/DefaultMetricsSystem.java
rename to maven-core/src/main/java/org/apache/maven/metrics/internal/DefaultMetricsSystem.java


[maven-studies] 09/11: Start Metrics Module

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit 01748855206e89b0b2d625b42cb038a18ab971cc
Author: Enrico Olivelli <eo...@apache.org>
AuthorDate: Sat Mar 28 14:44:52 2020 +0100

    Start Metrics Module
---
 maven-metrics/pom.xml                              |  44 ++++++
 .../java/org/apache/maven/metrics/Counter.java     |  54 +++++++
 .../main/java/org/apache/maven/metrics/Gauge.java  |  38 +++++
 .../org/apache/maven/metrics/MetricsContext.java   |  92 ++++++++++++
 .../org/apache/maven/metrics/MetricsProvider.java  |  83 +++++++++++
 .../metrics/MetricsProviderLifeCycleException.java |  51 +++++++
 .../java/org/apache/maven/metrics/Summary.java     |  37 +++++
 .../java/org/apache/maven/metrics/SummarySet.java  |  39 +++++
 .../maven/metrics/impl/NullMetricsProvider.java    | 160 +++++++++++++++++++++
 9 files changed, 598 insertions(+)

diff --git a/maven-metrics/pom.xml b/maven-metrics/pom.xml
new file mode 100644
index 0000000..ab30cb6
--- /dev/null
+++ b/maven-metrics/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven</groupId>
+    <artifactId>maven</artifactId>
+    <version>3.7.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>maven-metrics</artifactId>
+
+  <name>Maven Metrics</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+  </build>
+</project>
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/Counter.java b/maven-metrics/src/main/java/org/apache/maven/metrics/Counter.java
new file mode 100644
index 0000000..e2eb1d1
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/Counter.java
@@ -0,0 +1,54 @@
+package org.apache.maven.metrics;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A counter refers to a value which can only increase.
+ * Usually the value is reset when the process starts.
+ */
+public interface Counter
+{
+
+    /**
+     * Increment the value by one.
+     * <p>This method is thread safe, The MetricsProvider will take care of synchronization.</p>
+     */
+    default void inc()
+    {
+        add( 1 );
+    }
+
+    /**
+     * Increment the value by a given amount.
+     * <p>This method is thread safe, The MetricsProvider will take care of synchronization.</p>
+     *
+     * @param delta amount to increment, this cannot be a negative number.
+     */
+    void add( long delta );
+
+    /**
+     * Get the current value held by the counter.
+     * <p>This method is thread safe, The MetricsProvider will take care of synchronization.</p>
+     *
+     * @return the current value
+     */
+    long get();
+
+}
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/Gauge.java b/maven-metrics/src/main/java/org/apache/maven/metrics/Gauge.java
new file mode 100644
index 0000000..1c6559c
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/Gauge.java
@@ -0,0 +1,38 @@
+package org.apache.maven.metrics;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A Gauge is an application provided object which will be called by the framework in order to sample the value
+ * of an integer value.
+ */
+public interface Gauge
+{
+
+    /**
+     * Returns the current value associated with this gauge.
+     * The MetricsProvider will call this callback without taking care of synchronization, it is up to the application
+     * to handle thread safety.
+     *
+     * @return the current value for the gauge
+     */
+    Number get();
+
+}
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsContext.java b/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsContext.java
new file mode 100644
index 0000000..a42b5bb
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsContext.java
@@ -0,0 +1,92 @@
+package org.apache.maven.metrics;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A MetricsContext is like a namespace for metrics. Each component/submodule
+ * will have its own MetricsContext.
+ * <p>
+ * In some cases it is possible to have a separate MetricsContext for each
+ * instance of a component, for instance on the server side a possible usecase
+ * it to gather metrics for every other peer.
+ * </p>
+ * <p>
+ * Contexts are organized in a hierarchy.
+ * </p>
+ *
+ */
+public interface MetricsContext
+{
+
+    /**
+     * Returns a sub context.
+     *
+     * @param name the name of the subcontext
+     *
+     * @return a new metrics context.
+     */
+    MetricsContext getContext( String name );
+
+    /**
+     * Returns a counter.
+     *
+     * @param name
+     * @return the counter identified by name in this context.
+     */
+    Counter getCounter( String name );
+
+    /**
+     * Registers an user provided {@link Gauge} which will be called by the
+     * MetricsProvider in order to sample an integer value.
+     * If another Gauge was already registered the new one will
+     * take its place.
+     * Registering a null callback is not allowed.
+     *
+     * @param name unique name of the Gauge in this context
+     * @param gauge the implementation of the Gauge
+     *
+     */
+    void registerGauge( String name, Gauge gauge );
+
+    /**
+     * Unregisters the user provided {@link Gauge} bound to the given name.
+     *
+     * @param name unique name of the Gauge in this context
+     *
+     */
+    void unregisterGauge( String name );
+
+    /**
+     * Returns a summary.
+     *
+     * @param name
+     * @return the summary identified by name in this context.
+     */
+    Summary getSummary( String name );
+
+    /**
+     * Returns a set of summaries.
+     *
+     * @param name
+     * @return the summary identified by name in this context.
+     */
+    SummarySet getSummarySet( String name );
+
+}
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsProvider.java b/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsProvider.java
new file mode 100644
index 0000000..66d197c
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsProvider.java
@@ -0,0 +1,83 @@
+package org.apache.maven.metrics;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Properties;
+import java.util.function.BiConsumer;
+
+/**
+ * A MetricsProvider is a system which collects Metrics and publishes current values to external facilities.
+ *
+ * The system will create an instance of the configured class using the default constructor, which must be public.<br>
+ * After the instantiation of the provider, the system will call {@link #configure(java.util.Properties) }
+ * in order to provide configuration,
+ * and then when the system is ready to work it will call {@link #start() }.
+ * <br>
+ * Providers can be used both on ZooKeeper servers and on ZooKeeper clients.
+ */
+public interface MetricsProvider
+{
+
+    /**
+     * Configure the provider.
+     *
+     * @param configuration the configuration.
+     *
+     * @throws MetricsProviderLifeCycleException in case of invalid configuration.
+     */
+    void configure( Properties configuration ) throws MetricsProviderLifeCycleException;
+
+    /**
+     * Start the provider.
+     * For instance such method will start a network endpoint.
+     *
+     * @throws MetricsProviderLifeCycleException in case of failure
+     */
+    void start() throws MetricsProviderLifeCycleException;
+
+    /**
+     * Provides access to the root context.
+     *
+     * @return the root context
+     */
+    MetricsContext getRootContext();
+
+    /**
+     * Releases resources held by the provider.<br>
+     * This method must not throw exceptions.<br>
+     * This method can be called more than once.
+     */
+    void stop();
+
+    /**
+     * Dumps all metrics as a key-value pair.
+     * This method will be used in legacy monitor command.
+     * @param sink the receiver of all of the current values.
+     */
+    void dump( BiConsumer<String, Object> sink );
+
+    /**
+     * Reset all values.
+     * This method is optional and can be noop, depending
+     * on the underlying implementation.
+     */
+    void resetAllValues();
+
+}
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsProviderLifeCycleException.java b/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsProviderLifeCycleException.java
new file mode 100644
index 0000000..ecf7d5b
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/MetricsProviderLifeCycleException.java
@@ -0,0 +1,51 @@
+package org.apache.maven.metrics;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A generic exception thrown during the licecycle of a MetricsProvider.
+ * <p>These exception will prevent the system from booting.</p>
+ * <p>Normally these exception will be ignored during shutdown.</p>
+ */
+public class MetricsProviderLifeCycleException extends Exception
+{
+
+    private static final long serialVersionUID = 1L;
+
+    public MetricsProviderLifeCycleException()
+    {
+    }
+
+    public MetricsProviderLifeCycleException( String message )
+    {
+        super( message );
+    }
+
+    public MetricsProviderLifeCycleException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public MetricsProviderLifeCycleException( Throwable cause )
+    {
+        super( cause );
+    }
+
+}
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/Summary.java b/maven-metrics/src/main/java/org/apache/maven/metrics/Summary.java
new file mode 100644
index 0000000..9ad49c1
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/Summary.java
@@ -0,0 +1,37 @@
+package org.apache.maven.metrics;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Summaries track the size and number of events.
+ * They are able to publish minumum, maximum, average values, depending on the capabilities of the MetricsProvider.
+ */
+public interface Summary
+{
+
+    /**
+     * Register a value.
+     * <p>This method is thread safe, The MetricsProvider will take care of synchronization.</p>
+     *
+     * @param value current value
+     */
+    void add( long value );
+
+}
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/SummarySet.java b/maven-metrics/src/main/java/org/apache/maven/metrics/SummarySet.java
new file mode 100644
index 0000000..e31764a
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/SummarySet.java
@@ -0,0 +1,39 @@
+package org.apache.maven.metrics;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Summaries track the size and number of events.
+ * They are able to publish minumum, maximum, average values, depending on the capabilities of the MetricsProvider.
+ * A SummarySet is a set of {@link Summary}.
+ */
+public interface SummarySet
+{
+
+    /**
+     * Register a value.
+     * <p>This method is thread safe, The MetricsProvider will take care of synchronization.</p>
+     *
+     * @param key the key to access the Summary for the given key
+     * @param value current value
+     */
+    void add( String key, long value );
+
+}
diff --git a/maven-metrics/src/main/java/org/apache/maven/metrics/impl/NullMetricsProvider.java b/maven-metrics/src/main/java/org/apache/maven/metrics/impl/NullMetricsProvider.java
new file mode 100644
index 0000000..f7ed453
--- /dev/null
+++ b/maven-metrics/src/main/java/org/apache/maven/metrics/impl/NullMetricsProvider.java
@@ -0,0 +1,160 @@
+package org.apache.maven.metrics.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Properties;
+import java.util.function.BiConsumer;
+import org.apache.maven.metrics.Counter;
+import org.apache.maven.metrics.Gauge;
+import org.apache.maven.metrics.MetricsContext;
+import org.apache.maven.metrics.MetricsProvider;
+import org.apache.maven.metrics.MetricsProviderLifeCycleException;
+import org.apache.maven.metrics.Summary;
+import org.apache.maven.metrics.SummarySet;
+
+/**
+ * This is a dummy MetricsProvider which does nothing.
+ */
+public class NullMetricsProvider implements MetricsProvider
+{
+
+    /**
+     * Instance of NullMetricsProvider useful for tests.
+     */
+    public static final MetricsProvider INSTANCE = new NullMetricsProvider();
+
+    @Override
+    public void configure( Properties configuration ) throws MetricsProviderLifeCycleException
+    {
+    }
+
+    @Override
+    public void start() throws MetricsProviderLifeCycleException
+    {
+    }
+
+    @Override
+    public MetricsContext getRootContext()
+    {
+        return NullMetricsContext.INSTANCE;
+    }
+
+    @Override
+    public void dump( BiConsumer<String, Object> sink )
+    {
+    }
+
+    @Override
+    public void resetAllValues()
+    {
+    }
+
+    @Override
+    public void stop()
+    {
+    }
+
+    /**
+     * Default no-op implementation.
+     */
+    public static final class NullMetricsContext implements MetricsContext
+    {
+
+        public static final NullMetricsContext INSTANCE = new NullMetricsContext();
+
+        @Override
+        public MetricsContext getContext( String name )
+        {
+            return INSTANCE;
+        }
+
+        @Override
+        public Counter getCounter( String name )
+        {
+            return NullCounter.INSTANCE;
+        }
+
+        @Override
+        public void registerGauge( String name, Gauge gauge )
+        {
+        }
+
+        @Override
+        public void unregisterGauge( String name )
+        {
+        }
+
+        @Override
+        public Summary getSummary( String name )
+        {
+            return NullSummary.INSTANCE;
+        }
+
+        @Override
+        public SummarySet getSummarySet( String name )
+        {
+            return NullSummarySet.INSTANCE;
+        }
+
+    }
+
+    private static final class NullCounter implements Counter
+    {
+
+        private static final NullCounter INSTANCE = new NullCounter();
+
+        @Override
+        public void add( long delta )
+        {
+        }
+
+        @Override
+        public long get()
+        {
+            return 0;
+        }
+
+    }
+
+    private static final class NullSummary implements Summary
+    {
+
+        private static final NullSummary INSTANCE = new NullSummary();
+
+        @Override
+        public void add( long value )
+        {
+        }
+
+    }
+
+    private static final class NullSummarySet implements SummarySet
+    {
+
+        private static final NullSummarySet INSTANCE = new NullSummarySet();
+
+        @Override
+        public void add( String key, long value )
+        {
+        }
+
+    }
+
+}


[maven-studies] 08/11: [MNG-6884] - Cleanup POM File after version upgrade

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit bf7b99ab5959d78a7370af3b56c298f60154159c
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Apr 4 23:43:16 2020 +0200

    [MNG-6884] - Cleanup POM File after version upgrade
---
 pom.xml | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/pom.xml b/pom.xml
index ef2764d..d718abc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -454,22 +454,6 @@ under the License.
   <build>
     <pluginManagement>
       <plugins>
-        <!-- TODO remove source/jar/assembly versions when parent upgraded to 34 -->
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-source-plugin</artifactId>
-          <version>3.2.1</version>
-        </plugin>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-jar-plugin</artifactId>
-          <version>3.2.0</version>
-        </plugin>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-assembly-plugin</artifactId>
-          <version>3.2.0</version>
-        </plugin>
         <plugin>
           <groupId>org.codehaus.plexus</groupId>
           <artifactId>plexus-component-metadata</artifactId>


[maven-studies] 06/11: [MNG-6867] extract methods, apply SLA

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit c423a090e385735d2b826860f790077269bbf8ba
Author: Lewinski, Arne <ar...@DE-L072609.groupinfra.com>
AuthorDate: Sun Feb 16 14:54:11 2020 +0100

    [MNG-6867] extract methods, apply SLA
---
 .../plugin/internal/DefaultMavenPluginManager.java | 68 +++++++++++++---------
 1 file changed, 42 insertions(+), 26 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
index 500ead6..eec09ef 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
@@ -328,37 +328,15 @@ public class DefaultMavenPluginManager
 
         if ( plugin.isExtensions() )
         {
-            ExtensionRealmCache.CacheRecord extensionRecord;
-            try
-            {
-                RepositorySystemSession repositorySession = session.getRepositorySession();
-                extensionRecord = setupExtensionsRealm( project, plugin, repositorySession );
-            }
-            catch ( PluginManagerException e )
-            {
-                // extensions realm is expected to be fully setup at this point
-                // any exception means a problem in maven code, not a user error
-                throw new IllegalStateException( e );
-            }
-
-            ClassRealm pluginRealm = extensionRecord.getRealm();
-            List<Artifact> pluginArtifacts = extensionRecord.getArtifacts();
-
-            for ( ComponentDescriptor<?> componentDescriptor : pluginDescriptor.getComponents() )
-            {
-                componentDescriptor.setRealm( pluginRealm );
-            }
-
-            pluginDescriptor.setClassRealm( pluginRealm );
-            pluginDescriptor.setArtifacts( pluginArtifacts );
+            setupPluginDescriptor( pluginDescriptor, session );
         }
         else
         {
             Map<String, ClassLoader> foreignImports = calcImports( project, parent, imports );
 
-            PluginRealmCache.Key cacheKey = pluginRealmCache.createKey( plugin, parent, foreignImports, filter,
-                                                                        project.getRemotePluginRepositories(),
-                                                                        session.getRepositorySession() );
+            PluginRealmCache.Key cacheKey =
+                pluginRealmCache.createKey( plugin, parent, foreignImports, filter,
+                                            project.getRemotePluginRepositories(), session.getRepositorySession() );
 
             PluginRealmCache.CacheRecord cacheRecord = pluginRealmCache.get( cacheKey );
 
@@ -383,6 +361,44 @@ public class DefaultMavenPluginManager
         }
     }
 
+    private void setupPluginDescriptor( PluginDescriptor pluginDescriptor, MavenSession session )
+    {
+        setupPluginDescriptor( pluginDescriptor,
+                               setupExtensionsRealmInternal( session.getCurrentProject(), pluginDescriptor.getPlugin(),
+                                                             session.getRepositorySession() ) );
+    }
+
+    private void setupPluginDescriptor( PluginDescriptor pluginDescriptor,
+                                        ExtensionRealmCache.CacheRecord extensionRecord )
+    {
+        setupComponentDescriptors( extensionRecord, pluginDescriptor.getComponents() );
+        pluginDescriptor.setClassRealm( extensionRecord.getRealm() );
+        pluginDescriptor.setArtifacts( extensionRecord.getArtifacts() );
+    }
+
+    private void setupComponentDescriptors( ExtensionRealmCache.CacheRecord extensionRecord,
+                                            List<ComponentDescriptor<?>> components )
+    {
+        components.stream().forEach( descriptor -> descriptor.setRealm( extensionRecord.getRealm() ) );
+    }
+
+    /**
+     * For internal usage. It is assumed that the prerequisites are met so a setup of the extensions realm can be
+     * processed without any error. Any exception thrown indicates a programming error, not a user error!
+     */
+    private ExtensionRealmCache.CacheRecord setupExtensionsRealmInternal( MavenProject project, Plugin plugin,
+                                                                          RepositorySystemSession repositorySystemSession )
+    {
+        try
+        {
+            return setupExtensionsRealm( project, plugin, repositorySystemSession );
+        }
+        catch ( PluginManagerException e )
+        {
+            throw new IllegalStateException( e );
+        }
+    }
+
     private void createPluginRealm( PluginDescriptor pluginDescriptor, MavenSession session, ClassLoader parent,
                                     Map<String, ClassLoader> foreignImports, DependencyFilter filter )
         throws PluginResolutionException, PluginContainerException


[maven-studies] 02/11: [MNG-6882] - Change the URL's in tests etc. from http to https

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit 2628d713a97a8b5f761733c1b079ca51c9c5b179
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Mar 29 21:02:56 2020 +0200

    [MNG-6882] - Change the URL's in tests etc. from http to https
---
 .../apache/maven/project/PomConstructionTest.java  | 114 ++++++++++-----------
 .../artifact-id-inheritance/child/pom.xml          |   2 +-
 .../artifact-id-inheritance/pom.xml                |   4 +-
 .../basedir-aligned-interpolation/pom.xml          |   2 +-
 .../pom-with-unusual-name.xml                      |   2 +-
 .../baseuri-interpolation/pom.xml                  |   2 +-
 .../boolean-interpolation/pom.xml                  |   2 +-
 .../build-extension-inheritance/pom.xml            |   2 +-
 .../build-extension-inheritance/sub/pom.xml        |   2 +-
 .../complete-model/w-parent/pom.xml                |   2 +-
 .../complete-model/w-parent/sub/pom.xml            |  34 +++---
 .../complete-model/wo-parent/pom.xml               |  34 +++---
 .../contributors-inheritance/child-2/pom.xml       |   2 +-
 .../contributors-inheritance/pom.xml               |   2 +-
 .../dependency-inheritance/maven-parent.xml        |   2 +-
 .../dependency-inheritance/pom.xml                 |   2 +-
 .../dependency-inheritance/sub/pom.xml             |   2 +-
 .../dependency-order/w-plugin-mgmt/pom.xml         |   2 +-
 .../dependency-order/wo-plugin-mgmt/pom.xml        |   2 +-
 .../developers-inheritance/child-2/pom.xml         |   2 +-
 .../developers-inheritance/pom.xml                 |   2 +-
 .../distribution-management/pom.xml                |   2 +-
 .../resources-project-builder/empty-scm/pom.xml    |   2 +-
 .../equal-plugin-deps/pom.xml                      |   2 +-
 .../equal-plugin-exec-ids/pom.xml                  |   2 +-
 .../full-interpolation/pom.xml                     |   2 +-
 .../pom.xml                                        |   4 +-
 .../sub/pom.xml                                    |   2 +-
 .../active-profile/pom.xml                         |   2 +-
 .../active-profile/sub/pom.xml                     |   2 +-
 .../no-profile/pom.xml                             |   2 +-
 .../no-profile/sub/pom.xml                         |   2 +-
 .../interpolation-cli-wins/pom.xml                 |   2 +-
 .../jdk-activation/pom.xml                         |   2 +-
 .../join-different-containers-same-id/pom.xml      |   2 +-
 .../licenses-inheritance/child-2/pom.xml           |   4 +-
 .../licenses-inheritance/pom.xml                   |   4 +-
 .../limited-inheritance/child/pom.xml              |   6 +-
 .../limited-inheritance/pom.xml                    |  10 +-
 .../mailing-lists-inheritance/child-2/pom.xml      |   2 +-
 .../mailing-lists-inheritance/pom.xml              |   2 +-
 .../managed-profile-dependency/pom.xml             |   2 +-
 .../managed-profile-dependency/sub/pom.xml         |   2 +-
 .../merged-filter-order/pom.xml                    |   2 +-
 .../merged-filter-order/sub/pom.xml                |   2 +-
 .../w-plugin-mgmt/pom.xml                          |   2 +-
 .../w-plugin-mgmt/sub/pom.xml                      |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../wo-plugin-mgmt/sub/pom.xml                     |   2 +-
 .../w-plugin-mgmt/pom.xml                          |   2 +-
 .../w-plugin-mgmt/sub/pom.xml                      |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../wo-plugin-mgmt/sub/pom.xml                     |   2 +-
 .../merged-plugin-exec-order/w-plugin-mgmt/pom.xml |   2 +-
 .../w-plugin-mgmt/sub/pom.xml                      |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../wo-plugin-mgmt/sub/pom.xml                     |   2 +-
 .../resources-project-builder/micromailer/pom.xml  |   2 +-
 .../micromailer/spice-parent-9.pom                 |   2 +-
 .../multiple-repos/pom.xml                         |   4 +-
 .../multiple-repos/sub/pom.xml                     |   4 +-
 .../nested-build-dir-interpolation/pom.xml         |   2 +-
 .../parent-pom-packaging/pom.xml                   |   2 +-
 .../parent-pom-packaging/sub/pom.xml               |   2 +-
 .../platform-file-separator/pom.xml                |   2 +-
 .../plugin-config-append/no-profile/pom.xml        |   2 +-
 .../no-profile/subproject/pom.xml                  |   2 +-
 .../plugin-config-append/with-profile/pom.xml      |   2 +-
 .../with-profile/subproject/pom.xml                |   2 +-
 .../plugin-config-attributes/w-plugin-mgmt/pom.xml |   2 +-
 .../plugin-config-attributes/w-profile/pom.xml     |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../plugin-config-merging/child/pom.xml            |   2 +-
 .../plugin-config-merging/pom.xml                  |   2 +-
 .../plugin-config-order/w-plugin-mgmt/pom.xml      |   2 +-
 .../plugin-config-order/wo-plugin-mgmt/pom.xml     |   2 +-
 .../plugin-exec-config-order/w-plugin-mgmt/pom.xml |   2 +-
 .../wo-plugin-mgmt/pom.xml                         |   2 +-
 .../plugin-exec-goals-order/w-plugin-mgmt/pom.xml  |   2 +-
 .../plugin-exec-goals-order/wo-plugin-mgmt/pom.xml |   2 +-
 .../plugin-exec-inheritance/pom.xml                |   2 +-
 .../plugin-exec-inheritance/w-merge/pom.xml        |   2 +-
 .../plugin-exec-inheritance/wo-merge/pom.xml       |   2 +-
 .../pom.xml                                        |   2 +-
 .../sub/pom.xml                                    |   2 +-
 .../plugin-exec-merging-wo-version/pom.xml         |   2 +-
 .../plugin-exec-merging-wo-version/sub/pom.xml     |   2 +-
 .../plugin-exec-merging/w-plugin-mgmt/pom.xml      |   2 +-
 .../plugin-exec-merging/w-plugin-mgmt/sub/pom.xml  |   2 +-
 .../plugin-exec-merging/wo-plugin-mgmt/pom.xml     |   2 +-
 .../plugin-exec-merging/wo-plugin-mgmt/sub/pom.xml |   2 +-
 .../plugin-exec-order-and-default-exec/pom.xml     |   2 +-
 .../plugin-exec-order-with-lifecycle/pom.xml       |   2 +-
 .../plugin-exec-order/w-plugin-mgmt/pom.xml        |   2 +-
 .../plugin-exec-order/wo-plugin-mgmt/pom.xml       |   2 +-
 .../plugin-exec-w-and-wo-id/w-plugin-mgmt/pom.xml  |   2 +-
 .../plugin-exec-w-and-wo-id/wo-plugin-mgmt/pom.xml |   2 +-
 .../plugin-inheritance-merge-order/pom.xml         |   2 +-
 .../plugin-inheritance-merge-order/sub/pom.xml     |   2 +-
 .../plugin-inheritance-order/child/pom.xml         |   2 +-
 .../plugin-inheritance-order/pom.xml               |   2 +-
 .../plugin-injection-merge-order/pom.xml           |   2 +-
 .../plugin-management-duplicate/pom.xml            |   2 +-
 .../plugin-management-duplicate/sub/pom.xml        |   2 +-
 .../child/pom.xml                                  |   2 +-
 .../plugin-management-for-implicit-plugin/pom.xml  |   2 +-
 .../plugin-management-inheritance/pom.xml          |   2 +-
 .../pom-encoding/latin-1/pom.xml                   |   2 +-
 .../pom-encoding/utf-8/pom.xml                     |   2 +-
 .../pom-inheritance/pom.xml                        |  22 ++--
 .../pom-inheritance/sub/pom.xml                    |   2 +-
 .../prerequisites-inheritance/child/pom.xml        |   2 +-
 .../prerequisites-inheritance/pom.xml              |   2 +-
 .../profile-dependencies-multiple-profiles/pom.xml |   2 +-
 .../profile-injected-dependencies/pom.xml          |   2 +-
 .../profile-injection-order/pom.xml                |   2 +-
 .../profile-plugin-mng-dependencies/pom.xml        |   2 +-
 .../profile-plugin-mng-dependencies/sub/pom.xml    |   2 +-
 .../profile-plugins/pom.xml                        |   2 +-
 .../profile-properties-interpolation/pom.xml       |   4 +-
 .../properties-inheritance/pom.xml                 |   2 +-
 .../properties-inheritance/sub/pom.xml             |   2 +-
 .../repo-inheritance/pom.xml                       |   2 +-
 .../reporting-plugin-config/pom.xml                |   2 +-
 .../reporting-plugin-config/sub/pom.xml            |   2 +-
 .../system-property-interpolation/pom.xml          |   2 +-
 .../resources-project-builder/unc-path/pom.xml     |   2 +-
 .../resources-project-builder/unc-path/sub/pom.xml |   2 +-
 .../dep-mgmt-in-profile/pom.xml                    |   2 +-
 .../unique-dependency-key/dep-mgmt/pom.xml         |   2 +-
 .../unique-dependency-key/deps-in-profile/pom.xml  |   2 +-
 .../unique-dependency-key/deps/pom.xml             |   2 +-
 .../artifact-repo-in-profile/pom.xml               |   6 +-
 .../unique-repo-id/artifact-repo/pom.xml           |   6 +-
 .../unique-repo-id/plugin-repo-in-profile/pom.xml  |   6 +-
 .../unique-repo-id/plugin-repo/pom.xml             |   6 +-
 .../child/pom.xml                                  |  14 +--
 .../unprefixed-expression-interpolation/pom.xml    |   2 +-
 .../url-append/child/pom.xml                       |   2 +-
 .../url-append/parent/pom.xml                      |  10 +-
 .../url-inheritance/another-parent/pom.xml         |   2 +-
 .../url-inheritance/another-parent/sub/pom.xml     |   2 +-
 .../url-inheritance/pom.xml                        |  24 ++---
 .../url-inheritance/sub/pom.xml                    |   2 +-
 .../url-no-decoding/pom.xml                        |  10 +-
 .../xml-coalesce-text/pom.xml                      |   2 +-
 .../xml-markup-interpolation/pom.xml               |   2 +-
 .../xml-whitespace/pom.xml                         |   2 +-
 .../xml-whitespace/sub/pom.xml                     |   2 +-
 149 files changed, 292 insertions(+), 294 deletions(-)

diff --git a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
index 9e16ebc..103d399 100644
--- a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
@@ -19,11 +19,6 @@ package org.apache.maven.project;
  * under the License.
  */
 
-import static org.hamcrest.Matchers.endsWith;
-import static org.hamcrest.Matchers.lessThan;
-import static org.hamcrest.Matchers.startsWith;
-import static org.junit.Assert.assertThat;
-
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -44,7 +39,10 @@ import org.codehaus.plexus.PlexusTestCase;
 import org.eclipse.aether.DefaultRepositorySystemSession;
 import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
 import org.eclipse.aether.repository.LocalRepository;
+
+import static org.hamcrest.Matchers.*;
 import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertThat;
 
 public class PomConstructionTest
     extends PlexusTestCase
@@ -624,18 +622,18 @@ public class PomConstructionTest
         throws Exception
     {
         PomTestWrapper pom = buildPom( "url-inheritance/sub" );
-        assertEquals( "http://parent.url/child", pom.getValue( "url" ) );
-        assertEquals( "http://parent.url/org", pom.getValue( "organization/url" ) );
-        assertEquals( "http://parent.url/license.txt", pom.getValue( "licenses[1]/url" ) );
-        assertEquals( "http://parent.url/viewvc/child", pom.getValue( "scm/url" ) );
-        assertEquals( "http://parent.url/scm/child", pom.getValue( "scm/connection" ) );
+        assertEquals( "https://parent.url/child", pom.getValue( "url" ) );
+        assertEquals( "https://parent.url/org", pom.getValue( "organization/url" ) );
+        assertEquals( "https://parent.url/license.txt", pom.getValue( "licenses[1]/url" ) );
+        assertEquals( "https://parent.url/viewvc/child", pom.getValue( "scm/url" ) );
+        assertEquals( "https://parent.url/scm/child", pom.getValue( "scm/connection" ) );
         assertEquals( "https://parent.url/scm/child", pom.getValue( "scm/developerConnection" ) );
-        assertEquals( "http://parent.url/issues", pom.getValue( "issueManagement/url" ) );
-        assertEquals( "http://parent.url/ci", pom.getValue( "ciManagement/url" ) );
-        assertEquals( "http://parent.url/dist", pom.getValue( "distributionManagement/repository/url" ) );
-        assertEquals( "http://parent.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) );
-        assertEquals( "http://parent.url/site/child", pom.getValue( "distributionManagement/site/url" ) );
-        assertEquals( "http://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) );
+        assertEquals( "https://parent.url/issues", pom.getValue( "issueManagement/url" ) );
+        assertEquals( "https://parent.url/ci", pom.getValue( "ciManagement/url" ) );
+        assertEquals( "https://parent.url/dist", pom.getValue( "distributionManagement/repository/url" ) );
+        assertEquals( "https://parent.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) );
+        assertEquals( "https://parent.url/site/child", pom.getValue( "distributionManagement/site/url" ) );
+        assertEquals( "https://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) );
     }
 
     /* MNG-3846*/
@@ -643,18 +641,18 @@ public class PomConstructionTest
         throws Exception
     {
         PomTestWrapper pom = buildPom( "url-inheritance/another-parent/sub" );
-        assertEquals( "http://parent.url/ap/child", pom.getValue( "url" ) );
-        assertEquals( "http://parent.url/org", pom.getValue( "organization/url" ) );
-        assertEquals( "http://parent.url/license.txt", pom.getValue( "licenses[1]/url" ) );
-        assertEquals( "http://parent.url/viewvc/ap/child", pom.getValue( "scm/url" ) );
-        assertEquals( "http://parent.url/scm/ap/child", pom.getValue( "scm/connection" ) );
+        assertEquals( "https://parent.url/ap/child", pom.getValue( "url" ) );
+        assertEquals( "https://parent.url/org", pom.getValue( "organization/url" ) );
+        assertEquals( "https://parent.url/license.txt", pom.getValue( "licenses[1]/url" ) );
+        assertEquals( "https://parent.url/viewvc/ap/child", pom.getValue( "scm/url" ) );
+        assertEquals( "https://parent.url/scm/ap/child", pom.getValue( "scm/connection" ) );
         assertEquals( "https://parent.url/scm/ap/child", pom.getValue( "scm/developerConnection" ) );
-        assertEquals( "http://parent.url/issues", pom.getValue( "issueManagement/url" ) );
-        assertEquals( "http://parent.url/ci", pom.getValue( "ciManagement/url" ) );
-        assertEquals( "http://parent.url/dist", pom.getValue( "distributionManagement/repository/url" ) );
-        assertEquals( "http://parent.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) );
-        assertEquals( "http://parent.url/site/ap/child", pom.getValue( "distributionManagement/site/url" ) );
-        assertEquals( "http://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) );
+        assertEquals( "https://parent.url/issues", pom.getValue( "issueManagement/url" ) );
+        assertEquals( "https://parent.url/ci", pom.getValue( "ciManagement/url" ) );
+        assertEquals( "https://parent.url/dist", pom.getValue( "distributionManagement/repository/url" ) );
+        assertEquals( "https://parent.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) );
+        assertEquals( "https://parent.url/site/ap/child", pom.getValue( "distributionManagement/site/url" ) );
+        assertEquals( "https://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) );
     }
     //*/
 
@@ -715,17 +713,17 @@ public class PomConstructionTest
 
         assertEquals( "child-name", pom.getValue( "properties/projectName" ) );
         assertEquals( "child-desc", pom.getValue( "properties/projectDesc" ) );
-        assertEquals( "http://child.org/", pom.getValue( "properties/projectUrl" ) );
+        assertEquals( "https://child.org/", pom.getValue( "properties/projectUrl" ) );
         assertEquals( "2008", pom.getValue( "properties/projectYear" ) );
         assertEquals( "child-org-name", pom.getValue( "properties/projectOrgName" ) );
 
         assertEquals( "2.0.0", pom.getValue( "properties/projectPrereqMvn" ) );
-        assertEquals( "http://scm.org/", pom.getValue( "properties/projectScmUrl" ) );
-        assertEquals( "http://issue.org/", pom.getValue( "properties/projectIssueUrl" ) );
-        assertEquals( "http://ci.org/", pom.getValue( "properties/projectCiUrl" ) );
+        assertEquals( "https://scm.org/", pom.getValue( "properties/projectScmUrl" ) );
+        assertEquals( "https://issue.org/", pom.getValue( "properties/projectIssueUrl" ) );
+        assertEquals( "https://ci.org/", pom.getValue( "properties/projectCiUrl" ) );
         assertEquals( "child-dist-repo", pom.getValue( "properties/projectDistRepoName" ) );
-        assertEquals( "http://dist.org/", pom.getValue( "properties/projectDistRepoUrl" ) );
-        assertEquals( "http://site.org/", pom.getValue( "properties/projectDistSiteUrl" ) );
+        assertEquals( "https://dist.org/", pom.getValue( "properties/projectDistRepoUrl" ) );
+        assertEquals( "https://site.org/", pom.getValue( "properties/projectDistSiteUrl" ) );
 
         assertEquals( "org.apache.maven.its.mng3831", pom.getValue( "properties/parentGroupId" ) );
         assertEquals( "parent", pom.getValue( "properties/parentArtifactId" ) );
@@ -1013,11 +1011,11 @@ public class PomConstructionTest
         throws Exception
     {
         PomTestWrapper pom = this.buildPom( "url-append/child" );
-        assertEquals( "http://project.url/child", pom.getValue( "url" ) );
-        assertEquals( "http://viewvc.project.url/child", pom.getValue( "scm/url" ) );
-        assertEquals( "http://scm.project.url/child", pom.getValue( "scm/connection" ) );
+        assertEquals( "https://project.url/child", pom.getValue( "url" ) );
+        assertEquals( "https://viewvc.project.url/child", pom.getValue( "scm/url" ) );
+        assertEquals( "https://scm.project.url/child", pom.getValue( "scm/connection" ) );
         assertEquals( "https://scm.project.url/child", pom.getValue( "scm/developerConnection" ) );
-        assertEquals( "http://site.project.url/child", pom.getValue( "distributionManagement/site/url" ) );
+        assertEquals( "https://site.project.url/child", pom.getValue( "distributionManagement/site/url" ) );
     }
 
     /** MNG-0479 */
@@ -1162,15 +1160,15 @@ public class PomConstructionTest
 
         assertEquals( "project-name", pom.getValue( "name" ) );
         assertEquals( "project-description", pom.getValue( "description" ) );
-        assertEquals( "http://project.url/", pom.getValue( "url" ) );
+        assertEquals( "https://project.url/", pom.getValue( "url" ) );
         assertEquals( "2009", pom.getValue( "inceptionYear" ) );
 
         assertEquals( "project-org", pom.getValue( "organization/name" ) );
-        assertEquals( "http://project-org.url/", pom.getValue( "organization/url" ) );
+        assertEquals( "https://project-org.url/", pom.getValue( "organization/url" ) );
 
         assertEquals( 1, ( (List<?>) pom.getValue( "licenses" ) ).size() );
         assertEquals( "project-license", pom.getValue( "licenses[1]/name" ) );
-        assertEquals( "http://project.url/license", pom.getValue( "licenses[1]/url" ) );
+        assertEquals( "https://project.url/license", pom.getValue( "licenses[1]/url" ) );
         assertEquals( "repo", pom.getValue( "licenses[1]/distribution" ) );
         assertEquals( "free", pom.getValue( "licenses[1]/comments" ) );
 
@@ -1178,9 +1176,9 @@ public class PomConstructionTest
         assertEquals( "dev", pom.getValue( "developers[1]/id" ) );
         assertEquals( "project-developer", pom.getValue( "developers[1]/name" ) );
         assertEquals( "developer@", pom.getValue( "developers[1]/email" ) );
-        assertEquals( "http://developer", pom.getValue( "developers[1]/url" ) );
+        assertEquals( "https://developer", pom.getValue( "developers[1]/url" ) );
         assertEquals( "developer", pom.getValue( "developers[1]/organization" ) );
-        assertEquals( "http://devel.org", pom.getValue( "developers[1]/organizationUrl" ) );
+        assertEquals( "https://devel.org", pom.getValue( "developers[1]/organizationUrl" ) );
         assertEquals( "-1", pom.getValue( "developers[1]/timezone" ) );
         assertEquals( "yes", pom.getValue( "developers[1]/properties/developer" ) );
         assertEquals( 1, ( (List<?>) pom.getValue( "developers[1]/roles" ) ).size() );
@@ -1189,9 +1187,9 @@ public class PomConstructionTest
         assertEquals( 1, ( (List<?>) pom.getValue( "contributors" ) ).size() );
         assertEquals( "project-contributor", pom.getValue( "contributors[1]/name" ) );
         assertEquals( "contributor@", pom.getValue( "contributors[1]/email" ) );
-        assertEquals( "http://contributor", pom.getValue( "contributors[1]/url" ) );
+        assertEquals( "https://contributor", pom.getValue( "contributors[1]/url" ) );
         assertEquals( "contributor", pom.getValue( "contributors[1]/organization" ) );
-        assertEquals( "http://contrib.org", pom.getValue( "contributors[1]/organizationUrl" ) );
+        assertEquals( "https://contrib.org", pom.getValue( "contributors[1]/organizationUrl" ) );
         assertEquals( "+1", pom.getValue( "contributors[1]/timezone" ) );
         assertEquals( "yes", pom.getValue( "contributors[1]/properties/contributor" ) );
         assertEquals( 1, ( (List<?>) pom.getValue( "contributors[1]/roles" ) ).size() );
@@ -1208,16 +1206,16 @@ public class PomConstructionTest
 
         assertEquals( "2.0.1", pom.getValue( "prerequisites/maven" ) );
 
-        assertEquals( "http://project.url/trunk", pom.getValue( "scm/url" ) );
-        assertEquals( "http://project.url/scm", pom.getValue( "scm/connection" ) );
+        assertEquals( "https://project.url/trunk", pom.getValue( "scm/url" ) );
+        assertEquals( "https://project.url/scm", pom.getValue( "scm/connection" ) );
         assertEquals( "https://project.url/scm", pom.getValue( "scm/developerConnection" ) );
         assertEquals( "TAG", pom.getValue( "scm/tag" ) );
 
         assertEquals( "issues", pom.getValue( "issueManagement/system" ) );
-        assertEquals( "http://project.url/issues", pom.getValue( "issueManagement/url" ) );
+        assertEquals( "https://project.url/issues", pom.getValue( "issueManagement/url" ) );
 
         assertEquals( "ci", pom.getValue( "ciManagement/system" ) );
-        assertEquals( "http://project.url/ci", pom.getValue( "ciManagement/url" ) );
+        assertEquals( "https://project.url/ci", pom.getValue( "ciManagement/url" ) );
         assertEquals( 1, ( (List<?>) pom.getValue( "ciManagement/notifiers" ) ).size() );
         assertEquals( "irc", pom.getValue( "ciManagement/notifiers[1]/type" ) );
         assertEquals( "ci@", pom.getValue( "ciManagement/notifiers[1]/address" ) );
@@ -1229,19 +1227,19 @@ public class PomConstructionTest
 
         assertEquals( "project.distros", pom.getValue( "distributionManagement/repository/id" ) );
         assertEquals( "distros", pom.getValue( "distributionManagement/repository/name" ) );
-        assertEquals( "http://project.url/dist", pom.getValue( "distributionManagement/repository/url" ) );
+        assertEquals( "https://project.url/dist", pom.getValue( "distributionManagement/repository/url" ) );
         assertEquals( Boolean.TRUE, pom.getValue( "distributionManagement/repository/uniqueVersion" ) );
 
         assertEquals( "project.snaps", pom.getValue( "distributionManagement/snapshotRepository/id" ) );
         assertEquals( "snaps", pom.getValue( "distributionManagement/snapshotRepository/name" ) );
-        assertEquals( "http://project.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) );
+        assertEquals( "https://project.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) );
         assertEquals( Boolean.FALSE, pom.getValue( "distributionManagement/snapshotRepository/uniqueVersion" ) );
 
         assertEquals( "project.site", pom.getValue( "distributionManagement/site/id" ) );
         assertEquals( "docs", pom.getValue( "distributionManagement/site/name" ) );
-        assertEquals( "http://project.url/site", pom.getValue( "distributionManagement/site/url" ) );
+        assertEquals( "https://project.url/site", pom.getValue( "distributionManagement/site/url" ) );
 
-        assertEquals( "http://project.url/download", pom.getValue( "distributionManagement/downloadUrl" ) );
+        assertEquals( "https://project.url/download", pom.getValue( "distributionManagement/downloadUrl" ) );
         assertEquals( "reloc-gid", pom.getValue( "distributionManagement/relocation/groupId" ) );
         assertEquals( "reloc-aid", pom.getValue( "distributionManagement/relocation/artifactId" ) );
         assertEquals( "reloc-version", pom.getValue( "distributionManagement/relocation/version" ) );
@@ -1279,7 +1277,7 @@ public class PomConstructionTest
 
         assertEquals( 2, ( (List<?>) pom.getValue( "repositories" ) ).size() );
         assertEquals( "project-remote-repo", pom.getValue( "repositories[1]/id" ) );
-        assertEquals( "http://project.url/remote", pom.getValue( "repositories[1]/url" ) );
+        assertEquals( "https://project.url/remote", pom.getValue( "repositories[1]/url" ) );
         assertEquals( "repo", pom.getValue( "repositories[1]/name" ) );
         assertEquals( RepositorySystem.DEFAULT_REMOTE_REPO_ID, pom.getValue( "repositories[2]/id" ) );
         assertEquals( RepositorySystem.DEFAULT_REMOTE_REPO_URL, pom.getValue( "repositories[2]/url" ) );
@@ -1457,12 +1455,12 @@ public class PomConstructionTest
         throws Exception
     {
         PomTestWrapper pom = this.buildPom( "url-no-decoding" );
-        assertEquals( "http://maven.apache.org/spacy%20path", pom.getValue( "url" ) );
-        assertEquals( "http://svn.apache.org/viewvc/spacy%20path", pom.getValue( "scm/url" ) );
+        assertEquals( "https://maven.apache.org/spacy%20path", pom.getValue( "url" ) );
+        assertEquals( "https://svn.apache.org/viewvc/spacy%20path", pom.getValue( "scm/url" ) );
         assertEquals( "scm:svn:svn+ssh://svn.apache.org/spacy%20path", pom.getValue( "scm/connection" ) );
         assertEquals( "scm:svn:svn+ssh://svn.apache.org/spacy%20path", pom.getValue( "scm/developerConnection" ) );
-        assertEquals( "http://issues.apache.org/spacy%20path", pom.getValue( "issueManagement/url" ) );
-        assertEquals( "http://ci.apache.org/spacy%20path", pom.getValue( "ciManagement/url" ) );
+        assertEquals( "https://issues.apache.org/spacy%20path", pom.getValue( "issueManagement/url" ) );
+        assertEquals( "https://ci.apache.org/spacy%20path", pom.getValue( "ciManagement/url" ) );
         assertEquals( "scm:svn:svn+ssh://dist.apache.org/spacy%20path",
                       pom.getValue( "distributionManagement/repository/url" ) );
         assertEquals( "scm:svn:svn+ssh://snap.apache.org/spacy%20path",
@@ -1635,7 +1633,7 @@ public class PomConstructionTest
         PomTestWrapper pom = buildPom( "licenses-inheritance/child-2" );
         assertEquals( 1, ( (List<?>) pom.getValue( "licenses" ) ).size() );
         assertEquals( "child-license", pom.getValue( "licenses[1]/name" ) );
-        assertEquals( "http://child.url/license", pom.getValue( "licenses[1]/url" ) );
+        assertEquals( "https://child.url/license", pom.getValue( "licenses[1]/url" ) );
     }
 
     public void testDevelopersAreInheritedButNotAggregated()
diff --git a/maven-core/src/test/resources-project-builder/artifact-id-inheritance/child/pom.xml b/maven-core/src/test/resources-project-builder/artifact-id-inheritance/child/pom.xml
index eee189d..c81c426 100644
--- a/maven-core/src/test/resources-project-builder/artifact-id-inheritance/child/pom.xml
+++ b/maven-core/src/test/resources-project-builder/artifact-id-inheritance/child/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/artifact-id-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/artifact-id-inheritance/pom.xml
index f22afbc..fa49e12 100644
--- a/maven-core/src/test/resources-project-builder/artifact-id-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/artifact-id-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -31,5 +31,5 @@ under the License.
   NOTE: This extends the test to check an edge case of URL adjustment which must not error out during inheritance
   if the child misses the artifactId (as to be reported by validation).
   -->
-  <url>http://maven.apache.org/</url>
+  <url>https://maven.apache.org/</url>
 </project>
diff --git a/maven-core/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml
index 1885fc4..f6deed8 100644
--- a/maven-core/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/basedir-interpolation/pom-with-unusual-name.xml b/maven-core/src/test/resources-project-builder/basedir-interpolation/pom-with-unusual-name.xml
index 1c037e6..ddc830e 100644
--- a/maven-core/src/test/resources-project-builder/basedir-interpolation/pom-with-unusual-name.xml
+++ b/maven-core/src/test/resources-project-builder/basedir-interpolation/pom-with-unusual-name.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/baseuri-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/baseuri-interpolation/pom.xml
index f1d4e6c..fea80c5 100644
--- a/maven-core/src/test/resources-project-builder/baseuri-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/baseuri-interpolation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/boolean-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/boolean-interpolation/pom.xml
index 992eac1..2d8017b 100644
--- a/maven-core/src/test/resources-project-builder/boolean-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/boolean-interpolation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/build-extension-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/build-extension-inheritance/pom.xml
index 262af4f..30ad54b 100644
--- a/maven-core/src/test/resources-project-builder/build-extension-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/build-extension-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/build-extension-inheritance/sub/pom.xml b/maven-core/src/test/resources-project-builder/build-extension-inheritance/sub/pom.xml
index dc8f6f5..e9e533f 100644
--- a/maven-core/src/test/resources-project-builder/build-extension-inheritance/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/build-extension-inheritance/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/complete-model/w-parent/pom.xml b/maven-core/src/test/resources-project-builder/complete-model/w-parent/pom.xml
index ebcd7d1..ae49ae2 100644
--- a/maven-core/src/test/resources-project-builder/complete-model/w-parent/pom.xml
+++ b/maven-core/src/test/resources-project-builder/complete-model/w-parent/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/complete-model/w-parent/sub/pom.xml b/maven-core/src/test/resources-project-builder/complete-model/w-parent/sub/pom.xml
index 68ca28d..9e28166 100644
--- a/maven-core/src/test/resources-project-builder/complete-model/w-parent/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/complete-model/w-parent/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -35,16 +35,16 @@ under the License.
 
   <name>project-name</name>
   <description>project-description</description>
-  <url>http://project.url/</url>
+  <url>https://project.url/</url>
   <inceptionYear>2009</inceptionYear>
   <organization>
     <name>project-org</name>
-    <url>http://project-org.url/</url>
+    <url>https://project-org.url/</url>
   </organization>
   <licenses>
     <license>
       <name>project-license</name>
-      <url>http://project.url/license</url>
+      <url>https://project.url/license</url>
       <distribution>repo</distribution>
       <comments>free</comments>
     </license>
@@ -55,9 +55,9 @@ under the License.
       <id>dev</id>
       <name>project-developer</name>
       <email>developer@</email>
-      <url>http://developer</url>
+      <url>https://developer</url>
       <organization>developer</organization>
-      <organizationUrl>http://devel.org</organizationUrl>
+      <organizationUrl>https://devel.org</organizationUrl>
       <roles>
         <role>devel</role>
       </roles>
@@ -71,9 +71,9 @@ under the License.
     <contributor>
       <name>project-contributor</name>
       <email>contributor@</email>
-      <url>http://contributor</url>
+      <url>https://contributor</url>
       <organization>contributor</organization>
-      <organizationUrl>http://contrib.org</organizationUrl>
+      <organizationUrl>https://contrib.org</organizationUrl>
       <roles>
         <role>contrib</role>
       </roles>
@@ -102,18 +102,18 @@ under the License.
   </prerequisites>
 
   <scm>
-    <url>http://project.url/trunk</url>
-    <connection>http://project.url/scm</connection>
+    <url>https://project.url/trunk</url>
+    <connection>https://project.url/scm</connection>
     <developerConnection>https://project.url/scm</developerConnection>
     <tag>TAG</tag>
   </scm>
   <issueManagement>
     <system>issues</system>
-    <url>http://project.url/issues</url>
+    <url>https://project.url/issues</url>
   </issueManagement>
   <ciManagement>
     <system>ci</system>
-    <url>http://project.url/ci</url>
+    <url>https://project.url/ci</url>
     <notifiers>
       <notifier>
         <type>irc</type>
@@ -130,22 +130,22 @@ under the License.
   </ciManagement>
   <distributionManagement>
     <repository>
-      <url>http://project.url/dist</url>
+      <url>https://project.url/dist</url>
       <id>project.distros</id>
       <name>distros</name>
     </repository>
     <snapshotRepository>
-      <url>http://project.url/snaps</url>
+      <url>https://project.url/snaps</url>
       <id>project.snaps</id>
       <name>snaps</name>
       <uniqueVersion>false</uniqueVersion>
     </snapshotRepository>
     <site>
-      <url>http://project.url/site</url>
+      <url>https://project.url/site</url>
       <id>project.site</id>
       <name>docs</name>
     </site>
-    <downloadUrl>http://project.url/download</downloadUrl>
+    <downloadUrl>https://project.url/download</downloadUrl>
     <relocation>
       <groupId>reloc-gid</groupId>
       <artifactId>reloc-aid</artifactId>
@@ -200,7 +200,7 @@ under the License.
   <repositories>
     <repository>
       <id>project-remote-repo</id>
-      <url>http://project.url/remote</url>
+      <url>https://project.url/remote</url>
       <name>repo</name>
     </repository>
   </repositories>
diff --git a/maven-core/src/test/resources-project-builder/complete-model/wo-parent/pom.xml b/maven-core/src/test/resources-project-builder/complete-model/wo-parent/pom.xml
index 7b1ad79..5913d18 100644
--- a/maven-core/src/test/resources-project-builder/complete-model/wo-parent/pom.xml
+++ b/maven-core/src/test/resources-project-builder/complete-model/wo-parent/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -29,16 +29,16 @@ under the License.
 
   <name>project-name</name>
   <description>project-description</description>
-  <url>http://project.url/</url>
+  <url>https://project.url/</url>
   <inceptionYear>2009</inceptionYear>
   <organization>
     <name>project-org</name>
-    <url>http://project-org.url/</url>
+    <url>https://project-org.url/</url>
   </organization>
   <licenses>
     <license>
       <name>project-license</name>
-      <url>http://project.url/license</url>
+      <url>https://project.url/license</url>
       <distribution>repo</distribution>
       <comments>free</comments>
     </license>
@@ -49,9 +49,9 @@ under the License.
       <id>dev</id>
       <name>project-developer</name>
       <email>developer@</email>
-      <url>http://developer</url>
+      <url>https://developer</url>
       <organization>developer</organization>
-      <organizationUrl>http://devel.org</organizationUrl>
+      <organizationUrl>https://devel.org</organizationUrl>
       <roles>
         <role>devel</role>
       </roles>
@@ -65,9 +65,9 @@ under the License.
     <contributor>
       <name>project-contributor</name>
       <email>contributor@</email>
-      <url>http://contributor</url>
+      <url>https://contributor</url>
       <organization>contributor</organization>
-      <organizationUrl>http://contrib.org</organizationUrl>
+      <organizationUrl>https://contrib.org</organizationUrl>
       <roles>
         <role>contrib</role>
       </roles>
@@ -96,18 +96,18 @@ under the License.
   </prerequisites>
 
   <scm>
-    <url>http://project.url/trunk</url>
-    <connection>http://project.url/scm</connection>
+    <url>https://project.url/trunk</url>
+    <connection>https://project.url/scm</connection>
     <developerConnection>https://project.url/scm</developerConnection>
     <tag>TAG</tag>
   </scm>
   <issueManagement>
     <system>issues</system>
-    <url>http://project.url/issues</url>
+    <url>https://project.url/issues</url>
   </issueManagement>
   <ciManagement>
     <system>ci</system>
-    <url>http://project.url/ci</url>
+    <url>https://project.url/ci</url>
     <notifiers>
       <notifier>
         <type>irc</type>
@@ -124,22 +124,22 @@ under the License.
   </ciManagement>
   <distributionManagement>
     <repository>
-      <url>http://project.url/dist</url>
+      <url>https://project.url/dist</url>
       <id>project.distros</id>
       <name>distros</name>
     </repository>
     <snapshotRepository>
-      <url>http://project.url/snaps</url>
+      <url>https://project.url/snaps</url>
       <id>project.snaps</id>
       <name>snaps</name>
       <uniqueVersion>false</uniqueVersion>
     </snapshotRepository>
     <site>
-      <url>http://project.url/site</url>
+      <url>https://project.url/site</url>
       <id>project.site</id>
       <name>docs</name>
     </site>
-    <downloadUrl>http://project.url/download</downloadUrl>
+    <downloadUrl>https://project.url/download</downloadUrl>
     <relocation>
       <groupId>reloc-gid</groupId>
       <artifactId>reloc-aid</artifactId>
@@ -194,7 +194,7 @@ under the License.
   <repositories>
     <repository>
       <id>project-remote-repo</id>
-      <url>http://project.url/remote</url>
+      <url>https://project.url/remote</url>
       <name>repo</name>
     </repository>
   </repositories>
diff --git a/maven-core/src/test/resources-project-builder/contributors-inheritance/child-2/pom.xml b/maven-core/src/test/resources-project-builder/contributors-inheritance/child-2/pom.xml
index 745289f..bb6dfa5 100644
--- a/maven-core/src/test/resources-project-builder/contributors-inheritance/child-2/pom.xml
+++ b/maven-core/src/test/resources-project-builder/contributors-inheritance/child-2/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/contributors-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/contributors-inheritance/pom.xml
index 1f65eb5..1114836 100644
--- a/maven-core/src/test/resources-project-builder/contributors-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/contributors-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/dependency-inheritance/maven-parent.xml b/maven-core/src/test/resources-project-builder/dependency-inheritance/maven-parent.xml
index 0d93ad2..ee7092d 100644
--- a/maven-core/src/test/resources-project-builder/dependency-inheritance/maven-parent.xml
+++ b/maven-core/src/test/resources-project-builder/dependency-inheritance/maven-parent.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/dependency-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/dependency-inheritance/pom.xml
index 736b793..7f9e4ff 100644
--- a/maven-core/src/test/resources-project-builder/dependency-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/dependency-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/dependency-inheritance/sub/pom.xml b/maven-core/src/test/resources-project-builder/dependency-inheritance/sub/pom.xml
index aaf8e8e..d5d80d8 100644
--- a/maven-core/src/test/resources-project-builder/dependency-inheritance/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/dependency-inheritance/sub/pom.xml
@@ -4,7 +4,7 @@
     Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
     file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
     to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
-    the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+    the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by
     applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
     governing permissions and limitations under the License.
diff --git a/maven-core/src/test/resources-project-builder/dependency-order/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/dependency-order/w-plugin-mgmt/pom.xml
index 23dfede..8406dde 100644
--- a/maven-core/src/test/resources-project-builder/dependency-order/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/dependency-order/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/dependency-order/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/dependency-order/wo-plugin-mgmt/pom.xml
index c853873..d1b6cba 100644
--- a/maven-core/src/test/resources-project-builder/dependency-order/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/dependency-order/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/developers-inheritance/child-2/pom.xml b/maven-core/src/test/resources-project-builder/developers-inheritance/child-2/pom.xml
index dad2375..64f5338 100644
--- a/maven-core/src/test/resources-project-builder/developers-inheritance/child-2/pom.xml
+++ b/maven-core/src/test/resources-project-builder/developers-inheritance/child-2/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/developers-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/developers-inheritance/pom.xml
index 6e7c44d..e4d8c5e 100644
--- a/maven-core/src/test/resources-project-builder/developers-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/developers-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/distribution-management/pom.xml b/maven-core/src/test/resources-project-builder/distribution-management/pom.xml
index 1a0acb0..4ecd67e 100644
--- a/maven-core/src/test/resources-project-builder/distribution-management/pom.xml
+++ b/maven-core/src/test/resources-project-builder/distribution-management/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/empty-scm/pom.xml b/maven-core/src/test/resources-project-builder/empty-scm/pom.xml
index a0462dd..fb6b594 100644
--- a/maven-core/src/test/resources-project-builder/empty-scm/pom.xml
+++ b/maven-core/src/test/resources-project-builder/empty-scm/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/equal-plugin-deps/pom.xml b/maven-core/src/test/resources-project-builder/equal-plugin-deps/pom.xml
index bfc1c80..acd86b9 100644
--- a/maven-core/src/test/resources-project-builder/equal-plugin-deps/pom.xml
+++ b/maven-core/src/test/resources-project-builder/equal-plugin-deps/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/equal-plugin-exec-ids/pom.xml b/maven-core/src/test/resources-project-builder/equal-plugin-exec-ids/pom.xml
index a05d45d..7fa5dd0 100644
--- a/maven-core/src/test/resources-project-builder/equal-plugin-exec-ids/pom.xml
+++ b/maven-core/src/test/resources-project-builder/equal-plugin-exec-ids/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/full-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/full-interpolation/pom.xml
index 503dadb..2fe7ea3 100644
--- a/maven-core/src/test/resources-project-builder/full-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/full-interpolation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml b/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml
index 4db43cd..8464f9c 100644
--- a/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml
+++ b/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -40,7 +40,7 @@ under the License.
   <repositories>
     <repository>
       <id>equal-repo-id</id>
-      <url>http://maven.apache.org/null</url>
+      <url>https://maven.apache.org/null</url>
       <snapshots>
         <enabled>false</enabled>
       </snapshots>
diff --git a/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml b/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml
index e65d26c..277207e 100644
--- a/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml b/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml
index 640cf28..a77b7c4 100644
--- a/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml b/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml
index 2aa40de..0056606 100644
--- a/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/pom.xml b/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/pom.xml
index 3e11a6d..dc00b1c 100644
--- a/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/sub/pom.xml b/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/sub/pom.xml
index 49c8fd2..887161c 100644
--- a/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/interpolation-cli-wins/pom.xml b/maven-core/src/test/resources-project-builder/interpolation-cli-wins/pom.xml
index 39d8d9f..bbd4086 100644
--- a/maven-core/src/test/resources-project-builder/interpolation-cli-wins/pom.xml
+++ b/maven-core/src/test/resources-project-builder/interpolation-cli-wins/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/jdk-activation/pom.xml b/maven-core/src/test/resources-project-builder/jdk-activation/pom.xml
index c0431f5..45fce9b 100644
--- a/maven-core/src/test/resources-project-builder/jdk-activation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/jdk-activation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/join-different-containers-same-id/pom.xml b/maven-core/src/test/resources-project-builder/join-different-containers-same-id/pom.xml
index b3f48ca..8b30e60 100644
--- a/maven-core/src/test/resources-project-builder/join-different-containers-same-id/pom.xml
+++ b/maven-core/src/test/resources-project-builder/join-different-containers-same-id/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/licenses-inheritance/child-2/pom.xml b/maven-core/src/test/resources-project-builder/licenses-inheritance/child-2/pom.xml
index 9fd30bf..3d5ad18 100644
--- a/maven-core/src/test/resources-project-builder/licenses-inheritance/child-2/pom.xml
+++ b/maven-core/src/test/resources-project-builder/licenses-inheritance/child-2/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -40,7 +40,7 @@ under the License.
   <licenses>
     <license>
       <name>child-license</name>
-      <url>http://child.url/license</url>
+      <url>https://child.url/license</url>
       <distribution>repo</distribution>
     </license>
   </licenses>
diff --git a/maven-core/src/test/resources-project-builder/licenses-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/licenses-inheritance/pom.xml
index 641bb37..90d1022 100644
--- a/maven-core/src/test/resources-project-builder/licenses-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/licenses-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -30,7 +30,7 @@ under the License.
   <licenses>
     <license>
       <name>parent-license</name>
-      <url>http://parent.url/license</url>
+      <url>https://parent.url/license</url>
       <distribution>repo</distribution>
     </license>
   </licenses>
diff --git a/maven-core/src/test/resources-project-builder/limited-inheritance/child/pom.xml b/maven-core/src/test/resources-project-builder/limited-inheritance/child/pom.xml
index 8e9e623..3b760df 100644
--- a/maven-core/src/test/resources-project-builder/limited-inheritance/child/pom.xml
+++ b/maven-core/src/test/resources-project-builder/limited-inheritance/child/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -38,11 +38,11 @@ under the License.
     <developerConnection>https://child.url/scm</developerConnection>
   </scm>
   <issueManagement>
-    <url>http://child.url/issues</url>
+    <url>https://child.url/issues</url>
   </issueManagement>
   <ciManagement>
     <system>child-ci</system>
-    <url>http://child.url/ci</url>
+    <url>https://child.url/ci</url>
   </ciManagement>
   <distributionManagement>
     <repository>
diff --git a/maven-core/src/test/resources-project-builder/limited-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/limited-inheritance/pom.xml
index 8bbe6ea..2774294 100644
--- a/maven-core/src/test/resources-project-builder/limited-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/limited-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -34,22 +34,22 @@ under the License.
 
   <organization>
     <name>parent-org</name>
-    <url>http://parent.url/org</url>
+    <url>https://parent.url/org</url>
   </organization>
 
   <scm>
-    <url>http://parent.url/viewvc</url>
+    <url>https://parent.url/viewvc</url>
     <connection>http://parent.url/scm</connection>
     <developerConnection>https://parent.url/scm</developerConnection>
     <tag>parent-tag</tag>
   </scm>
   <issueManagement>
     <system>parent-issues</system>
-    <url>http://parent.url/issues</url>
+    <url>https://parent.url/issues</url>
   </issueManagement>
   <ciManagement>
     <system>parent-ci</system>
-    <url>http://parent.url/ci</url>
+    <url>https://parent.url/ci</url>
     <notifiers>
       <notifier>
         <type>irc</type>
diff --git a/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/child-2/pom.xml b/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/child-2/pom.xml
index 95ce7fe..8623224 100644
--- a/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/child-2/pom.xml
+++ b/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/child-2/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/pom.xml
index c9b05df..86c6132 100644
--- a/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/managed-profile-dependency/pom.xml b/maven-core/src/test/resources-project-builder/managed-profile-dependency/pom.xml
index 88c9813..4ccda8f 100644
--- a/maven-core/src/test/resources-project-builder/managed-profile-dependency/pom.xml
+++ b/maven-core/src/test/resources-project-builder/managed-profile-dependency/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/managed-profile-dependency/sub/pom.xml b/maven-core/src/test/resources-project-builder/managed-profile-dependency/sub/pom.xml
index 88204fc..c9e875a 100644
--- a/maven-core/src/test/resources-project-builder/managed-profile-dependency/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/managed-profile-dependency/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-filter-order/pom.xml b/maven-core/src/test/resources-project-builder/merged-filter-order/pom.xml
index 32ac97e..fd3e6bb 100644
--- a/maven-core/src/test/resources-project-builder/merged-filter-order/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-filter-order/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0
+    https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-filter-order/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-filter-order/sub/pom.xml
index 340b3fc..bd68952 100644
--- a/maven-core/src/test/resources-project-builder/merged-filter-order/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-filter-order/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0
+    https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mgmt/pom.xml
index aba6bdf..edeffd7 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mgmt/sub/pom.xml
index 1877ea5..639cda9 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mgmt/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mgmt/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mgmt/pom.xml
index 10226cf..9a02a26 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mgmt/sub/pom.xml
index 1877ea5..639cda9 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mgmt/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mgmt/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mgmt/pom.xml
index fc09dba..eb58d36 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mgmt/sub/pom.xml
index 2148aa9..8179e68 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mgmt/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mgmt/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mgmt/pom.xml
index b9c3f18..e46e3fb 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mgmt/sub/pom.xml
index fab233b..bd031df 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mgmt/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mgmt/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mgmt/pom.xml
index ee4dedc..b392341 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mgmt/sub/pom.xml
index bf777db..3fd4e68 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mgmt/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mgmt/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/pom.xml
index a816975..84bad98 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/sub/pom.xml
index bf777db..3fd4e68 100644
--- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/micromailer/pom.xml b/maven-core/src/test/resources-project-builder/micromailer/pom.xml
index 44f1cd9..de01fd0 100644
--- a/maven-core/src/test/resources-project-builder/micromailer/pom.xml
+++ b/maven-core/src/test/resources-project-builder/micromailer/pom.xml
@@ -17,7 +17,7 @@
 	<!-- SCM -->
 	<scm>
 		<connection>scm:svn:http://svn.sonatype.org/spice/trunk/micromailer</connection>
-		<url>http://svn.sonatype.org/spice/trunk/micromailer</url>
+		<url>https://svn.sonatype.org/spice/trunk/micromailer</url>
 		<developerConnection>scm:svn:https://svn.sonatype.org/spice/trunk/micromailer</developerConnection>
 	</scm>
 
diff --git a/maven-core/src/test/resources-project-builder/micromailer/spice-parent-9.pom b/maven-core/src/test/resources-project-builder/micromailer/spice-parent-9.pom
index 8a81b7f..751ebaa 100644
--- a/maven-core/src/test/resources-project-builder/micromailer/spice-parent-9.pom
+++ b/maven-core/src/test/resources-project-builder/micromailer/spice-parent-9.pom
@@ -8,7 +8,7 @@
 
 	<scm>
 		<connection>scm:svn:http://svn.sonatype.org/spice/trunk/spice-parent</connection>
-		<url>http://svn.sonatype.org/spice/trunk/spice-parent</url>
+		<url>https://svn.sonatype.org/spice/trunk/spice-parent</url>
 		<developerConnection>scm:svn:https://svn.sonatype.org/spice/trunk/spice-parent</developerConnection>
 	</scm>
 
diff --git a/maven-core/src/test/resources-project-builder/multiple-repos/pom.xml b/maven-core/src/test/resources-project-builder/multiple-repos/pom.xml
index e59cd0c..d47d049 100644
--- a/maven-core/src/test/resources-project-builder/multiple-repos/pom.xml
+++ b/maven-core/src/test/resources-project-builder/multiple-repos/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -33,7 +33,7 @@ under the License.
        <id>central-parent</id>
        <name>Maven Repository Switchboard</name>
        <layout>default</layout>
-       <url>http://repo1.maven.org/maven2</url>
+       <url>https://repo1.maven.org/maven2</url>
        <snapshots>
          <enabled>false</enabled>
        </snapshots>
diff --git a/maven-core/src/test/resources-project-builder/multiple-repos/sub/pom.xml b/maven-core/src/test/resources-project-builder/multiple-repos/sub/pom.xml
index d7b2102..bf292d7 100644
--- a/maven-core/src/test/resources-project-builder/multiple-repos/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/multiple-repos/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -36,7 +36,7 @@ under the License.
       <id>central-child</id>
       <name>Maven Repository Switchboard</name>
       <layout>default</layout>
-      <url>http://repo1.maven.org/maven2</url>
+      <url>https://repo1.maven.org/maven2</url>
       <snapshots>
         <enabled>false</enabled>
       </snapshots>
diff --git a/maven-core/src/test/resources-project-builder/nested-build-dir-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/nested-build-dir-interpolation/pom.xml
index 5632fad..07a3264 100644
--- a/maven-core/src/test/resources-project-builder/nested-build-dir-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/nested-build-dir-interpolation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/parent-pom-packaging/pom.xml b/maven-core/src/test/resources-project-builder/parent-pom-packaging/pom.xml
index 1695245..eecf696 100644
--- a/maven-core/src/test/resources-project-builder/parent-pom-packaging/pom.xml
+++ b/maven-core/src/test/resources-project-builder/parent-pom-packaging/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/parent-pom-packaging/sub/pom.xml b/maven-core/src/test/resources-project-builder/parent-pom-packaging/sub/pom.xml
index eca47eb..c07814e 100644
--- a/maven-core/src/test/resources-project-builder/parent-pom-packaging/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/parent-pom-packaging/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/platform-file-separator/pom.xml b/maven-core/src/test/resources-project-builder/platform-file-separator/pom.xml
index 41f35c1..0654b1d 100644
--- a/maven-core/src/test/resources-project-builder/platform-file-separator/pom.xml
+++ b/maven-core/src/test/resources-project-builder/platform-file-separator/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0
+    https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/pom.xml
index 60180d5..1230c63 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/subproject/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/subproject/pom.xml
index cef53d3..81d1bbb 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/subproject/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/subproject/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/pom.xml
index 72ab3f4..f69bf19 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/subproject/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/subproject/pom.xml
index 7023503..67f76aa 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/subproject/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/subproject/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mgmt/pom.xml
index 2f35071..a5df9fb 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-profile/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-profile/pom.xml
index f2d8c6c..f1eb80f 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-attributes/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-attributes/wo-plugin-mgmt/pom.xml
index c844b44..f108ef6 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-attributes/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-attributes/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-merging/child/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-merging/child/pom.xml
index f817244..ec93a22 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-merging/child/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-merging/child/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-merging/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-merging/pom.xml
index 12f2c2d..3900b0f 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-merging/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-merging/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-order/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-order/w-plugin-mgmt/pom.xml
index 7d7dfd8..7ff6e99 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-order/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-order/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-config-order/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-order/wo-plugin-mgmt/pom.xml
index e300fe1..d1c7080 100644
--- a/maven-core/src/test/resources-project-builder/plugin-config-order/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-config-order/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mgmt/pom.xml
index 9f66b49..f9ac01e 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mgmt/pom.xml
index 4e1eafe..e06f53b 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/w-plugin-mgmt/pom.xml
index d4ac3b0..23033d2 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/wo-plugin-mgmt/pom.xml
index 438d9d1..83f2d6d 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/pom.xml
index 2b534d7..cbed746 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/w-merge/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/w-merge/pom.xml
index f60cfd5..9049c4e 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/w-merge/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/w-merge/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/wo-merge/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/wo-merge/pom.xml
index 23cfc0c..a792631 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/wo-merge/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/wo-merge/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/pom.xml
index b64af3a..93ab9e1 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/sub/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/sub/pom.xml
index f96116a..4c891c2 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/pom.xml
index 127fa25..0d60319 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/sub/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/sub/pom.xml
index 61841ae..5b21d66 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mgmt/pom.xml
index 6bcfee5..2989be8 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mgmt/sub/pom.xml
index 3129ad0..47228a5 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mgmt/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mgmt/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mgmt/pom.xml
index 63db85f..7fb4470 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mgmt/sub/pom.xml
index 3129ad0..47228a5 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mgmt/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mgmt/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-order-and-default-exec/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-order-and-default-exec/pom.xml
index 864fedb..37c7994 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-order-and-default-exec/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-order-and-default-exec/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-order-with-lifecycle/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-order-with-lifecycle/pom.xml
index 6035e81..4f26b8e 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-order-with-lifecycle/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-order-with-lifecycle/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-order/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-order/w-plugin-mgmt/pom.xml
index 2c552d4..e391b22 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-order/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-order/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-order/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-order/wo-plugin-mgmt/pom.xml
index c4ceaae..f00187a 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-order/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-order/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/w-plugin-mgmt/pom.xml
index fbae181..87f32cc 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/w-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/w-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/wo-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/wo-plugin-mgmt/pom.xml
index 7910084..26d157e 100644
--- a/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/wo-plugin-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/wo-plugin-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/pom.xml b/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/pom.xml
index e42b030..8fd7d8e 100644
--- a/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/sub/pom.xml b/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/sub/pom.xml
index 8d44b8c..85bc7be 100644
--- a/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-inheritance-order/child/pom.xml b/maven-core/src/test/resources-project-builder/plugin-inheritance-order/child/pom.xml
index 5350fa8..b6b16c4 100644
--- a/maven-core/src/test/resources-project-builder/plugin-inheritance-order/child/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-inheritance-order/child/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-inheritance-order/pom.xml b/maven-core/src/test/resources-project-builder/plugin-inheritance-order/pom.xml
index 477a759..99a321a 100644
--- a/maven-core/src/test/resources-project-builder/plugin-inheritance-order/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-inheritance-order/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-injection-merge-order/pom.xml b/maven-core/src/test/resources-project-builder/plugin-injection-merge-order/pom.xml
index 76459e2..efe3acd 100644
--- a/maven-core/src/test/resources-project-builder/plugin-injection-merge-order/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-injection-merge-order/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-management-duplicate/pom.xml b/maven-core/src/test/resources-project-builder/plugin-management-duplicate/pom.xml
index 37e7278..80f1013 100644
--- a/maven-core/src/test/resources-project-builder/plugin-management-duplicate/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-management-duplicate/pom.xml
@@ -8,7 +8,7 @@
 		2.0 (the "License"); you may not use this file except in compliance
 		with the License. You may obtain a copy of the License at
 
-		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		https://www.apache.org/licenses/LICENSE-2.0 Unless required by
 		applicable law or agreed to in writing, software distributed under the
 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 		CONDITIONS OF ANY KIND, either express or implied. See the License for
diff --git a/maven-core/src/test/resources-project-builder/plugin-management-duplicate/sub/pom.xml b/maven-core/src/test/resources-project-builder/plugin-management-duplicate/sub/pom.xml
index 5e844b7..a3af616 100644
--- a/maven-core/src/test/resources-project-builder/plugin-management-duplicate/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-management-duplicate/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/child/pom.xml b/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/child/pom.xml
index fce3588..e6b034d 100644
--- a/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/child/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/child/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/pom.xml b/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/pom.xml
index d941276..ecd5b29 100644
--- a/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/plugin-management-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/plugin-management-inheritance/pom.xml
index 85b7bd9..fb68de2 100644
--- a/maven-core/src/test/resources-project-builder/plugin-management-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/plugin-management-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/pom-encoding/latin-1/pom.xml b/maven-core/src/test/resources-project-builder/pom-encoding/latin-1/pom.xml
index b338399..80902fa 100644
--- a/maven-core/src/test/resources-project-builder/pom-encoding/latin-1/pom.xml
+++ b/maven-core/src/test/resources-project-builder/pom-encoding/latin-1/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/pom-encoding/utf-8/pom.xml b/maven-core/src/test/resources-project-builder/pom-encoding/utf-8/pom.xml
index 4400aa7..c563fa9 100644
--- a/maven-core/src/test/resources-project-builder/pom-encoding/utf-8/pom.xml
+++ b/maven-core/src/test/resources-project-builder/pom-encoding/utf-8/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/pom-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/pom-inheritance/pom.xml
index f96a940..70161be 100644
--- a/maven-core/src/test/resources-project-builder/pom-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/pom-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -33,16 +33,16 @@ under the License.
 
   <name>parent-name</name>
   <description>parent-description</description>
-  <url>http://parent.url/</url>
+  <url>https://parent.url/</url>
   <inceptionYear>2008</inceptionYear>
   <organization>
     <name>parent-org</name>
-    <url>http://parent-org.url/</url>
+    <url>https://parent-org.url/</url>
   </organization>
   <licenses>
     <license>
       <name>parent-license</name>
-      <url>http://parent.url/license</url>
+      <url>https://parent.url/license</url>
       <distribution>repo</distribution>
     </license>
   </licenses>
@@ -74,27 +74,27 @@ under the License.
   </modules>
 
   <scm>
-    <url>http://parent.url/trunk</url>
+    <url>https://parent.url/trunk</url>
     <connection>http://parent.url/scm</connection>
     <developerConnection>https://parent.url/scm</developerConnection>
   </scm>
   <issueManagement>
-    <url>http://parent.url/issues</url>
+    <url>https://parent.url/issues</url>
   </issueManagement>
   <ciManagement>
-    <url>http://parent.url/ci</url>
+    <url>https://parent.url/ci</url>
   </ciManagement>
   <distributionManagement>
     <repository>
-      <url>http://parent.url/dist</url>
+      <url>https://parent.url/dist</url>
       <id>parent.distros</id>
     </repository>
     <snapshotRepository>
-      <url>http://parent.url/snaps</url>
+      <url>https://parent.url/snaps</url>
       <id>parent.snaps</id>
     </snapshotRepository>
     <site>
-      <url>http://parent.url/site</url>
+      <url>https://parent.url/site</url>
       <id>parent.site</id>
     </site>
     <downloadUrl>http://parent.url/download</downloadUrl>
@@ -130,7 +130,7 @@ under the License.
   <repositories>
     <repository>
       <id>parent-remote-repo</id>
-      <url>http://parent.url/remote</url>
+      <url>https://parent.url/remote</url>
     </repository>
   </repositories>
 
diff --git a/maven-core/src/test/resources-project-builder/pom-inheritance/sub/pom.xml b/maven-core/src/test/resources-project-builder/pom-inheritance/sub/pom.xml
index 2dbddd6..724d697 100644
--- a/maven-core/src/test/resources-project-builder/pom-inheritance/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/pom-inheritance/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/prerequisites-inheritance/child/pom.xml b/maven-core/src/test/resources-project-builder/prerequisites-inheritance/child/pom.xml
index 910018a..3a5c5a3 100644
--- a/maven-core/src/test/resources-project-builder/prerequisites-inheritance/child/pom.xml
+++ b/maven-core/src/test/resources-project-builder/prerequisites-inheritance/child/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/prerequisites-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/prerequisites-inheritance/pom.xml
index 3e4d8a4..cf737c6 100644
--- a/maven-core/src/test/resources-project-builder/prerequisites-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/prerequisites-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/profile-dependencies-multiple-profiles/pom.xml b/maven-core/src/test/resources-project-builder/profile-dependencies-multiple-profiles/pom.xml
index d7af4e2..23fb2df 100644
--- a/maven-core/src/test/resources-project-builder/profile-dependencies-multiple-profiles/pom.xml
+++ b/maven-core/src/test/resources-project-builder/profile-dependencies-multiple-profiles/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/profile-injected-dependencies/pom.xml b/maven-core/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
index 3fe02fb..1d2e8d8 100644
--- a/maven-core/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
+++ b/maven-core/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/profile-injection-order/pom.xml b/maven-core/src/test/resources-project-builder/profile-injection-order/pom.xml
index daf4607..7467fbf 100644
--- a/maven-core/src/test/resources-project-builder/profile-injection-order/pom.xml
+++ b/maven-core/src/test/resources-project-builder/profile-injection-order/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/pom.xml b/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/pom.xml
index e283bb0..2f64c4f 100644
--- a/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/pom.xml
+++ b/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/sub/pom.xml b/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/sub/pom.xml
index 3614e30..ab49adf 100644
--- a/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/profile-plugins/pom.xml b/maven-core/src/test/resources-project-builder/profile-plugins/pom.xml
index f25e295..912fdf3 100644
--- a/maven-core/src/test/resources-project-builder/profile-plugins/pom.xml
+++ b/maven-core/src/test/resources-project-builder/profile-plugins/pom.xml
@@ -7,7 +7,7 @@
     The ASF licenses this file to you under the Apache License, Version
     2.0 (the "License"); you may not use this file except in compliance
     with the License. You may obtain a copy of the License at
-    http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+    https://www.apache.org/licenses/LICENSE-2.0 Unless required by
     applicable law or agreed to in writing, software distributed under
     the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
     OR CONDITIONS OF ANY KIND, either express or implied. See the
diff --git a/maven-core/src/test/resources-project-builder/profile-properties-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/profile-properties-interpolation/pom.xml
index a95e253..348dc21 100644
--- a/maven-core/src/test/resources-project-builder/profile-properties-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/profile-properties-interpolation/pom.xml
@@ -8,7 +8,7 @@
 		2.0 (the "License"); you may not use this file except in compliance
 		with the License. You may obtain a copy of the License at
 
-		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		https://www.apache.org/licenses/LICENSE-2.0 Unless required by
 		applicable law or agreed to in writing, software distributed under the
 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 		CONDITIONS OF ANY KIND, either express or implied. See the License for
@@ -34,7 +34,7 @@
 		These are some POM elements we would like to interpolate with
 		properties from the profile.
 	-->
-	<url>http://maven.apache.org/${test}
+	<url>https://maven.apache.org/${test}
 	</url>
 	<properties>
 		<test>FAILED</test>
diff --git a/maven-core/src/test/resources-project-builder/properties-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/properties-inheritance/pom.xml
index 6d17dd3..4a4c0a0 100644
--- a/maven-core/src/test/resources-project-builder/properties-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/properties-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/properties-inheritance/sub/pom.xml b/maven-core/src/test/resources-project-builder/properties-inheritance/sub/pom.xml
index c5394df..9c42a92 100644
--- a/maven-core/src/test/resources-project-builder/properties-inheritance/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/properties-inheritance/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/repo-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/repo-inheritance/pom.xml
index 5905657..b029822 100644
--- a/maven-core/src/test/resources-project-builder/repo-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/repo-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/reporting-plugin-config/pom.xml b/maven-core/src/test/resources-project-builder/reporting-plugin-config/pom.xml
index bb98c07..4a50638 100644
--- a/maven-core/src/test/resources-project-builder/reporting-plugin-config/pom.xml
+++ b/maven-core/src/test/resources-project-builder/reporting-plugin-config/pom.xml
@@ -8,7 +8,7 @@
     2.0 (the "License"); you may not use this file except in compliance
     with the License. You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+    https://www.apache.org/licenses/LICENSE-2.0 Unless required by
     applicable law or agreed to in writing, software distributed under
     the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
     OR CONDITIONS OF ANY KIND, either express or implied. See the
diff --git a/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml b/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml
index cdc8fb1..33cb0fd 100644
--- a/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml
@@ -8,7 +8,7 @@
     2.0 (the "License"); you may not use this file except in compliance
     with the License. You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+    https://www.apache.org/licenses/LICENSE-2.0 Unless required by
     applicable law or agreed to in writing, software distributed under
     the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
     OR CONDITIONS OF ANY KIND, either express or implied. See the
diff --git a/maven-core/src/test/resources-project-builder/system-property-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/system-property-interpolation/pom.xml
index 7d48d90..0edd200 100644
--- a/maven-core/src/test/resources-project-builder/system-property-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/system-property-interpolation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/unc-path/pom.xml b/maven-core/src/test/resources-project-builder/unc-path/pom.xml
index b2b9775..c1e63ba 100644
--- a/maven-core/src/test/resources-project-builder/unc-path/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unc-path/pom.xml
@@ -8,7 +8,7 @@
     2.0 (the "License"); you may not use this file except in compliance
     with the License. You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+    https://www.apache.org/licenses/LICENSE-2.0 Unless required by
     applicable law or agreed to in writing, software distributed under
     the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
     OR CONDITIONS OF ANY KIND, either express or implied. See the
diff --git a/maven-core/src/test/resources-project-builder/unc-path/sub/pom.xml b/maven-core/src/test/resources-project-builder/unc-path/sub/pom.xml
index 5bb4bbb..62c93bf 100644
--- a/maven-core/src/test/resources-project-builder/unc-path/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unc-path/sub/pom.xml
@@ -8,7 +8,7 @@
     2.0 (the "License"); you may not use this file except in compliance
     with the License. You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+    https://www.apache.org/licenses/LICENSE-2.0 Unless required by
     applicable law or agreed to in writing, software distributed under
     the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
     OR CONDITIONS OF ANY KIND, either express or implied. See the
diff --git a/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mgmt-in-profile/pom.xml b/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mgmt-in-profile/pom.xml
index 38ad7f7..004dc49 100644
--- a/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mgmt-in-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mgmt-in-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mgmt/pom.xml
index de69bb4..f4dc7c8 100644
--- a/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mgmt/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mgmt/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/unique-dependency-key/deps-in-profile/pom.xml b/maven-core/src/test/resources-project-builder/unique-dependency-key/deps-in-profile/pom.xml
index 8d4ae56..520023e 100644
--- a/maven-core/src/test/resources-project-builder/unique-dependency-key/deps-in-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unique-dependency-key/deps-in-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/unique-dependency-key/deps/pom.xml b/maven-core/src/test/resources-project-builder/unique-dependency-key/deps/pom.xml
index a629c9f..1efb068 100644
--- a/maven-core/src/test/resources-project-builder/unique-dependency-key/deps/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unique-dependency-key/deps/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo-in-profile/pom.xml b/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo-in-profile/pom.xml
index eb73c4e..78b9f8b 100644
--- a/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo-in-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo-in-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -39,11 +39,11 @@ under the License.
       <repositories>
         <repository>
           <id>one</id>
-          <url>http://repo1.maven.org/maven2</url>
+          <url>https://repo1.maven.org/maven2</url>
         </repository>
         <repository>
           <id>one</id>
-          <url>http://repository.codehaus.org/</url>
+          <url>https://repository.codehaus.org/</url>
         </repository>
       </repositories>
     </profile>
diff --git a/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo/pom.xml b/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo/pom.xml
index 76d4f74..c4a9eaa 100644
--- a/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -35,11 +35,11 @@ under the License.
   <repositories>
     <repository>
       <id>one</id>
-      <url>http://repo1.maven.org/maven2</url>
+      <url>https://repo1.maven.org/maven2</url>
     </repository>
     <repository>
       <id>one</id>
-      <url>http://repository.codehaus.org/</url>
+      <url>https://repository.codehaus.org/</url>
     </repository>
   </repositories>
 </project>
diff --git a/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo-in-profile/pom.xml b/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo-in-profile/pom.xml
index ac1fada..2d83c0f 100644
--- a/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo-in-profile/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo-in-profile/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -39,11 +39,11 @@ under the License.
       <pluginRepositories>
         <pluginRepository>
           <id>one</id>
-          <url>http://repo1.maven.org/maven2</url>
+          <url>https://repo1.maven.org/maven2</url>
         </pluginRepository>
         <pluginRepository>
           <id>one</id>
-          <url>http://repository.codehaus.org/</url>
+          <url>https://repository.codehaus.org/</url>
         </pluginRepository>
       </pluginRepositories>
     </profile>
diff --git a/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo/pom.xml b/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo/pom.xml
index 92fd126..5d87815 100644
--- a/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -35,11 +35,11 @@ under the License.
   <pluginRepositories>
     <pluginRepository>
       <id>one</id>
-      <url>http://repo1.maven.org/maven2</url>
+      <url>https://repo1.maven.org/maven2</url>
     </pluginRepository>
     <pluginRepository>
       <id>one</id>
-      <url>http://repository.codehaus.org/</url>
+      <url>https://repository.codehaus.org/</url>
     </pluginRepository>
   </pluginRepositories>
 </project>
diff --git a/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/child/pom.xml b/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/child/pom.xml
index cdc7b75..f647028 100644
--- a/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/child/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/child/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -35,7 +35,7 @@ under the License.
 
   <name>child-name</name>
   <description>child-desc</description>
-  <url>http://child.org/</url>
+  <url>https://child.org/</url>
   <inceptionYear>2008</inceptionYear>
   <organization>
     <name>child-org-name</name>
@@ -46,24 +46,24 @@ under the License.
   </prerequisites>
 
   <scm>
-    <url>http://scm.org/</url>
+    <url>https://scm.org/</url>
   </scm>
   <issueManagement>
-    <url>http://issue.org/</url>
+    <url>https://issue.org/</url>
   </issueManagement>
   <ciManagement>
-    <url>http://ci.org/</url>
+    <url>https://ci.org/</url>
   </ciManagement>
   <distributionManagement>
     <repository>
       <id>maven-core-it</id>
       <name>child-dist-repo</name>
-      <url>http://dist.org/</url>
+      <url>https://dist.org/</url>
     </repository>
     <site>
       <id>maven-core-it</id>
       <name>child-site</name>
-      <url>http://site.org/</url>
+      <url>https://site.org/</url>
     </site>
   </distributionManagement>
 
diff --git a/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/pom.xml
index 88d372c..28e0458 100644
--- a/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/url-append/child/pom.xml b/maven-core/src/test/resources-project-builder/url-append/child/pom.xml
index 1f377df..000689f 100644
--- a/maven-core/src/test/resources-project-builder/url-append/child/pom.xml
+++ b/maven-core/src/test/resources-project-builder/url-append/child/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/url-append/parent/pom.xml b/maven-core/src/test/resources-project-builder/url-append/parent/pom.xml
index f8b069f..a2ce15d 100644
--- a/maven-core/src/test/resources-project-builder/url-append/parent/pom.xml
+++ b/maven-core/src/test/resources-project-builder/url-append/parent/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -37,16 +37,16 @@ under the License.
     <module>../child</module>
   </modules>
 
-  <url>http://project.url/parent</url>
+  <url>https://project.url/parent</url>
 
   <scm>
-    <url>http://viewvc.project.url/parent</url>
-    <connection>http://scm.project.url/parent</connection>
+    <url>https://viewvc.project.url/parent</url>
+    <connection>https://scm.project.url/parent</connection>
     <developerConnection>https://scm.project.url/parent</developerConnection>
   </scm>
   <distributionManagement>
     <site>
-      <url>http://site.project.url/parent</url>
+      <url>https://site.project.url/parent</url>
       <id>parent.site</id>
     </site>
   </distributionManagement>
diff --git a/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/pom.xml b/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/pom.xml
index 463772f..602322d 100644
--- a/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/pom.xml
+++ b/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/sub/pom.xml b/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/sub/pom.xml
index 128e63d..8a892a1 100644
--- a/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/url-inheritance/pom.xml b/maven-core/src/test/resources-project-builder/url-inheritance/pom.xml
index ed4cdf0..ee7881f 100644
--- a/maven-core/src/test/resources-project-builder/url-inheritance/pom.xml
+++ b/maven-core/src/test/resources-project-builder/url-inheritance/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -32,43 +32,43 @@ under the License.
     Test that inheritance of certain URLs automatically appends the child's artifact id.
   </description>
 
-  <url>http://parent.url</url>
+  <url>https://parent.url</url>
   <organization>
     <name>parent-org</name>
-    <url>http://parent.url/org</url>
+    <url>https://parent.url/org</url>
   </organization>
   <licenses>
     <license>
       <name>parent-license</name>
-      <url>http://parent.url/license.txt</url>
+      <url>https://parent.url/license.txt</url>
       <distribution>repo</distribution>
     </license>
   </licenses>
 
   <scm>
-    <url>http://parent.url/viewvc</url>
-    <connection>http://parent.url/scm</connection>
+    <url>https://parent.url/viewvc</url>
+    <connection>https://parent.url/scm</connection>
     <developerConnection>https://parent.url/scm</developerConnection>
   </scm>
   <issueManagement>
-    <url>http://parent.url/issues</url>
+    <url>https://parent.url/issues</url>
   </issueManagement>
   <ciManagement>
-    <url>http://parent.url/ci</url>
+    <url>https://parent.url/ci</url>
   </ciManagement>
   <distributionManagement>
     <repository>
-      <url>http://parent.url/dist</url>
+      <url>https://parent.url/dist</url>
       <id>parent.distros</id>
     </repository>
     <snapshotRepository>
-      <url>http://parent.url/snaps</url>
+      <url>https://parent.url/snaps</url>
       <id>parent.snaps</id>
     </snapshotRepository>
     <site>
-      <url>http://parent.url/site</url>
+      <url>https://parent.url/site</url>
       <id>parent.site</id>
     </site>
-    <downloadUrl>http://parent.url/download</downloadUrl>
+    <downloadUrl>https://parent.url/download</downloadUrl>
   </distributionManagement>
 </project>
diff --git a/maven-core/src/test/resources-project-builder/url-inheritance/sub/pom.xml b/maven-core/src/test/resources-project-builder/url-inheritance/sub/pom.xml
index c8e9c10..3563128 100644
--- a/maven-core/src/test/resources-project-builder/url-inheritance/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/url-inheritance/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/url-no-decoding/pom.xml b/maven-core/src/test/resources-project-builder/url-no-decoding/pom.xml
index 2dcceb9..a75fa88 100644
--- a/maven-core/src/test/resources-project-builder/url-no-decoding/pom.xml
+++ b/maven-core/src/test/resources-project-builder/url-no-decoding/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
@@ -33,19 +33,19 @@ under the License.
   </description>
 
   <!-- some URLs using percent-encoded characters -->
-  <url>http://maven.apache.org/spacy%20path</url>
+  <url>https://maven.apache.org/spacy%20path</url>
   <scm>
     <connection>scm:svn:svn+ssh://svn.apache.org/spacy%20path</connection>
     <developerConnection>scm:svn:svn+ssh://svn.apache.org/spacy%20path</developerConnection>
-    <url>http://svn.apache.org/viewvc/spacy%20path</url>
+    <url>https://svn.apache.org/viewvc/spacy%20path</url>
   </scm>
   <issueManagement>
     <system>none</system>
-    <url>http://issues.apache.org/spacy%20path</url>
+    <url>https://issues.apache.org/spacy%20path</url>
   </issueManagement>
   <ciManagement>
     <system>none</system>
-    <url>http://ci.apache.org/spacy%20path</url>
+    <url>https://ci.apache.org/spacy%20path</url>
   </ciManagement>
   <distributionManagement>
     <repository>
diff --git a/maven-core/src/test/resources-project-builder/xml-coalesce-text/pom.xml b/maven-core/src/test/resources-project-builder/xml-coalesce-text/pom.xml
index c5df7aa..bbb99ca 100644
--- a/maven-core/src/test/resources-project-builder/xml-coalesce-text/pom.xml
+++ b/maven-core/src/test/resources-project-builder/xml-coalesce-text/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/xml-markup-interpolation/pom.xml b/maven-core/src/test/resources-project-builder/xml-markup-interpolation/pom.xml
index 584712f..1da0e2f 100644
--- a/maven-core/src/test/resources-project-builder/xml-markup-interpolation/pom.xml
+++ b/maven-core/src/test/resources-project-builder/xml-markup-interpolation/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/xml-whitespace/pom.xml b/maven-core/src/test/resources-project-builder/xml-whitespace/pom.xml
index 433dd52..3d0ec6d 100644
--- a/maven-core/src/test/resources-project-builder/xml-whitespace/pom.xml
+++ b/maven-core/src/test/resources-project-builder/xml-whitespace/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
diff --git a/maven-core/src/test/resources-project-builder/xml-whitespace/sub/pom.xml b/maven-core/src/test/resources-project-builder/xml-whitespace/sub/pom.xml
index f5ea684..83894a6 100644
--- a/maven-core/src/test/resources-project-builder/xml-whitespace/sub/pom.xml
+++ b/maven-core/src/test/resources-project-builder/xml-whitespace/sub/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
-  http://www.apache.org/licenses/LICENSE-2.0
+  https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an


[maven-studies] 05/11: [MNG-5577] Convert maven-core to JSR 330

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit 9567da2bc889a94f5c3b692b4afb310ddbacd6e5
Author: Joseph Walton <jo...@kafsemo.org>
AuthorDate: Sun Jun 23 22:48:51 2019 +1000

    [MNG-5577] Convert maven-core to JSR 330
    
    Convert (almost) all Plexus components in maven-core to JSR 330 annotations
    
    Closes #332
---
 maven-core/pom.xml                                 |  4 ---
 .../main/java/org/apache/maven/DefaultMaven.java   | 28 +++++++++--------
 .../maven/DefaultProjectDependenciesResolver.java  | 13 ++++----
 .../artifact/factory/DefaultArtifactFactory.java   | 11 ++++---
 .../artifact/handler/DefaultArtifactHandler.java   |  6 ++--
 .../manager/DefaultArtifactHandlerManager.java     | 11 ++++---
 .../repository/layout/DefaultRepositoryLayout.java |  7 +++--
 .../metadata/io/DefaultMetadataReader.java         |  7 +++--
 .../resolver/DefaultResolutionErrorHandler.java    |  6 ++--
 .../apache/maven/bridge/MavenRepositorySystem.java | 23 +++++++++-----
 .../internal/DefaultBeanConfigurator.java          |  7 +++--
 .../eventspy/internal/EventSpyDispatcher.java      | 13 ++++----
 .../maven/exception/DefaultExceptionHandler.java   |  7 +++--
 .../apache/maven/graph/DefaultGraphBuilder.java    | 13 ++++----
 .../maven/lifecycle/DefaultLifecycleExecutor.java  | 33 ++++++++++----------
 .../apache/maven/lifecycle/DefaultLifecycles.java  | 13 ++++----
 .../lifecycle/internal/BuildListCalculator.java    | 15 ++++++----
 .../internal/DefaultExecutionEventCatapult.java    |  7 +++--
 .../DefaultLifecycleExecutionPlanCalculator.java   | 26 +++++++++-------
 .../internal/DefaultLifecycleMappingDelegate.java  | 18 +++++++----
 .../internal/DefaultLifecyclePluginAnalyzer.java   | 16 +++++-----
 .../DefaultLifecycleTaskSegmentCalculator.java     | 21 +++++++------
 .../internal/DefaultMojoExecutionConfigurator.java |  7 +++--
 .../lifecycle/internal/LifecycleDebugLogger.java   | 23 +++++++-------
 .../lifecycle/internal/LifecycleModuleBuilder.java | 23 +++++++-------
 .../internal/LifecyclePluginResolver.java          | 17 +++++------
 .../maven/lifecycle/internal/LifecycleStarter.java | 25 +++++++++-------
 .../lifecycle/internal/MojoDescriptorCreator.java  | 27 +++++++++--------
 .../maven/lifecycle/internal/MojoExecutor.java     | 35 ++++++++++++----------
 .../lifecycle/internal/builder/BuilderCommon.java  | 21 +++++++------
 .../multithreaded/MultiThreadedBuilder.java        | 13 ++++----
 .../singlethreaded/SingleThreadedBuilder.java      | 18 +++++++----
 .../plugin/DefaultLifecycleBindingsInjector.java   | 11 ++++---
 .../maven/plugin/DefaultBuildPluginManager.java    | 21 +++++++------
 .../maven/plugin/DefaultExtensionRealmCache.java   |  7 +++--
 .../maven/plugin/DefaultPluginArtifactsCache.java  |  7 +++--
 .../maven/plugin/DefaultPluginDescriptorCache.java |  7 +++--
 .../maven/plugin/DefaultPluginRealmCache.java      |  7 +++--
 .../plugin/internal/DefaultLegacySupport.java      |  8 +++--
 .../plugin/internal/DefaultMavenPluginManager.java | 31 ++++++++++---------
 .../DefaultPluginDependenciesResolver.java         | 13 ++++----
 .../plugin/internal/DefaultPluginManager.java      | 23 +++++++-------
 .../internal/DefaultPluginPrefixResolver.java      | 19 +++++++-----
 .../internal/DefaultPluginVersionResolver.java     | 19 +++++++-----
 .../maven/project/DefaultMavenProjectHelper.java   | 18 +++++++----
 .../maven/project/DefaultProjectBuilder.java       | 25 +++++++++-------
 .../project/DefaultProjectBuildingHelper.java      | 21 +++++++------
 .../DefaultProjectDependenciesResolver.java        | 15 ++++++----
 .../maven/project/DefaultProjectRealmCache.java    |  7 +++--
 .../artifact/DefaultMavenMetadataCache.java        |  7 +++--
 .../project/artifact/DefaultMetadataSource.java    |  7 +++--
 .../artifact/DefaultProjectArtifactsCache.java     |  7 +++--
 .../project/artifact/MavenMetadataSource.java      | 23 +++++++-------
 .../rtinfo/internal/DefaultRuntimeInformation.java | 11 ++++---
 .../settings/DefaultMavenSettingsBuilder.java      | 11 ++++---
 .../maven/toolchain/DefaultToolchainManager.java   | 13 ++++----
 .../toolchain/DefaultToolchainManagerPrivate.java  |  7 +++--
 .../maven/toolchain/DefaultToolchainsBuilder.java  | 11 ++++---
 .../maven/toolchain/java/JavaToolchainFactory.java | 11 ++++---
 59 files changed, 528 insertions(+), 353 deletions(-)

diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 7a723a2..cd363f5 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -119,10 +119,6 @@ under the License.
       <artifactId>plexus-classworlds</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-component-annotations</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
     </dependency>
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index 7f052c1..fc26290 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -31,6 +31,10 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.execution.DefaultMavenExecutionResult;
 import org.apache.maven.execution.ExecutionEvent;
@@ -51,8 +55,6 @@ import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.repository.LocalRepositoryNotAccessibleException;
 import org.apache.maven.session.scope.internal.SessionScope;
 import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.logging.Logger;
 import org.eclipse.aether.DefaultRepositorySystemSession;
@@ -63,36 +65,38 @@ import org.eclipse.aether.util.repository.ChainedWorkspaceReader;
 /**
  * @author Jason van Zyl
  */
-@Component( role = Maven.class )
+@Named
+@Singleton
 public class DefaultMaven
     implements Maven
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     protected ProjectBuilder projectBuilder;
 
-    @Requirement
+    @Inject
     private LifecycleStarter lifecycleStarter;
 
-    @Requirement
+    @Inject
     protected PlexusContainer container;
 
-    @Requirement
+    @Inject
     private ExecutionEventCatapult eventCatapult;
 
-    @Requirement
+    @Inject
     private LegacySupport legacySupport;
 
-    @Requirement
+    @Inject
     private SessionScope sessionScope;
 
-    @Requirement
+    @Inject
     private DefaultRepositorySystemSessionFactory repositorySessionFactory;
 
-    @Requirement( hint = GraphBuilder.HINT )
+    @Inject
+    @Named( GraphBuilder.HINT )
     private GraphBuilder graphBuilder;
 
     @Override
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java
index dca8014..2b7945e 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java
@@ -26,6 +26,10 @@ import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
@@ -39,8 +43,6 @@ import org.apache.maven.execution.MavenSession;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.ProjectArtifact;
 import org.apache.maven.repository.RepositorySystem;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * @deprecated As of 3.2.2, and there is no direct replacement. This is an internal class which was not marked as such,
@@ -48,15 +50,16 @@ import org.codehaus.plexus.component.annotations.Requirement;
  *
  */
 @Deprecated
-@Component( role = ProjectDependenciesResolver.class )
+@Named
+@Singleton
 public class DefaultProjectDependenciesResolver
     implements ProjectDependenciesResolver
 {
 
-    @Requirement
+    @Inject
     private RepositorySystem repositorySystem;
 
-    @Requirement
+    @Inject
     private ResolutionErrorHandler resolutionErrorHandler;
 
     public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToResolve, MavenSession session )
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java b/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java
index 3ee65de..9fc0506 100644
--- a/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java
@@ -19,24 +19,27 @@ package org.apache.maven.artifact.factory;
  * under the License.
  */
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.DefaultArtifact;
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.artifact.versioning.VersionRange;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * DefaultArtifactFactory
  *
  */
-@Component( role = ArtifactFactory.class )
+@Named
+@Singleton
 @SuppressWarnings( "checkstyle:parameternumber" )
 public class DefaultArtifactFactory
     implements ArtifactFactory
 {
-    @Requirement
+    @Inject
     private ArtifactHandlerManager artifactHandlerManager;
 
     public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
index 628f38b..e4ab338 100644
--- a/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
@@ -19,13 +19,15 @@ package org.apache.maven.artifact.handler;
  * under the License.
  */
 
-import org.codehaus.plexus.component.annotations.Component;
+import javax.inject.Named;
+import javax.inject.Singleton;
 
 /**
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @author Jason van Zyl
  */
-@Component( role = ArtifactHandler.class )
+@Named
+@Singleton
 public class DefaultArtifactHandler
     implements ArtifactHandler
 {
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java
index a4b2f44..a3013d4 100644
--- a/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java
@@ -23,20 +23,23 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.DefaultArtifactHandler;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * @author Jason van Zyl
  */
-@Component( role = ArtifactHandlerManager.class )
+@Named
+@Singleton
 public class DefaultArtifactHandlerManager
     implements ArtifactHandlerManager
 {
 
-    @Requirement( role = ArtifactHandler.class )
+    @Inject
     private Map<String, ArtifactHandler> artifactHandlers;
 
     private Map<String, ArtifactHandler> allHandlers = new ConcurrentHashMap<>();
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java b/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java
index 70c0b14..0590e53 100644
--- a/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java
+++ b/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java
@@ -19,16 +19,19 @@ package org.apache.maven.artifact.repository.layout;
  * under the License.
  */
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.codehaus.plexus.component.annotations.Component;
 
 /**
  * @author jdcasey
  */
-@Component( role = ArtifactRepositoryLayout.class, hint = "default" )
+@Named( "default" )
+@Singleton
 public class DefaultRepositoryLayout
     implements ArtifactRepositoryLayout
 {
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java b/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java
index 0139ab3..1d7241c 100644
--- a/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java
+++ b/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java
@@ -26,9 +26,11 @@ import java.io.Reader;
 import java.util.Map;
 import java.util.Objects;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.repository.metadata.Metadata;
 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
@@ -37,7 +39,8 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
  *
  * @author Benjamin Bentmann
  */
-@Component( role = MetadataReader.class )
+@Named
+@Singleton
 public class DefaultMetadataReader
     implements MetadataReader
 {
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java b/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java
index 178335a..d1603f3 100644
--- a/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java
+++ b/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java
@@ -23,12 +23,14 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.codehaus.plexus.component.annotations.Component;
+import javax.inject.Named;
+import javax.inject.Singleton;
 
 /**
  * @author Benjamin Bentmann
  */
-@Component( role = ResolutionErrorHandler.class )
+@Named
+@Singleton
 public class DefaultResolutionErrorHandler
     implements ResolutionErrorHandler
 {
diff --git a/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java b/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java
index d3cb2e4..752e659 100644
--- a/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java
+++ b/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java
@@ -31,6 +31,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.DefaultArtifact;
@@ -53,8 +57,6 @@ import org.apache.maven.model.Plugin;
 import org.apache.maven.repository.Proxy;
 import org.apache.maven.repository.RepositorySystem;
 import org.apache.maven.settings.Mirror;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.StringUtils;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.repository.AuthenticationContext;
@@ -65,14 +67,21 @@ import org.eclipse.aether.repository.RemoteRepository;
 /**
  * @author Jason van Zyl
  */
-@Component( role = MavenRepositorySystem.class, hint = "default" )
+@Named( "default" )
+@Singleton
 public class MavenRepositorySystem
 {
-    @Requirement
-    private ArtifactHandlerManager artifactHandlerManager;
+    private final ArtifactHandlerManager artifactHandlerManager;
+
+    private final Map<String, ArtifactRepositoryLayout> layouts;
 
-    @Requirement( role = ArtifactRepositoryLayout.class )
-    private Map<String, ArtifactRepositoryLayout> layouts;
+    @Inject
+    public MavenRepositorySystem( ArtifactHandlerManager artifactHandlerManager,
+            Map<String, ArtifactRepositoryLayout> layouts )
+    {
+        this.artifactHandlerManager = artifactHandlerManager;
+        this.layouts = layouts;
+    }
 
     // DefaultProjectBuilder
     public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
diff --git a/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java b/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java
index 00c79b7..ed01875 100644
--- a/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java
+++ b/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java
@@ -22,12 +22,14 @@ package org.apache.maven.configuration.internal;
 import java.io.File;
 import java.util.Objects;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.configuration.BeanConfigurationException;
 import org.apache.maven.configuration.BeanConfigurationPathTranslator;
 import org.apache.maven.configuration.BeanConfigurationRequest;
 import org.apache.maven.configuration.BeanConfigurationValuePreprocessor;
 import org.apache.maven.configuration.BeanConfigurator;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
 import org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter;
 import org.codehaus.plexus.component.configurator.converters.lookup.ConverterLookup;
@@ -44,7 +46,8 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
  *
  * @author Benjamin Bentmann
  */
-@Component( role = BeanConfigurator.class )
+@Named
+@Singleton
 public class DefaultBeanConfigurator
     implements BeanConfigurator
 {
diff --git a/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java b/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java
index e779009..980bc15 100644
--- a/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java
+++ b/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java
@@ -22,10 +22,12 @@ package org.apache.maven.eventspy.internal;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.eventspy.EventSpy;
 import org.apache.maven.execution.ExecutionListener;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.eclipse.aether.RepositoryListener;
 
@@ -33,16 +35,17 @@ import org.eclipse.aether.RepositoryListener;
  * Dispatches callbacks to all registered eventspies.
  * @since 3.0.2
  */
-@Component( role = EventSpyDispatcher.class )
+@Named
+@Singleton
 public class EventSpyDispatcher
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement( role = EventSpy.class )
     private List<EventSpy> eventSpies;
 
+    @Inject
     public void setEventSpies( List<EventSpy> eventSpies )
     {
         // make copy to get rid of needless overhead for dynamic lookups
diff --git a/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java b/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java
index 2193e61..ef3a452 100644
--- a/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java
+++ b/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java
@@ -25,6 +25,9 @@ import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.lifecycle.LifecycleExecutionException;
 import org.apache.maven.model.building.ModelProblem;
 import org.apache.maven.model.building.ModelProblemUtils;
@@ -35,7 +38,6 @@ import org.apache.maven.plugin.PluginContainerException;
 import org.apache.maven.plugin.PluginExecutionException;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.ProjectBuildingResult;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 
 /*
@@ -86,7 +88,8 @@ Plugins:
 /**
  * Transform an exception into useful end-user message.
  */
-@Component( role = ExceptionHandler.class )
+@Named
+@Singleton
 public class DefaultExceptionHandler
     implements ExceptionHandler
 {
diff --git a/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java b/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
index fb7a9f4..6d15230 100644
--- a/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
@@ -30,6 +30,10 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.DefaultMaven;
 import org.apache.maven.MavenExecutionException;
 import org.apache.maven.ProjectCycleException;
@@ -50,8 +54,6 @@ import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.project.ProjectBuildingResult;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
@@ -59,15 +61,16 @@ import org.codehaus.plexus.util.dag.CycleDetectedException;
 /**
  * Builds the {@link ProjectDependencyGraph inter-dependencies graph} between projects in the reactor.
  */
-@Component( role = GraphBuilder.class, hint = GraphBuilder.HINT )
+@Named( GraphBuilder.HINT )
+@Singleton
 public class DefaultGraphBuilder
     implements GraphBuilder
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     protected ProjectBuilder projectBuilder;
 
     @Override
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
index dae1894..63b7654 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
@@ -19,6 +19,15 @@ package org.apache.maven.lifecycle;
  * under the License.
  */
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
 import org.apache.maven.lifecycle.internal.LifecycleStarter;
@@ -39,13 +48,6 @@ import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
 import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 /**
  * A facade that provides lifecycle services to components outside maven core.
@@ -56,27 +58,28 @@ import java.util.Set;
  * @author Benjamin Bentmann
  * @author Kristian Rosenvold
  */
-@Component( role = LifecycleExecutor.class )
+@Named
+@Singleton
 public class DefaultLifecycleExecutor
     implements LifecycleExecutor
 {
 
-    @Requirement
+    @Inject
     private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer;
 
-    @Requirement
+    @Inject
     private DefaultLifecycles defaultLifeCycles;
 
-    @Requirement
+    @Inject
     private LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator;
 
-    @Requirement
+    @Inject
     private LifecycleExecutionPlanCalculator lifecycleExecutionPlanCalculator;
 
-    @Requirement
+    @Inject
     private MojoExecutor mojoExecutor;
 
-    @Requirement
+    @Inject
     private LifecycleStarter lifecycleStarter;
 
 
@@ -85,7 +88,7 @@ public class DefaultLifecycleExecutor
         lifecycleStarter.execute( session );
     }
 
-    @Requirement
+    @Inject
     private MojoDescriptorCreator mojoDescriptorCreator;
 
     // These methods deal with construction intact Plugin object that look like they come from a standard
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
index a7d9fac..601523f 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
@@ -19,8 +19,6 @@ package org.apache.maven.lifecycle;
  * under the License.
  */
 
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -33,6 +31,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * @since 3.0
  * @author Jason van Zyl
@@ -40,17 +42,18 @@ import java.util.Set;
  */
 // TODO The configuration for the lifecycle needs to be externalized so that I can use the annotations properly for the
 // wiring and reference and external source for the lifecycle configuration.
-@Component( role = DefaultLifecycles.class )
+@Named
+@Singleton
 public class DefaultLifecycles
 {
     public static final String[] STANDARD_LIFECYCLES = { "default", "clean", "site" };
 
     // @Configuration(source="org/apache/maven/lifecycle/lifecycles.xml")
 
-    @Requirement( role = Lifecycle.class )
+    @Inject
     private Map<String, Lifecycle> lifecycles;
 
-    @Requirement
+    @Inject
     private Logger logger;
 
     public DefaultLifecycles()
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java
index 76454f8..d8ad993 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java
@@ -19,22 +19,25 @@ package org.apache.maven.lifecycle.internal;
  * under the License.
  */
 
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.lifecycle.internal.builder.BuilderCommon;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.lifecycle.internal.builder.BuilderCommon;
+import org.apache.maven.project.MavenProject;
+
 /**
  * <strong>NOTE:</strong> This class is not part of any public api and can be changed or deleted without prior notice.
  * 
  * @since 3.0
  * @author Kristian Rosenvold
  */
-@Component( role = BuildListCalculator.class )
+@Named
+@Singleton
 public class BuildListCalculator
 {
     public ProjectBuildList calculateProjectBuilds( MavenSession session, List<TaskSegment> taskSegments )
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult.java
index bfb98d4..94948bc 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult.java
@@ -19,11 +19,13 @@ package org.apache.maven.lifecycle.internal;
  * under the License.
  */
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.ExecutionEvent;
 import org.apache.maven.execution.ExecutionListener;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecution;
-import org.codehaus.plexus.component.annotations.Component;
 
 /**
  * Assists in firing execution events. <strong>Warning:</strong> This is an internal utility class that is only public
@@ -32,7 +34,8 @@ import org.codehaus.plexus.component.annotations.Component;
  *
  * @author Benjamin Bentmann
  */
-@Component( role = ExecutionEventCatapult.class )
+@Named
+@Singleton
 public class DefaultExecutionEventCatapult
     implements ExecutionEventCatapult
 {
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
index 833705c..279b2af 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
@@ -28,6 +28,10 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.lifecycle.DefaultLifecycles;
 import org.apache.maven.lifecycle.Lifecycle;
@@ -53,8 +57,6 @@ import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
 import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.plugin.version.PluginVersionResolver;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -67,32 +69,34 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
  * @author Benjamin Bentmann
  * @author Kristian Rosenvold (Extract class)
  */
-@Component( role = LifecycleExecutionPlanCalculator.class )
+@Named
+@Singleton
 public class DefaultLifecycleExecutionPlanCalculator
     implements LifecycleExecutionPlanCalculator
 {
-    @Requirement
+    @Inject
     private PluginVersionResolver pluginVersionResolver;
 
-    @Requirement
+    @Inject
     private BuildPluginManager pluginManager;
 
-    @Requirement
+    @Inject
     private DefaultLifecycles defaultLifeCycles;
 
-    @Requirement
+    @Inject
     private MojoDescriptorCreator mojoDescriptorCreator;
 
-    @Requirement
+    @Inject
     private LifecyclePluginResolver lifecyclePluginResolver;
 
-    @Requirement( hint = DefaultLifecycleMappingDelegate.HINT )
+    @Inject
+    @Named( DefaultLifecycleMappingDelegate.HINT )
     private LifecycleMappingDelegate standardDelegate;
 
-    @Requirement
+    @Inject
     private Map<String, LifecycleMappingDelegate> delegates;
 
-    @Requirement
+    @Inject
     private Map<String, MojoExecutionConfigurator> mojoExecutionConfigurators;
 
     @SuppressWarnings( { "UnusedDeclaration" } )
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java
index 892e4f1..68890c2 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java
@@ -25,6 +25,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.lifecycle.Lifecycle;
 import org.apache.maven.lifecycle.LifecycleMappingDelegate;
@@ -39,22 +43,26 @@ import org.apache.maven.plugin.PluginNotFoundException;
 import org.apache.maven.plugin.PluginResolutionException;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * Lifecycle mapping delegate component interface. Calculates project build execution plan given {@link Lifecycle} and
  * lifecycle phase. Standard lifecycles use plugin execution {@code <phase>} or mojo default lifecycle phase to
  * calculate the execution plan, but custom lifecycles can use alternative mapping strategies.
  */
-@Component( role = LifecycleMappingDelegate.class, hint = DefaultLifecycleMappingDelegate.HINT )
+@Named( DefaultLifecycleMappingDelegate.HINT )
+@Singleton
 public class DefaultLifecycleMappingDelegate
     implements LifecycleMappingDelegate
 {
     public static final String HINT = "default";
 
-    @Requirement
-    private BuildPluginManager pluginManager;
+    private final BuildPluginManager pluginManager;
+
+    @Inject
+    public DefaultLifecycleMappingDelegate( BuildPluginManager pluginManager )
+    {
+        this.pluginManager = pluginManager;
+    }
 
     public Map<String, List<MojoExecution>> calculateLifecycleMappings( MavenSession session, MavenProject project,
                                                                         Lifecycle lifecycle, String lifecyclePhase )
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
index 3762363..1201742 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
@@ -19,6 +19,14 @@ package org.apache.maven.lifecycle.internal;
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.maven.lifecycle.DefaultLifecycles;
 import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer;
 import org.apache.maven.lifecycle.Lifecycle;
@@ -35,14 +43,6 @@ import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * <strong>NOTE:</strong> This class is not part of any public api and can be changed or deleted without prior notice.
  * 
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java
index cb49050..e98e0fb 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java
@@ -19,6 +19,14 @@ package org.apache.maven.lifecycle.internal;
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.lifecycle.LifecycleNotFoundException;
 import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException;
@@ -31,14 +39,8 @@ import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
 import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
 /**
  * <p>
  * Calculates the task segments in the build
@@ -51,14 +53,15 @@ import java.util.List;
  * @author jdcasey
  * @author Kristian Rosenvold (extracted class)
  */
-@Component( role = LifecycleTaskSegmentCalculator.class )
+@Named
+@Singleton
 public class DefaultLifecycleTaskSegmentCalculator
     implements LifecycleTaskSegmentCalculator
 {
-    @Requirement
+    @Inject
     private MojoDescriptorCreator mojoDescriptorCreator;
 
-    @Requirement
+    @Inject
     private LifecyclePluginResolver lifecyclePluginResolver;
 
     public DefaultLifecycleTaskSegmentCalculator()
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
index 176ba32..e650813 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
@@ -21,19 +21,22 @@ package org.apache.maven.lifecycle.internal;
 
 import java.util.Collection;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.lifecycle.MojoExecutionConfigurator;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.model.PluginExecution;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
 /**
  * @since 3.3.1, MNG-5753
  */
-@Component( role = MojoExecutionConfigurator.class )
+@Named
+@Singleton
 public class DefaultMojoExecutionConfigurator
     implements MojoExecutionConfigurator
 {
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDebugLogger.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDebugLogger.java
index 69b7c10..9ffb3d4 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDebugLogger.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDebugLogger.java
@@ -19,22 +19,24 @@ package org.apache.maven.lifecycle.internal;
  * under the License.
  */
 
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.lifecycle.MavenExecutionPlan;
 import org.apache.maven.lifecycle.internal.builder.BuilderCommon;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
 /**
  * <p>
  * Logs debug output from the various lifecycle phases.
@@ -46,10 +48,11 @@ import java.util.TreeSet;
  * @author Jason van Zyl
  * @author Kristian Rosenvold (extracted class only)
  */
-@Component( role = LifecycleDebugLogger.class )
+@Named
+@Singleton
 public class LifecycleDebugLogger
 {
-    @Requirement
+    @Inject
     private Logger logger;
 
 
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
index 3391e0c..dc7c7bd 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
@@ -22,6 +22,10 @@ package org.apache.maven.lifecycle.internal;
 import java.util.HashSet;
 import java.util.List;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.BuildSuccess;
 import org.apache.maven.execution.ExecutionEvent;
 import org.apache.maven.execution.MavenSession;
@@ -32,8 +36,6 @@ import org.apache.maven.lifecycle.internal.builder.BuilderCommon;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.session.scope.internal.SessionScope;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * <p>
@@ -46,31 +48,28 @@ import org.codehaus.plexus.component.annotations.Requirement;
  * @author Jason van Zyl
  * @author Kristian Rosenvold (extracted class)
  */
-@Component( role = LifecycleModuleBuilder.class )
+@Named
+@Singleton
 public class LifecycleModuleBuilder
 {
 
-    @Requirement
+    @Inject
     private MojoExecutor mojoExecutor;
 
-    @Requirement
+    @Inject
     private BuilderCommon builderCommon;
 
-    @Requirement
+    @Inject
     private ExecutionEventCatapult eventCatapult;
 
     private ProjectExecutionListener projectExecutionListener;
 
-    // this tricks plexus-component-metadata generate required metadata
-    @Requirement
-    private List<ProjectExecutionListener> projectExecutionListeners;
-
-    @Requirement
+    @Inject
     private SessionScope sessionScope;
 
+    @Inject
     public void setProjectExecutionListeners( final List<ProjectExecutionListener> listeners )
     {
-        this.projectExecutionListeners = listeners;
         this.projectExecutionListener = new CompoundProjectExecutionListener( listeners );
     }
 
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecyclePluginResolver.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecyclePluginResolver.java
index b22e359..1f6fab0 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecyclePluginResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecyclePluginResolver.java
@@ -22,6 +22,10 @@ package org.apache.maven.lifecycle.internal;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.model.PluginManagement;
@@ -30,8 +34,6 @@ import org.apache.maven.plugin.version.PluginVersionRequest;
 import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.plugin.version.PluginVersionResolver;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * <strong>NOTE:</strong> This class is not part of any public api and can be changed or deleted without prior notice.
@@ -39,21 +41,18 @@ import org.codehaus.plexus.component.annotations.Requirement;
  * @author Benjamin Bentmann
  * @author Kristian Rosenvold (Extract class)
  */
-@Component( role = LifecyclePluginResolver.class )
+@Named
+@Singleton
 public class LifecyclePluginResolver
 {
-    @Requirement
-    private PluginVersionResolver pluginVersionResolver;
+    private final PluginVersionResolver pluginVersionResolver;
 
+    @Inject
     public LifecyclePluginResolver( PluginVersionResolver pluginVersionResolver )
     {
         this.pluginVersionResolver = pluginVersionResolver;
     }
 
-    public LifecyclePluginResolver()
-    {
-    }
-
     public void resolveMissingPluginVersions( MavenProject project, MavenSession session )
         throws PluginVersionResolutionException
     {
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
index cee8073..f616654 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
@@ -22,6 +22,10 @@ package org.apache.maven.lifecycle.internal;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.ExecutionEvent;
 import org.apache.maven.execution.MavenExecutionResult;
 import org.apache.maven.execution.MavenSession;
@@ -31,8 +35,6 @@ import org.apache.maven.lifecycle.NoGoalSpecifiedException;
 import org.apache.maven.lifecycle.internal.builder.Builder;
 import org.apache.maven.lifecycle.internal.builder.BuilderNotFoundException;
 import org.apache.maven.session.scope.internal.SessionScope;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 
 /**
@@ -42,31 +44,32 @@ import org.codehaus.plexus.logging.Logger;
  * @author Benjamin Bentmann
  * @author Kristian Rosenvold
  */
-@Component( role = LifecycleStarter.class )
+@Named
+@Singleton
 public class LifecycleStarter
 {
-    @Requirement
+    @Inject
     private ExecutionEventCatapult eventCatapult;
 
-    @Requirement
+    @Inject
     private DefaultLifecycles defaultLifeCycles;
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private BuildListCalculator buildListCalculator;
 
-    @Requirement
+    @Inject
     private LifecycleDebugLogger lifecycleDebugLogger;
 
-    @Requirement
+    @Inject
     private LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator;
 
-    @Requirement
+    @Inject
     private Map<String, Builder> builders;
     
-    @Requirement
+    @Inject
     private SessionScope sessionScope;
 
     public void execute( MavenSession session )
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
index 4bafa30..03eae37 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
@@ -19,6 +19,14 @@ package org.apache.maven.lifecycle.internal;
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.StringTokenizer;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.plugin.BuildPluginManager;
@@ -38,16 +46,10 @@ import org.apache.maven.plugin.version.PluginVersionRequest;
 import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.plugin.version.PluginVersionResolver;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.configuration.PlexusConfiguration;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.StringTokenizer;
-
 /**
  * <p>
  * Resolves dependencies for the artifacts in context of the lifecycle build
@@ -60,23 +62,24 @@ import java.util.StringTokenizer;
  * @author jdcasey
  * @author Kristian Rosenvold (extracted class only)
  */
-@Component( role = MojoDescriptorCreator.class )
+@Named
+@Singleton
 public class MojoDescriptorCreator
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private PluginVersionResolver pluginVersionResolver;
 
-    @Requirement
+    @Inject
     private BuildPluginManager pluginManager;
 
-    @Requirement
+    @Inject
     private PluginPrefixResolver pluginPrefixResolver;
 
-    @Requirement
+    @Inject
     private LifecyclePluginResolver lifecyclePluginResolver;
 
     public MojoDescriptorCreator()
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
index b78f54d..89fadfd 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
@@ -19,6 +19,19 @@ package org.apache.maven.lifecycle.internal;
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.CumulativeScopeArtifactFilter;
@@ -36,19 +49,8 @@ import org.apache.maven.plugin.PluginIncompatibleException;
 import org.apache.maven.plugin.PluginManagerException;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
 /**
  * <p>
  * Executes an individual mojo
@@ -60,20 +62,21 @@ import java.util.TreeSet;
  * @author Kristian Rosenvold
  * @since 3.0
  */
-@Component( role = MojoExecutor.class )
+@Named
+@Singleton
 public class MojoExecutor
 {
 
-    @Requirement
+    @Inject
     private BuildPluginManager pluginManager;
 
-    @Requirement
+    @Inject
     private MavenPluginManager mavenPluginManager;
 
-    @Requirement
+    @Inject
     private LifecycleDependencyResolver lifeCycleDependencyResolver;
 
-    @Requirement
+    @Inject
     private ExecutionEventCatapult eventCatapult;
 
     public MojoExecutor()
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
index f5c8e3e..6941c37 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
@@ -19,6 +19,12 @@ package org.apache.maven.lifecycle.internal.builder;
  * under the License.
  */
 
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.execution.BuildFailure;
 import org.apache.maven.execution.ExecutionEvent;
@@ -44,12 +50,8 @@ import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
 import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 
-import java.util.Set;
-
 /**
  * Common code that is shared by the LifecycleModuleBuilder and the LifeCycleWeaveBuilder
  *
@@ -58,19 +60,20 @@ import java.util.Set;
  *         Builds one or more lifecycles for a full module
  *         NOTE: This class is not part of any public api and can be changed or deleted without prior notice.
  */
-@Component( role = BuilderCommon.class )
+@Named
+@Singleton
 public class BuilderCommon
 {
-    @Requirement
+    @Inject
     private LifecycleDebugLogger lifecycleDebugLogger;
 
-    @Requirement
+    @Inject
     private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator;
 
-    @Requirement
+    @Inject
     private ExecutionEventCatapult eventCatapult;
 
-    @Requirement
+    @Inject
     private Logger logger;
 
 
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
index 29d1634..6f5658f 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
@@ -29,6 +29,10 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.lifecycle.internal.BuildThreadFactory;
 import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder;
@@ -39,8 +43,6 @@ import org.apache.maven.lifecycle.internal.ReactorContext;
 import org.apache.maven.lifecycle.internal.TaskSegment;
 import org.apache.maven.lifecycle.internal.builder.Builder;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 
 /**
@@ -57,15 +59,16 @@ import org.codehaus.plexus.logging.Logger;
  *         Builds one or more lifecycles for a full module
  *         NOTE: This class is not part of any public api and can be changed or deleted without prior notice.
  */
-@Component( role = Builder.class, hint = "multithreaded" )
+@Named( "multithreaded" )
+@Singleton
 public class MultiThreadedBuilder
     implements Builder
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private LifecycleModuleBuilder lifecycleModuleBuilder;
 
     public MultiThreadedBuilder()
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder.java
index f205b03..fee39d5 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder.java
@@ -21,6 +21,10 @@ package org.apache.maven.lifecycle.internal.builder.singlethreaded;
 
 import java.util.List;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder;
 import org.apache.maven.lifecycle.internal.ProjectBuildList;
@@ -29,20 +33,24 @@ import org.apache.maven.lifecycle.internal.ReactorBuildStatus;
 import org.apache.maven.lifecycle.internal.ReactorContext;
 import org.apache.maven.lifecycle.internal.TaskSegment;
 import org.apache.maven.lifecycle.internal.builder.Builder;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * <p>
  * A {@link Builder} encapsulates a strategy for building a set of Maven projects. The default strategy in Maven builds
  * the the projects serially, but a {@link Builder} can employ any type of concurrency model to build the projects.
  */
-@Component( role = Builder.class, hint = "singlethreaded" )
+@Named( "singlethreaded" )
+@Singleton
 public class SingleThreadedBuilder
     implements Builder
 {
-    @Requirement
-    private LifecycleModuleBuilder lifecycleModuleBuilder;
+    private final LifecycleModuleBuilder lifecycleModuleBuilder;
+
+    @Inject
+    public SingleThreadedBuilder( LifecycleModuleBuilder lifecycleModuleBuilder )
+    {
+        this.lifecycleModuleBuilder = lifecycleModuleBuilder;
+    }
 
     public void build( MavenSession session, ReactorContext reactorContext, ProjectBuildList projectBuilds,
                        List<TaskSegment> taskSegments, ReactorBuildStatus reactorBuildStatus )
diff --git a/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java b/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java
index 8607909..f1badcf 100644
--- a/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java
+++ b/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java
@@ -27,6 +27,10 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer;
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
@@ -40,22 +44,21 @@ import org.apache.maven.model.building.ModelProblem.Severity;
 import org.apache.maven.model.building.ModelProblem.Version;
 import org.apache.maven.model.building.ModelProblemCollectorRequest;
 import org.apache.maven.model.merge.MavenModelMerger;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * Handles injection of plugin executions induced by the lifecycle bindings for a packaging.
  *
  * @author Benjamin Bentmann
  */
-@Component( role = LifecycleBindingsInjector.class )
+@Named
+@Singleton
 public class DefaultLifecycleBindingsInjector
     implements LifecycleBindingsInjector
 {
 
     private LifecycleBindingsMerger merger = new LifecycleBindingsMerger();
 
-    @Requirement
+    @Inject
     private LifeCyclePluginAnalyzer lifecycle;
 
     public void injectLifecycleBindings( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java
index 1a00742..15a35ea 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java
@@ -23,6 +23,10 @@ import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
 import java.util.List;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.execution.MojoExecutionEvent;
 import org.apache.maven.execution.MojoExecutionListener;
@@ -32,8 +36,6 @@ import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.plugin.descriptor.PluginDescriptor;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.repository.RemoteRepository;
 
@@ -43,29 +45,26 @@ import org.eclipse.aether.repository.RemoteRepository;
 /**
  * DefaultBuildPluginManager
  */
-@Component( role = BuildPluginManager.class )
+@Named
+@Singleton
 public class DefaultBuildPluginManager
     implements BuildPluginManager
 {
 
-    @Requirement
+    @Inject
     private MavenPluginManager mavenPluginManager;
 
-    @Requirement
+    @Inject
     private LegacySupport legacySupport;
 
-    @Requirement
+    @Inject
     private MojoExecutionScope scope;
 
     private MojoExecutionListener mojoExecutionListener;
 
-    // this tricks plexus-component-metadata generate required metadata
-    @Requirement( role = MojoExecutionListener.class )
-    private List<MojoExecutionListener> mojoExecutionListeners;
-
+    @Inject
     public void setMojoExecutionListeners( final List<MojoExecutionListener> listeners )
     {
-        this.mojoExecutionListeners = listeners;
         this.mojoExecutionListener = new CompoundMojoExecutionListener( listeners );
     }
 
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java
index 6ce63eb..dd48a4f 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java
@@ -26,18 +26,21 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.project.ExtensionDescriptor;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
 import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
 
 /**
  * Default extension realm cache implementation. Assumes cached data does not change.
  */
-@Component( role = ExtensionRealmCache.class )
+@Named
+@Singleton
 public class DefaultExtensionRealmCache
     implements ExtensionRealmCache, Disposable
 {
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java
index ee11c4c..99de6d7 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java
@@ -26,11 +26,13 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.graph.DependencyFilter;
 import org.eclipse.aether.repository.LocalRepository;
@@ -41,7 +43,8 @@ import org.eclipse.aether.repository.WorkspaceRepository;
  * @author Igor Fedorenko
  * @author Benjamin Bentmann
  */
-@Component( role = PluginArtifactsCache.class )
+@Named
+@Singleton
 public class DefaultPluginArtifactsCache
     implements PluginArtifactsCache
 {
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java
index 0da9935..130cc35 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java
@@ -25,12 +25,14 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.plugin.descriptor.PluginDescriptor;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.repository.ComponentDescriptor;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.repository.LocalRepository;
@@ -47,7 +49,8 @@ import org.eclipse.aether.repository.WorkspaceRepository;
  * @since 3.0
  * @author Benjamin Bentmann
  */
-@Component( role = PluginDescriptorCache.class )
+@Named
+@Singleton
 public class DefaultPluginDescriptorCache
     implements PluginDescriptorCache
 {
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java
index 7862b40..cd0bbb9 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java
@@ -26,13 +26,15 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
 import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.graph.DependencyFilter;
@@ -43,7 +45,8 @@ import org.eclipse.aether.repository.WorkspaceRepository;
 /**
  * Default PluginCache implementation. Assumes cached data does not change.
  */
-@Component( role = PluginRealmCache.class )
+@Named
+@Singleton
 public class DefaultPluginRealmCache
     implements PluginRealmCache, Disposable
 {
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java
index bb55eb9..bc02e1f 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java
@@ -20,9 +20,12 @@ package org.apache.maven.plugin.internal;
  */
 
 import java.util.concurrent.atomic.AtomicReference;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.LegacySupport;
-import org.codehaus.plexus.component.annotations.Component;
 import org.eclipse.aether.RepositorySystemSession;
 
 /**
@@ -33,7 +36,8 @@ import org.eclipse.aether.RepositorySystemSession;
  * @since 3.0
  * @author Benjamin Bentmann
  */
-@Component( role = LegacySupport.class )
+@Named
+@Singleton
 public class DefaultLegacySupport
     implements LegacySupport
 {
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
index 9febd4a..500ead6 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
@@ -62,8 +62,6 @@ import org.apache.maven.session.scope.internal.SessionScopeModule;
 import org.codehaus.plexus.DefaultPlexusContainer;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.component.composition.CycleDetectedInComponentGraphException;
 import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
 import org.codehaus.plexus.component.configurator.ComponentConfigurator;
@@ -106,6 +104,10 @@ import java.util.Objects;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such
  * that the plugins/mojos can be used in arbitrary contexts. In particular, the mojos can be used for ordinary build
@@ -114,7 +116,8 @@ import java.util.zip.ZipEntry;
  * @author Benjamin Bentmann
  * @since 3.0
  */
-@Component( role = MavenPluginManager.class )
+@Named
+@Singleton
 public class DefaultMavenPluginManager
     implements MavenPluginManager
 {
@@ -130,37 +133,37 @@ public class DefaultMavenPluginManager
      */
     public static final String KEY_EXTENSIONS_REALMS = DefaultMavenPluginManager.class.getName() + "/extensionsRealms";
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private LoggerManager loggerManager;
 
-    @Requirement
+    @Inject
     private PlexusContainer container;
 
-    @Requirement
+    @Inject
     private ClassRealmManager classRealmManager;
 
-    @Requirement
+    @Inject
     private PluginDescriptorCache pluginDescriptorCache;
 
-    @Requirement
+    @Inject
     private PluginRealmCache pluginRealmCache;
 
-    @Requirement
+    @Inject
     private PluginDependenciesResolver pluginDependenciesResolver;
 
-    @Requirement
+    @Inject
     private RuntimeInformation runtimeInformation;
 
-    @Requirement
+    @Inject
     private ExtensionRealmCache extensionRealmCache;
 
-    @Requirement
+    @Inject
     private PluginVersionResolver pluginVersionResolver;
 
-    @Requirement
+    @Inject
     private PluginArtifactsCache pluginArtifactsCache;
 
     private ExtensionDescriptorBuilder extensionDescriptorBuilder = new ExtensionDescriptorBuilder();
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java
index 8d16c61..d1f2834 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java
@@ -25,12 +25,14 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.plugin.PluginResolutionException;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
 import org.eclipse.aether.DefaultRepositorySystemSession;
@@ -70,17 +72,18 @@ import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy;
  * @since 3.0
  * @author Benjamin Bentmann
  */
-@Component( role = PluginDependenciesResolver.class )
+@Named
+@Singleton
 public class DefaultPluginDependenciesResolver
     implements PluginDependenciesResolver
 {
 
     private static final String REPOSITORY_CONTEXT = "plugin";
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private RepositorySystem repoSystem;
 
     private Artifact toArtifact( Plugin plugin, RepositorySystemSession session )
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginManager.java
index a8ac9eb..547e457 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginManager.java
@@ -19,6 +19,12 @@ package org.apache.maven.plugin.internal;
  * under the License.
  */
 
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
@@ -53,33 +59,30 @@ import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.apache.maven.settings.Settings;
 import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
-import java.util.Map;
-
 /**
  * @author Benjamin Bentmann
  */
-@Component( role = PluginManager.class )
+@Named
+@Singleton
 public class DefaultPluginManager
     implements PluginManager
 {
 
-    @Requirement
+    @Inject
     private PlexusContainer container;
 
-    @Requirement
+    @Inject
     private MavenPluginManager pluginManager;
 
-    @Requirement
+    @Inject
     private PluginVersionResolver pluginVersionResolver;
 
-    @Requirement
+    @Inject
     private PluginPrefixResolver pluginPrefixResolver;
 
-    @Requirement
+    @Inject
     private LegacySupport legacySupport;
 
     public void executeMojo( MavenProject project, MojoExecution execution, MavenSession session )
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java
index 25a5bc8..7b98e80 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java
@@ -25,6 +25,10 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.repository.metadata.Metadata;
 import org.apache.maven.artifact.repository.metadata.io.MetadataReader;
 import org.apache.maven.model.Build;
@@ -35,12 +39,10 @@ import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
 import org.apache.maven.plugin.prefix.PluginPrefixRequest;
 import org.apache.maven.plugin.prefix.PluginPrefixResolver;
 import org.apache.maven.plugin.prefix.PluginPrefixResult;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
-import org.eclipse.aether.RepositoryEvent.EventType;
 import org.eclipse.aether.DefaultRepositorySystemSession;
 import org.eclipse.aether.RepositoryEvent;
+import org.eclipse.aether.RepositoryEvent.EventType;
 import org.eclipse.aether.RepositoryListener;
 import org.eclipse.aether.RepositorySystem;
 import org.eclipse.aether.RepositorySystemSession;
@@ -58,23 +60,24 @@ import org.eclipse.aether.resolution.MetadataResult;
  * @since 3.0
  * @author Benjamin Bentmann
  */
-@Component( role = PluginPrefixResolver.class )
+@Named
+@Singleton
 public class DefaultPluginPrefixResolver
     implements PluginPrefixResolver
 {
 
     private static final String REPOSITORY_CONTEXT = "plugin";
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private BuildPluginManager pluginManager;
 
-    @Requirement
+    @Inject
     private RepositorySystem repositorySystem;
 
-    @Requirement
+    @Inject
     private MetadataReader metadataReader;
 
     public PluginPrefixResult resolve( PluginPrefixRequest request )
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
index 82e32fb..17186dd 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
@@ -27,6 +27,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.TreeSet;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.repository.metadata.Metadata;
 import org.apache.maven.artifact.repository.metadata.Versioning;
 import org.apache.maven.artifact.repository.metadata.io.MetadataReader;
@@ -39,12 +43,10 @@ import org.apache.maven.plugin.version.PluginVersionRequest;
 import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.plugin.version.PluginVersionResolver;
 import org.apache.maven.plugin.version.PluginVersionResult;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
-import org.eclipse.aether.RepositoryEvent.EventType;
 import org.eclipse.aether.RepositoryEvent;
+import org.eclipse.aether.RepositoryEvent.EventType;
 import org.eclipse.aether.RepositoryListener;
 import org.eclipse.aether.RepositorySystem;
 import org.eclipse.aether.RepositorySystemSession;
@@ -65,23 +67,24 @@ import org.eclipse.aether.version.VersionScheme;
  * @since 3.0
  * @author Benjamin Bentmann
  */
-@Component( role = PluginVersionResolver.class )
+@Named
+@Singleton
 public class DefaultPluginVersionResolver
     implements PluginVersionResolver
 {
 
     private static final String REPOSITORY_CONTEXT = "plugin";
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private RepositorySystem repositorySystem;
 
-    @Requirement
+    @Inject
     private MetadataReader metadataReader;
 
-    @Requirement
+    @Inject
     private MavenPluginManager pluginManager;
 
     public PluginVersionResult resolve( PluginVersionRequest request )
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
index 1972242..3541bca 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
@@ -22,26 +22,34 @@ package org.apache.maven.project;
 import java.io.File;
 import java.util.List;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.model.Resource;
 import org.apache.maven.project.artifact.AttachedArtifact;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
  * DefaultMavenProjectHelper
  */
 @SuppressWarnings( "deprecation" )
-@Component( role = MavenProjectHelper.class )
+@Named
+@Singleton
 public class DefaultMavenProjectHelper
     extends AbstractLogEnabled
     implements MavenProjectHelper
 {
-    @Requirement
-    private ArtifactHandlerManager artifactHandlerManager;
+    private final ArtifactHandlerManager artifactHandlerManager;
+
+    @Inject
+    public DefaultMavenProjectHelper( ArtifactHandlerManager artifactHandlerManager )
+    {
+        this.artifactHandlerManager = artifactHandlerManager;
+    }
 
     public void attachArtifact( MavenProject project, String artifactType, String artifactClassifier,
                                 File artifactFile )
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
index c5bf26c..1ebc1fc 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
@@ -33,6 +33,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.InvalidArtifactRTException;
@@ -62,8 +66,6 @@ import org.apache.maven.model.building.ModelSource;
 import org.apache.maven.model.building.StringModelSource;
 import org.apache.maven.model.resolution.ModelResolver;
 import org.apache.maven.repository.internal.ArtifactDescriptorUtils;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.Os;
 import org.codehaus.plexus.util.StringUtils;
@@ -79,7 +81,8 @@ import org.eclipse.aether.resolution.ArtifactResult;
 /**
  * DefaultProjectBuilder
  */
-@Component( role = ProjectBuilder.class )
+@Named
+@Singleton
 public class DefaultProjectBuilder
     implements ProjectBuilder
 {
@@ -87,28 +90,28 @@ public class DefaultProjectBuilder
     public static final String DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY =
             "maven.defaultProjectBuilder.disableGlobalModelCache";
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private ModelBuilder modelBuilder;
 
-    @Requirement
+    @Inject
     private ModelProcessor modelProcessor;
 
-    @Requirement
+    @Inject
     private ProjectBuildingHelper projectBuildingHelper;
 
-    @Requirement
+    @Inject
     private MavenRepositorySystem repositorySystem;
 
-    @Requirement
+    @Inject
     private org.eclipse.aether.RepositorySystem repoSystem;
 
-    @Requirement
+    @Inject
     private RemoteRepositoryManager repositoryManager;
 
-    @Requirement
+    @Inject
     private ProjectDependenciesResolver dependencyResolver;
 
     private final ReactorModelCache modelCache = new ReactorModelCache();
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java
index 3159fac..33256fb 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java
@@ -29,6 +29,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.InvalidRepositoryException;
@@ -47,8 +51,6 @@ import org.apache.maven.plugin.version.PluginVersionResolutionException;
 import org.apache.maven.repository.RepositorySystem;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.eclipse.aether.graph.DependencyFilter;
 import org.eclipse.aether.util.filter.ExclusionsDependencyFilter;
@@ -60,27 +62,28 @@ import org.eclipse.aether.util.filter.ExclusionsDependencyFilter;
  *
  * @author Benjamin Bentmann
  */
-@Component( role = ProjectBuildingHelper.class )
+@Named
+@Singleton
 public class DefaultProjectBuildingHelper
     implements ProjectBuildingHelper
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private PlexusContainer container;
 
-    @Requirement
+    @Inject
     private ClassRealmManager classRealmManager;
 
-    @Requirement
+    @Inject
     private ProjectRealmCache projectRealmCache;
 
-    @Requirement
+    @Inject
     private RepositorySystem repositorySystem;
 
-    @Requirement
+    @Inject
     private MavenPluginManager pluginManager;
 
     public List<ArtifactRepository> createArtifactRepositories( List<Repository> pomRepositories,
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
index 7500e43..d6cc080 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
@@ -25,13 +25,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.DependencyManagement;
 import org.apache.maven.model.Exclusion;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
 import org.eclipse.aether.DefaultRepositorySystemSession;
@@ -54,18 +56,19 @@ import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
 /**
  * @author Benjamin Bentmann
  */
-@Component( role = ProjectDependenciesResolver.class )
+@Named
+@Singleton
 public class DefaultProjectDependenciesResolver
     implements ProjectDependenciesResolver
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private RepositorySystem repoSystem;
 
-    @Requirement
+    @Inject
     private List<RepositorySessionDecorator> decorators;
 
     public DependencyResolutionResult resolve( DependencyResolutionRequest request )
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java
index a7f0615..6651b62 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java
@@ -25,16 +25,19 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
 import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
 import org.eclipse.aether.graph.DependencyFilter;
 
 /**
  * Default project realm cache implementation. Assumes cached data does not change.
  */
-@Component( role = ProjectRealmCache.class )
+@Named
+@Singleton
 public class DefaultProjectRealmCache
     implements ProjectRealmCache, Disposable
 {
diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java
index 3db7bb7..5768709 100644
--- a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java
+++ b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java
@@ -30,17 +30,20 @@ import java.util.Set;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.artifact.metadata.ResolutionGroup;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
-import org.codehaus.plexus.component.annotations.Component;
 
 /**
  * DefaultMavenMetadataCache
  */
-@Component( role = MavenMetadataCache.class )
+@Named
+@Singleton
 public class DefaultMavenMetadataCache
     implements MavenMetadataCache
 {
diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMetadataSource.java b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMetadataSource.java
index 91f665b..9f22f99 100644
--- a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMetadataSource.java
+++ b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMetadataSource.java
@@ -19,8 +19,8 @@ package org.apache.maven.project.artifact;
  * under the License.
  */
 
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.codehaus.plexus.component.annotations.Component;
+import javax.inject.Named;
+import javax.inject.Singleton;
 
 /**
  * This realizes the metadata source via the default hint to provide backward-compat with Maven 2.x whose Plexus version
@@ -29,7 +29,8 @@ import org.codehaus.plexus.component.annotations.Component;
  *
  * @author Benjamin Bentmann
  */
-@Component( role = ArtifactMetadataSource.class )
+@Named
+@Singleton
 public class DefaultMetadataSource
     extends MavenMetadataSource
 {
diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java
index ae59ada..7ec4d9a 100644
--- a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java
+++ b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java
@@ -30,11 +30,13 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.lifecycle.LifecycleExecutionException;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.repository.LocalRepository;
 import org.eclipse.aether.repository.RemoteRepository;
@@ -45,7 +47,8 @@ import org.eclipse.aether.repository.WorkspaceRepository;
  * @author Benjamin Bentmann
  * @author Anton Tanasenko
  */
-@Component( role = ProjectArtifactsCache.class )
+@Named
+@Singleton
 public class DefaultProjectArtifactsCache
     implements ProjectArtifactsCache
 {
diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
index 1c40af8..a8f382e 100644
--- a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
+++ b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
@@ -32,6 +32,10 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
@@ -76,8 +80,6 @@ import org.apache.maven.repository.internal.MavenWorkspaceReader;
 import org.apache.maven.repository.legacy.metadata.DefaultMetadataResolutionRequest;
 import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest;
 import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.logging.Logger;
 import org.eclipse.aether.RepositorySystemSession;
@@ -88,30 +90,31 @@ import org.eclipse.aether.transfer.ArtifactNotFoundException;
 /**
  * @author Jason van Zyl
  */
-@Component( role = ArtifactMetadataSource.class, hint = "maven" )
+@Named( "maven" )
+@Singleton
 public class MavenMetadataSource
     implements ArtifactMetadataSource
 {
-    @Requirement
+    @Inject
     private RepositoryMetadataManager repositoryMetadataManager;
 
-    @Requirement
+    @Inject
     private ArtifactFactory repositorySystem;
 
     //TODO This prevents a cycle in the composition which shows us another problem we need to deal with.
-    //@Requirement
+    //@Inject
     private ProjectBuilder projectBuilder;
 
-    @Requirement
+    @Inject
     private PlexusContainer container;
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private MavenMetadataCache cache;
 
-    @Requirement
+    @Inject
     private LegacySupport legacySupport;
 
     private void injectSession( MetadataResolutionRequest request )
diff --git a/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java b/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java
index 12a6b6f..fbb817e 100644
--- a/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java
+++ b/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java
@@ -22,8 +22,6 @@ package org.apache.maven.rtinfo.internal;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.Validate;
 import org.apache.maven.rtinfo.RuntimeInformation;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.eclipse.aether.util.version.GenericVersionScheme;
 import org.eclipse.aether.version.InvalidVersionSpecificationException;
@@ -35,15 +33,20 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * Provides information about the current Maven runtime.
  */
-@Component( role = RuntimeInformation.class )
+@Named
+@Singleton
 public class DefaultRuntimeInformation
     implements RuntimeInformation
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
     private String mavenVersion;
diff --git a/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java b/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
index d3ffd92..8b12796 100644
--- a/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
@@ -22,14 +22,16 @@ package org.apache.maven.settings;
 import java.io.File;
 import java.io.IOException;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenExecutionRequest;
 import org.apache.maven.properties.internal.SystemProperties;
 import org.apache.maven.settings.building.DefaultSettingsBuildingRequest;
 import org.apache.maven.settings.building.SettingsBuilder;
 import org.apache.maven.settings.building.SettingsBuildingException;
 import org.apache.maven.settings.building.SettingsBuildingRequest;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -37,13 +39,14 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 /**
  * @author jdcasey
  */
-@Component( role = MavenSettingsBuilder.class )
+@Named
+@Singleton
 public class DefaultMavenSettingsBuilder
     extends AbstractLogEnabled
     implements MavenSettingsBuilder
 {
 
-    @Requirement
+    @Inject
     private SettingsBuilder settingsBuilder;
 
     public Settings buildSettings()
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
index 4c60aa4..bba161f 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
@@ -25,25 +25,28 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.descriptor.PluginDescriptor;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.toolchain.model.ToolchainModel;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 
 /**
  * @author mkleint
  */
-@Component( role = ToolchainManager.class )
+@Named
+@Singleton
 public class DefaultToolchainManager
     implements ToolchainManager
 {
-    @Requirement
+    @Inject
     Logger logger;
 
-    @Requirement( role = ToolchainFactory.class )
+    @Inject
     Map<String, ToolchainFactory> factories;
     
     @Override
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
index 1591573..ce1dd76 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
@@ -23,15 +23,18 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.toolchain.model.ToolchainModel;
-import org.codehaus.plexus.component.annotations.Component;
 
 /**
  * @author mkleint
  * @author Robert Scholte
  */
-@Component( role = ToolchainManagerPrivate.class )
+@Named
+@Singleton
 public class DefaultToolchainManagerPrivate
     extends DefaultToolchainManager
     implements ToolchainManagerPrivate
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainsBuilder.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainsBuilder.java
index c2b6a61..94f3114 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainsBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainsBuilder.java
@@ -21,25 +21,28 @@ package org.apache.maven.toolchain;
 
 import org.apache.maven.toolchain.model.PersistedToolchains;
 import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.ReaderFactory;
 
 import java.io.File;
 import java.io.Reader;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * @author Benjamin Bentmann
  * @deprecated instead use {@link org.apache.maven.toolchain.building.DefaultToolchainsBuilder}
  */
 @Deprecated
-@Component( role = ToolchainsBuilder.class, hint = "default" )
+@Named( "default" )
+@Singleton
 public class DefaultToolchainsBuilder
     implements ToolchainsBuilder
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
     public PersistedToolchains build( File userToolchainsFile )
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java
index cd4aef0..f2e45a3 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java
@@ -23,14 +23,16 @@ import java.io.File;
 import java.util.Map.Entry;
 import java.util.Properties;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.toolchain.MisconfiguredToolchainException;
 import org.apache.maven.toolchain.RequirementMatcher;
 import org.apache.maven.toolchain.RequirementMatcherFactory;
 import org.apache.maven.toolchain.ToolchainFactory;
 import org.apache.maven.toolchain.ToolchainPrivate;
 import org.apache.maven.toolchain.model.ToolchainModel;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
@@ -43,12 +45,13 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
  * @author mkleint
  * @since 2.0.9, renamed from <code>DefaultJavaToolchainFactory</code> in 3.2.4
  */
-@Component( role = ToolchainFactory.class, hint = "jdk" )
+@Named( "jdk" )
+@Singleton
 public class JavaToolchainFactory
     implements ToolchainFactory
 {
 
-    @Requirement
+    @Inject
     private Logger logger;
 
     public ToolchainPrivate createToolchain( ToolchainModel model )


[maven-studies] 07/11: Revert "[MNG-6867] extract methods, apply SLA"

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit d127bce8c9ba1011ef531c864162368891e8d499
Author: Lewinski, Arne <ar...@DE-L072609.groupinfra.com>
AuthorDate: Sun Feb 16 14:54:11 2020 +0100

    Revert "[MNG-6867] extract methods, apply SLA"
    
    This reverts commit c423a090e385735d2b826860f790077269bbf8ba.
---
 .../plugin/internal/DefaultMavenPluginManager.java | 68 +++++++++-------------
 1 file changed, 26 insertions(+), 42 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
index eec09ef..500ead6 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
@@ -328,15 +328,37 @@ public class DefaultMavenPluginManager
 
         if ( plugin.isExtensions() )
         {
-            setupPluginDescriptor( pluginDescriptor, session );
+            ExtensionRealmCache.CacheRecord extensionRecord;
+            try
+            {
+                RepositorySystemSession repositorySession = session.getRepositorySession();
+                extensionRecord = setupExtensionsRealm( project, plugin, repositorySession );
+            }
+            catch ( PluginManagerException e )
+            {
+                // extensions realm is expected to be fully setup at this point
+                // any exception means a problem in maven code, not a user error
+                throw new IllegalStateException( e );
+            }
+
+            ClassRealm pluginRealm = extensionRecord.getRealm();
+            List<Artifact> pluginArtifacts = extensionRecord.getArtifacts();
+
+            for ( ComponentDescriptor<?> componentDescriptor : pluginDescriptor.getComponents() )
+            {
+                componentDescriptor.setRealm( pluginRealm );
+            }
+
+            pluginDescriptor.setClassRealm( pluginRealm );
+            pluginDescriptor.setArtifacts( pluginArtifacts );
         }
         else
         {
             Map<String, ClassLoader> foreignImports = calcImports( project, parent, imports );
 
-            PluginRealmCache.Key cacheKey =
-                pluginRealmCache.createKey( plugin, parent, foreignImports, filter,
-                                            project.getRemotePluginRepositories(), session.getRepositorySession() );
+            PluginRealmCache.Key cacheKey = pluginRealmCache.createKey( plugin, parent, foreignImports, filter,
+                                                                        project.getRemotePluginRepositories(),
+                                                                        session.getRepositorySession() );
 
             PluginRealmCache.CacheRecord cacheRecord = pluginRealmCache.get( cacheKey );
 
@@ -361,44 +383,6 @@ public class DefaultMavenPluginManager
         }
     }
 
-    private void setupPluginDescriptor( PluginDescriptor pluginDescriptor, MavenSession session )
-    {
-        setupPluginDescriptor( pluginDescriptor,
-                               setupExtensionsRealmInternal( session.getCurrentProject(), pluginDescriptor.getPlugin(),
-                                                             session.getRepositorySession() ) );
-    }
-
-    private void setupPluginDescriptor( PluginDescriptor pluginDescriptor,
-                                        ExtensionRealmCache.CacheRecord extensionRecord )
-    {
-        setupComponentDescriptors( extensionRecord, pluginDescriptor.getComponents() );
-        pluginDescriptor.setClassRealm( extensionRecord.getRealm() );
-        pluginDescriptor.setArtifacts( extensionRecord.getArtifacts() );
-    }
-
-    private void setupComponentDescriptors( ExtensionRealmCache.CacheRecord extensionRecord,
-                                            List<ComponentDescriptor<?>> components )
-    {
-        components.stream().forEach( descriptor -> descriptor.setRealm( extensionRecord.getRealm() ) );
-    }
-
-    /**
-     * For internal usage. It is assumed that the prerequisites are met so a setup of the extensions realm can be
-     * processed without any error. Any exception thrown indicates a programming error, not a user error!
-     */
-    private ExtensionRealmCache.CacheRecord setupExtensionsRealmInternal( MavenProject project, Plugin plugin,
-                                                                          RepositorySystemSession repositorySystemSession )
-    {
-        try
-        {
-            return setupExtensionsRealm( project, plugin, repositorySystemSession );
-        }
-        catch ( PluginManagerException e )
-        {
-            throw new IllegalStateException( e );
-        }
-    }
-
     private void createPluginRealm( PluginDescriptor pluginDescriptor, MavenSession session, ClassLoader parent,
                                     Map<String, ClassLoader> foreignImports, DependencyFilter filter )
         throws PluginResolutionException, PluginContainerException


[maven-studies] 03/11: [MNG-5577] Simplify tests to reduce use of wiring.

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch maven-metrics
in repository https://gitbox.apache.org/repos/asf/maven-studies.git

commit b962ff361aee64a291db588e9f88d86c5f9dee0c
Author: Joseph Walton <jo...@kafsemo.org>
AuthorDate: Mon Jun 24 22:54:06 2019 +1000

    [MNG-5577] Simplify tests to reduce use of wiring.
    
    - Reduce the use of wiring in unit tests
    - Enable class scanning for tests that require it.
    - Remove test and wiring that's not used.
---
 .../factory/DefaultArtifactFactoryTest.java        | 10 ++++++++
 .../transform/TransformationManagerTest.java       | 10 ++++++++
 .../apache/maven/project/ProjectClasspathTest.java | 13 +++++++---
 .../apache/maven/project/TestProjectBuilder.java   | 28 ----------------------
 .../repository/legacy/DefaultWagonManagerTest.java | 10 ++++++++
 .../resolver/DefaultArtifactCollectorTest.java     | 10 ++++++++
 .../conflict/AbstractConflictResolverTest.java     | 10 ++++++++
 .../DefaultGraphConflictResolutionPolicyTest.java  |  7 +++---
 .../DefaultMavenExecutionRequestPopulator.java     |  2 ++
 .../configuration/DefaultBeanConfiguratorTest.java |  8 ++++---
 .../maven/lifecycle/DefaultLifecyclesTest.java     | 10 ++++++++
 .../apache/maven/project/TestMetadataSource.java   | 10 ++++----
 .../artifact/DefaultMavenMetadataCacheTest.java    |  2 +-
 .../artifact/DefaultProjectArtifactsCacheTest.java |  7 +++---
 .../maven/repository/LegacyRepositoryLayout.java   |  7 ++++--
 .../repository/TestRepositoryConnectorFactory.java |  7 ++++--
 .../maven/repository/TestRepositorySystem.java     | 22 +++++++++++------
 .../internal/DefaultRuntimeInformationTest.java    | 11 +++++++++
 .../java/org/apache/maven/cli/MavenCliTest.java    | 19 +++++++++++++--
 19 files changed, 145 insertions(+), 58 deletions(-)

diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/factory/DefaultArtifactFactoryTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/factory/DefaultArtifactFactoryTest.java
index 0d109ac..a90c33b 100644
--- a/maven-compat/src/test/java/org/apache/maven/artifact/factory/DefaultArtifactFactoryTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/artifact/factory/DefaultArtifactFactoryTest.java
@@ -21,12 +21,22 @@ package org.apache.maven.artifact.factory;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.versioning.VersionRange;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusTestCase;
 
 public class DefaultArtifactFactoryTest
     extends PlexusTestCase
 {
 
+    @Override
+    protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
+    {
+        super.customizeContainerConfiguration( containerConfiguration );
+        containerConfiguration.setAutoWiring( true );
+        containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+    }
+
     public void testPropagationOfSystemScopeRegardlessOfInheritedScope() throws Exception
     {
         ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java
index 3845092..45b4c00 100644
--- a/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java
@@ -21,12 +21,22 @@ import org.apache.maven.repository.legacy.resolver.transform.ArtifactTransformat
 import org.apache.maven.repository.legacy.resolver.transform.LatestArtifactTransformation;
 import org.apache.maven.repository.legacy.resolver.transform.ReleaseArtifactTransformation;
 import org.apache.maven.repository.legacy.resolver.transform.SnapshotTransformation;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusTestCase;
 
 /** @author Jason van Zyl */
 public class TransformationManagerTest
     extends PlexusTestCase
 {
+    @Override
+    protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
+    {
+        super.customizeContainerConfiguration( containerConfiguration );
+        containerConfiguration.setAutoWiring( true );
+        containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+    }
+
     public void testTransformationManager()
         throws Exception
     {
diff --git a/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java b/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
index d7ae86e..10825d2 100644
--- a/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
@@ -24,6 +24,8 @@ import java.io.File;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.repository.RepositorySystem;
 import org.apache.maven.repository.internal.DefaultArtifactDescriptorReader;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
 import org.eclipse.aether.impl.ArtifactDescriptorReader;
 import org.eclipse.aether.impl.ArtifactResolver;
 
@@ -32,6 +34,14 @@ public class ProjectClasspathTest
 {
     static final String dir = "projects/scope/";
 
+    @Override
+    protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
+    {
+        super.customizeContainerConfiguration( containerConfiguration );
+        containerConfiguration.setAutoWiring( true );
+        containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+    }
+
     public void setUp()
         throws Exception
     {
@@ -41,9 +51,6 @@ public class ProjectClasspathTest
 
         projectBuilder = lookup( ProjectBuilder.class, "classpath" );
 
-        // the metadata source looks up the default impl, so we have to trick it
-        getContainer().addComponent( projectBuilder, ProjectBuilder.class, "default" );
-
         repositorySystem = lookup( RepositorySystem.class );
     }
 
diff --git a/maven-compat/src/test/java/org/apache/maven/project/TestProjectBuilder.java b/maven-compat/src/test/java/org/apache/maven/project/TestProjectBuilder.java
index 754487f..bb6a20d 100644
--- a/maven-compat/src/test/java/org/apache/maven/project/TestProjectBuilder.java
+++ b/maven-compat/src/test/java/org/apache/maven/project/TestProjectBuilder.java
@@ -16,10 +16,8 @@ package org.apache.maven.project;
  */
 
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.util.Collections;
 
-import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.codehaus.plexus.component.annotations.Component;
 
@@ -29,32 +27,6 @@ public class TestProjectBuilder
 {
 
     @Override
-    public ProjectBuildingResult build( Artifact artifact, ProjectBuildingRequest request )
-        throws ProjectBuildingException
-    {
-        if ( "maven-test".equals( artifact.getGroupId() ) )
-        {
-            String scope = artifact.getArtifactId().substring( "scope-".length() );
-
-            try
-            {
-                artifact.setFile( ProjectClasspathTest.getFileForClasspathResource( ProjectClasspathTest.dir + "transitive-" + scope + "-dep.xml" ) );
-            }
-            catch ( FileNotFoundException e )
-            {
-                throw new IllegalStateException( "Missing test POM for " + artifact );
-            }
-        }
-        if ( artifact.getFile() == null )
-        {
-            MavenProject project = new MavenProject();
-            project.setArtifact( artifact );
-            return new DefaultProjectBuildingResult( project, null, null );
-        }
-        return build( artifact.getFile(), request );
-    }
-
-    @Override
     public ProjectBuildingResult build( File pomFile, ProjectBuildingRequest configuration )
         throws ProjectBuildingException
     {
diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultWagonManagerTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultWagonManagerTest.java
index aa5dd68..1b3cb79 100644
--- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultWagonManagerTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultWagonManagerTest.java
@@ -43,6 +43,8 @@ import org.apache.maven.wagon.events.TransferEvent;
 import org.apache.maven.wagon.events.TransferListener;
 import org.apache.maven.wagon.observers.AbstractTransferListener;
 import org.apache.maven.wagon.observers.Debug;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.util.FileUtils;
 
@@ -60,6 +62,14 @@ public class DefaultWagonManagerTest
 
     private ArtifactRepositoryFactory artifactRepositoryFactory;
 
+    @Override
+    protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
+    {
+        super.customizeContainerConfiguration( containerConfiguration );
+        containerConfiguration.setAutoWiring( true );
+        containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+    }
+
     protected void setUp()
         throws Exception
     {
diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/DefaultArtifactCollectorTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/DefaultArtifactCollectorTest.java
index 3f3a926..5d88702 100644
--- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/DefaultArtifactCollectorTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/DefaultArtifactCollectorTest.java
@@ -37,6 +37,8 @@ import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
 import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusTestCase;
 
 import java.util.ArrayList;
@@ -68,6 +70,14 @@ public class DefaultArtifactCollectorTest
     private static final String GROUP_ID = "test";
 
     @Override
+    protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
+    {
+        super.customizeContainerConfiguration( containerConfiguration );
+        containerConfiguration.setAutoWiring( true );
+        containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+    }
+
+    @Override
     protected void setUp()
         throws Exception
     {
diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/AbstractConflictResolverTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/AbstractConflictResolverTest.java
index 12a0c57..1b4f4f4 100644
--- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/AbstractConflictResolverTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/AbstractConflictResolverTest.java
@@ -26,6 +26,8 @@ import org.apache.maven.artifact.resolver.ResolutionNode;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.repository.legacy.resolver.conflict.ConflictResolver;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusTestCase;
 
 import java.util.Collections;
@@ -66,6 +68,14 @@ public abstract class AbstractConflictResolverTest
 
     // TestCase methods -------------------------------------------------------
 
+    @Override
+    protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
+    {
+        super.customizeContainerConfiguration( containerConfiguration );
+        containerConfiguration.setAutoWiring( true );
+        containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+    }
+
     /*
      * @see junit.framework.TestCase#setUp()
      */
diff --git a/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicyTest.java b/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicyTest.java
index 31832c3..89c0116 100644
--- a/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicyTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicyTest.java
@@ -17,7 +17,8 @@ package org.apache.maven.repository.metadata;
 
 import org.apache.maven.repository.metadata.GraphConflictResolutionPolicy;
 import org.apache.maven.repository.metadata.MetadataGraphEdge;
-import org.codehaus.plexus.PlexusTestCase;
+
+import junit.framework.TestCase;
 
 /**
  *
@@ -26,7 +27,7 @@ import org.codehaus.plexus.PlexusTestCase;
  */
 
 public class DefaultGraphConflictResolutionPolicyTest
-extends PlexusTestCase
+    extends TestCase
 {
 	GraphConflictResolutionPolicy policy;
 	MetadataGraphEdge e1;
@@ -37,7 +38,7 @@ extends PlexusTestCase
 	protected void setUp() throws Exception
 	{
 		super.setUp();
-    	policy = (GraphConflictResolutionPolicy) lookup( GraphConflictResolutionPolicy.ROLE, "default" );
+		policy = new DefaultGraphConflictResolutionPolicy();
     	e1 = new MetadataGraphEdge( "1.1", true, null, null, 2, 1 );
     	e2 = new MetadataGraphEdge( "1.2", true, null, null, 3, 2 );
     	e3 = new MetadataGraphEdge( "1.2", true, null, null, 2, 3 );
diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
index 6951c91..399ee34 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
@@ -28,6 +28,7 @@ import java.util.Set;
 
 import javax.inject.Inject;
 import javax.inject.Named;
+import javax.inject.Singleton;
 
 import org.apache.maven.artifact.InvalidRepositoryException;
 import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -53,6 +54,7 @@ import org.codehaus.plexus.util.StringUtils;
  * Assists in populating an execution request for invocation of Maven.
  */
 @Named
+@Singleton
 public class DefaultMavenExecutionRequestPopulator
     implements MavenExecutionRequestPopulator
 {
diff --git a/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java b/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java
index 3fca965..a0588a2 100644
--- a/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java
+++ b/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java
@@ -23,16 +23,18 @@ import java.io.File;
 import java.io.IOException;
 import java.io.StringReader;
 
-import org.codehaus.plexus.PlexusTestCase;
+import org.apache.maven.configuration.internal.DefaultBeanConfigurator;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
+import junit.framework.TestCase;
+
 /**
  * @author Benjamin Bentmann
  */
 public class DefaultBeanConfiguratorTest
-    extends PlexusTestCase
+    extends TestCase
 {
 
     private BeanConfigurator configurator;
@@ -43,7 +45,7 @@ public class DefaultBeanConfiguratorTest
     {
         super.setUp();
 
-        configurator = lookup( BeanConfigurator.class );
+        configurator = new DefaultBeanConfigurator();
     }
 
     @Override
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java
index 690532c..d025cdd 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java
@@ -14,6 +14,8 @@
  */
 package org.apache.maven.lifecycle;
 
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.component.annotations.Requirement;
 
@@ -29,6 +31,14 @@ public class DefaultLifecyclesTest
     @Requirement
     private DefaultLifecycles defaultLifeCycles;
 
+    @Override
+    protected void customizeContainerConfiguration(
+            ContainerConfiguration configuration)
+    {
+        super.customizeContainerConfiguration(configuration);
+        configuration.setAutoWiring(true);
+        configuration.setClassPathScanning(PlexusConstants.SCANNING_INDEX);
+    }
 
     protected void setUp()
         throws Exception
diff --git a/maven-core/src/test/java/org/apache/maven/project/TestMetadataSource.java b/maven-core/src/test/java/org/apache/maven/project/TestMetadataSource.java
index 67c0037..d39f4c6 100644
--- a/maven-core/src/test/java/org/apache/maven/project/TestMetadataSource.java
+++ b/maven-core/src/test/java/org/apache/maven/project/TestMetadataSource.java
@@ -21,16 +21,18 @@ package org.apache.maven.project;
 
 import java.util.List;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
 import org.apache.maven.artifact.metadata.ResolutionGroup;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.project.artifact.MavenMetadataSource;
-import org.codehaus.plexus.component.annotations.Component;
 
 @SuppressWarnings( "deprecation" )
-@Component( role = ArtifactMetadataSource.class, hint = "classpath" )
+@Named( "classpath" )
+@Singleton
 public class TestMetadataSource
     extends MavenMetadataSource
 {
@@ -48,4 +50,4 @@ public class TestMetadataSource
 
         return rg;
     }
-}
\ No newline at end of file
+}
diff --git a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java
index c50cd70..c039934 100644
--- a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java
@@ -44,7 +44,7 @@ public class DefaultMavenMetadataCacheTest
         throws Exception
     {
         super.setUp();
-        repositorySystem = new TestRepositorySystem();
+        repositorySystem = new TestRepositorySystem( null, null );
     }
 
     @Override
diff --git a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java
index 166c068..dfc4d80 100644
--- a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java
@@ -26,9 +26,10 @@ import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.DefaultArtifact;
-import org.codehaus.plexus.PlexusTestCase;
 
-public class DefaultProjectArtifactsCacheTest extends PlexusTestCase
+import junit.framework.TestCase;
+
+public class DefaultProjectArtifactsCacheTest extends TestCase
 {
     
     private ProjectArtifactsCache cache;
@@ -38,7 +39,7 @@ public class DefaultProjectArtifactsCacheTest extends PlexusTestCase
         throws Exception
     {
         super.setUp();
-        cache = lookup( ProjectArtifactsCache.class );
+        cache = new DefaultProjectArtifactsCache();
     }
     
     public void testProjectDependencyOrder() throws Exception
diff --git a/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java b/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java
index 77a6bae..bef400e 100644
--- a/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java
+++ b/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java
@@ -1,5 +1,8 @@
 package org.apache.maven.repository;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -24,12 +27,12 @@ import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.codehaus.plexus.component.annotations.Component;
 
 /**
  * @author jdcasey
  */
-@Component(role=ArtifactRepositoryLayout.class, hint="legacy")
+@Named( "legacy" )
+@Singleton
 public class LegacyRepositoryLayout
     implements ArtifactRepositoryLayout
 {
diff --git a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java
index 17fd43f..1f41e09 100644
--- a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java
+++ b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java
@@ -19,7 +19,9 @@ package org.apache.maven.repository;
  * under the License.
  */
 
-import org.codehaus.plexus.component.annotations.Component;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.repository.RemoteRepository;
 import org.eclipse.aether.spi.connector.RepositoryConnector;
@@ -29,7 +31,8 @@ import org.eclipse.aether.transfer.NoRepositoryConnectorException;
 /**
  * @author Benjamin Bentmann
  */
-@Component( role = RepositoryConnectorFactory.class, hint = "test" )
+@Named( "test" )
+@Singleton
 public class TestRepositoryConnectorFactory
     implements RepositoryConnectorFactory
 {
diff --git a/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java b/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java
index 0e054c6..a3c1c0d 100644
--- a/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java
+++ b/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java
@@ -26,6 +26,10 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.DefaultArtifact;
 import org.apache.maven.artifact.InvalidRepositoryException;
@@ -48,8 +52,6 @@ import org.apache.maven.project.artifact.ArtifactWithDependencies;
 import org.apache.maven.settings.Mirror;
 import org.apache.maven.settings.Proxy;
 import org.apache.maven.settings.Server;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 import org.eclipse.aether.RepositorySystemSession;
@@ -57,16 +59,22 @@ import org.eclipse.aether.RepositorySystemSession;
 /**
  * @author Benjamin Bentmann
  */
-@Component( role = RepositorySystem.class )
+@Named
+@Singleton
 public class TestRepositorySystem
     implements RepositorySystem
 {
 
-    @Requirement
-    private ModelReader modelReader;
+    private final ModelReader modelReader;
+
+    private final ArtifactFactory artifactFactory;
 
-    @Requirement
-    private ArtifactFactory artifactFactory;
+    @Inject
+    public TestRepositorySystem( ModelReader modelReader, ArtifactFactory artifactFactory )
+    {
+        this.modelReader = modelReader;
+        this.artifactFactory = artifactFactory;
+    }
 
     public ArtifactRepository buildArtifactRepository( Repository repository )
         throws InvalidRepositoryException
diff --git a/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java b/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java
index d367fb9..68fbcb1 100644
--- a/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java
+++ b/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java
@@ -20,12 +20,23 @@ package org.apache.maven.rtinfo.internal;
  */
 
 import org.apache.maven.rtinfo.RuntimeInformation;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusTestCase;
 
 public class DefaultRuntimeInformationTest
     extends PlexusTestCase
 {
 
+    @Override
+    protected void customizeContainerConfiguration(
+            ContainerConfiguration configuration)
+    {
+        super.customizeContainerConfiguration(configuration);
+        configuration.setAutoWiring(true);
+        configuration.setClassPathScanning(PlexusConstants.SCANNING_INDEX);
+    }
+
     public void testGetMavenVersion()
         throws Exception
     {
diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
index 5f4c5b6..173b78c 100644
--- a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
+++ b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
@@ -24,12 +24,13 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeTrue;
-import static org.mockito.Mockito.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 
 import java.io.File;
+import java.util.Collections;
 
 import org.apache.commons.cli.ParseException;
 import org.apache.maven.Maven;
@@ -37,12 +38,17 @@ import org.apache.maven.eventspy.internal.EventSpyDispatcher;
 import org.apache.maven.shared.utils.logging.MessageUtils;
 import org.apache.maven.toolchain.building.ToolchainsBuildingRequest;
 import org.apache.maven.toolchain.building.ToolchainsBuildingResult;
+import org.codehaus.plexus.DefaultPlexusContainer;
 import org.codehaus.plexus.PlexusContainer;
+import org.eclipse.sisu.plexus.PlexusBeanModule;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.InOrder;
 
+import com.google.inject.Binder;
+import com.google.inject.Module;
+
 public class MavenCliTest
 {
     private MavenCli cli;
@@ -314,8 +320,17 @@ public class MavenCliTest
             @Override
             protected void customizeContainer(PlexusContainer container) {
                 super.customizeContainer(container);
-                container.addComponent(eventSpyDispatcherMock, "org.apache.maven.eventspy.internal.EventSpyDispatcher");
                 container.addComponent(mock(Maven.class), "org.apache.maven.Maven");
+
+                ((DefaultPlexusContainer)container).addPlexusInjector(Collections.<PlexusBeanModule>emptyList(),
+                        new Module()
+                        {
+                            public void configure( final Binder binder )
+                            {
+                                binder.bind( EventSpyDispatcher.class ).toInstance( eventSpyDispatcherMock );
+                            }
+                        }
+                    );
             }
         };