From 64c41950671b6b5472532cd2e34f28fff17c5fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sun, 23 Mar 2014 19:58:26 +0100 Subject: [PATCH] [MNG-5608] added a warning on ${project.basedir} use for profile activation --- .../model/profile/activation/FileProfileActivator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java index 039c37badc..ae20762b22 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java @@ -116,6 +116,14 @@ public class FileProfileActivator return null; } } ); + + if ( path.contains( "${project.basedir}" ) ) + { + problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.BASE ) + .setMessage( "Failed to interpolate file location " + path + " for profile " + profile.getId() + ": ${project.basedir} expression not supported during profile activation, use ${basedir} instead" ) + .setLocation( file.getLocation( missing ? "missing" : "exists" ) ) ); + } + } else if ( path.contains( "${basedir}" ) ) {