[maven] branch master updated: [MNG-7071] Remove the profiles.xml warning, since the functionality is ignored since Maven 3.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[maven] branch master updated: [MNG-7071] Remove the profiles.xml warning, since the functionality is ignored since Maven 3.

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

martinkanters pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/master by this push:
     new 83dc690  [MNG-7071] Remove the profiles.xml warning, since the functionality is ignored since Maven 3.
83dc690 is described below

commit 83dc6909aa457c829b1e003b4cf1861f6b971646
Author: Martin Kanters <[hidden email]>
AuthorDate: Fri Jan 8 15:15:41 2021 +0100

    [MNG-7071] Remove the profiles.xml warning, since the functionality is ignored since Maven 3.
---
 .../maven/project/DefaultProjectBuilder.java       | 37 ----------------------
 .../test-pom-and-settings-interpolation/pom.xml    |  4 +--
 2 files changed, 2 insertions(+), 39 deletions(-)

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 308097d..fa3b3e4 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
@@ -705,16 +705,6 @@ public class DefaultProjectBuilder
             project.setInjectedProfileIds( modelId, getProfileIds( result.getActivePomProfiles( modelId ) ) );
         }
 
-        String modelId = findProfilesXml( result, profilesXmls );
-        if ( modelId != null )
-        {
-            ModelProblem problem =
-                new DefaultModelProblem( "Detected profiles.xml alongside " + modelId
-                    + ", this file is no longer supported and was ignored" + ", please use the settings.xml instead",
-                                         ModelProblem.Severity.WARNING, ModelProblem.Version.V30, model, -1, -1, null );
-            result.getProblems().add( problem );
-        }
-
         //
         // All the parts that were taken out of MavenProject for Maven 4.0.0
         //
@@ -1019,33 +1009,6 @@ public class DefaultProjectBuilder
         return version;
     }
 
-    private String findProfilesXml( ModelBuildingResult result, Map<File, Boolean> profilesXmls )
-    {
-        for ( String modelId : result.getModelIds() )
-        {
-            Model model = result.getRawModel( modelId );
-
-            File basedir = model.getProjectDirectory();
-            if ( basedir == null )
-            {
-                break;
-            }
-
-            Boolean profilesXml = profilesXmls.get( basedir );
-            if ( profilesXml == null )
-            {
-                profilesXml = new File( basedir, "profiles.xml" ).exists();
-                profilesXmls.put( basedir, profilesXml );
-            }
-            if ( profilesXml )
-            {
-                return modelId;
-            }
-        }
-
-        return null;
-    }
-
     /**
      * InternalConfig
      */
diff --git a/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/pom.xml b/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/pom.xml
index 245349a..0214eb6 100644
--- a/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/pom.xml
+++ b/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/pom.xml
@@ -29,8 +29,8 @@ under the License.
 
   <name>Maven Integration Test :: MNG-4107</name>
   <description>
-    Test that POM interpolation uses the property values from the dominant profile source (POM vs. profiles.xml
-    vs. settings.xml). This boils down to the proper order of profile injection and interpolation, i.e.
+    Test that POM interpolation uses the property values from the dominant profile source (POM vs. settings.xml).
+    This boils down to the proper order of profile injection and interpolation, i.e.
     interpolate after profiles from all sources are injected.
   </description>