You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2014/03/23 19:58:28 UTC

git commit: [MNG-5608] added a warning on ${project.basedir} use for profile activation

Repository: maven
Updated Branches:
  refs/heads/master 3c7744a9a -> 64c419506


[MNG-5608] added a warning on ${project.basedir} use for profile
activation

Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/64c41950
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/64c41950
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/64c41950

Branch: refs/heads/master
Commit: 64c41950671b6b5472532cd2e34f28fff17c5fee
Parents: 3c7744a
Author: Hervé Boutemy <hb...@apache.org>
Authored: Sun Mar 23 19:58:26 2014 +0100
Committer: Hervé Boutemy <hb...@apache.org>
Committed: Sun Mar 23 19:58:26 2014 +0100

----------------------------------------------------------------------
 .../maven/model/profile/activation/FileProfileActivator.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/64c41950/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
----------------------------------------------------------------------
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 039c37b..ae20762 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}" ) )
         {


Re: git commit: [MNG-5608] added a warning on ${project.basedir} use for profile activation

Posted by Hervé BOUTEMY <he...@free.fr>.
ok, I'll have a look to try to move code

Regards,

Hervé

Le lundi 24 mars 2014 19:14:02 Robert Scholte a écrit :
> In fact, a ModelValidator validates both the rawModel and effectiveModel[1]
> 
> regards,
> Robert
> 
> [1]
> https://git-wip-us.apache.org/repos/asf?p=maven.git;a=blob;f=maven-model-bui
> lder/src/main/java/org/apache/maven/model/validation/ModelValidator.java;h=3
> 4bd97a5dc3d0a2d5f694d069ab80328d4adee1c;hb=HEAD1
> 
> Op Mon, 24 Mar 2014 00:20:06 +0100 schreef Hervé BOUTEMY
> 
> <he...@free.fr>:
> > I don't think so: DefaultModelValidator is the *effective model*
> > validator
> > It contains validations that happen when everything is done: it's too
> > late for
> > profile activation controls
> > 
> > Regards,
> > 
> > Hervé
> > 
> > Le dimanche 23 mars 2014 20:29:42 Robert Scholte a écrit :
> >> Hi Hervé,
> >> 
> >> I think this should have been fixed in the
> >> org.apache.maven.model.validation.DefaultModelValidator.
> >> That's the location where all these kinds of validations are done.
> >> A ProfileActivator has only one task: Determines whether the specified
> >> profile is active in the given activator context.
> >> 
> >> regards,
> >> Robert
> >> 
> >> Op Sun, 23 Mar 2014 19:58:28 +0100 schreef <hb...@apache.org>:
> >> > Repository: maven
> >> > 
> >> > Updated Branches:
> >> >   refs/heads/master 3c7744a9a -> 64c419506
> >> > 
> >> > [MNG-5608] added a warning on ${project.basedir} use for profile
> >> > activation
> >> > 
> >> > Project: http://git-wip-us.apache.org/repos/asf/maven/repo
> >> > Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/64c41950
> >> > Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/64c41950
> >> > Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/64c41950
> >> > 
> >> > Branch: refs/heads/master
> >> > Commit: 64c41950671b6b5472532cd2e34f28fff17c5fee
> >> > Parents: 3c7744a
> >> > Author: Hervé Boutemy <hb...@apache.org>
> >> > Authored: Sun Mar 23 19:58:26 2014 +0100
> >> > Committer: Hervé Boutemy <hb...@apache.org>
> >> > Committed: Sun Mar 23 19:58:26 2014 +0100
> >> > 
> >> > ----------------------------------------------------------------------
> >> > 
> >> >  .../maven/model/profile/activation/FileProfileActivator.java | 8
> >> > 
> >> > ++++++++
> >> > 
> >> >  1 file changed, 8 insertions(+)
> >> > 
> >> > ----------------------------------------------------------------------
> >> 
> >> http://git-wip-us.apache.org/repos/asf/maven/blob/64c41950/maven-model-bu
> >> i
> >> 
> >> lder/src/main/java/org/apache/maven/model/profile/activation/FileProfileA
> >> c
> >> 
> >> > tivator.java
> >> > ----------------------------------------------------------------------
> >> > diff --git
> >> 
> >> a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activa
> >> t
> >> 
> >> > ion/FileProfileActivator.java
> >> 
> >> b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activa
> >> 
> >> > tion/FileProfileActivator.java index 039c37b..ae20762 100644
> >> > ---
> >> 
> >> a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activa
> >> t
> >> 
> >> > ion/FileProfileActivator.java +++
> >> 
> >> b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activa
> >> t
> >> 
> >> > ion/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}" ) )
> >> >          {
> >> 
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: git commit: [MNG-5608] added a warning on ${project.basedir} use for profile activation

Posted by Robert Scholte <rf...@apache.org>.
In fact, a ModelValidator validates both the rawModel and effectiveModel[1]

regards,
Robert

[1]  
https://git-wip-us.apache.org/repos/asf?p=maven.git;a=blob;f=maven-model-builder/src/main/java/org/apache/maven/model/validation/ModelValidator.java;h=34bd97a5dc3d0a2d5f694d069ab80328d4adee1c;hb=HEAD1

Op Mon, 24 Mar 2014 00:20:06 +0100 schreef Hervé BOUTEMY  
<he...@free.fr>:

> I don't think so: DefaultModelValidator is the *effective model*  
> validator
> It contains validations that happen when everything is done: it's too  
> late for
> profile activation controls
>
> Regards,
>
> Hervé
>
> Le dimanche 23 mars 2014 20:29:42 Robert Scholte a écrit :
>> Hi Hervé,
>>
>> I think this should have been fixed in the
>> org.apache.maven.model.validation.DefaultModelValidator.
>> That's the location where all these kinds of validations are done.
>> A ProfileActivator has only one task: Determines whether the specified
>> profile is active in the given activator context.
>>
>> regards,
>> Robert
>>
>> Op Sun, 23 Mar 2014 19:58:28 +0100 schreef <hb...@apache.org>:
>> > Repository: maven
>> >
>> > Updated Branches:
>> >   refs/heads/master 3c7744a9a -> 64c419506
>> >
>> > [MNG-5608] added a warning on ${project.basedir} use for profile
>> > activation
>> >
>> > Project: http://git-wip-us.apache.org/repos/asf/maven/repo
>> > Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/64c41950
>> > Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/64c41950
>> > Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/64c41950
>> >
>> > Branch: refs/heads/master
>> > Commit: 64c41950671b6b5472532cd2e34f28fff17c5fee
>> > Parents: 3c7744a
>> > Author: Hervé Boutemy <hb...@apache.org>
>> > Authored: Sun Mar 23 19:58:26 2014 +0100
>> > Committer: Hervé Boutemy <hb...@apache.org>
>> > Committed: Sun Mar 23 19:58:26 2014 +0100
>> >
>> > ----------------------------------------------------------------------
>> >
>> >  .../maven/model/profile/activation/FileProfileActivator.java | 8
>> >
>> > ++++++++
>> >
>> >  1 file changed, 8 insertions(+)
>> >
>> > ----------------------------------------------------------------------
>> >
>> >
>> >  
>> http://git-wip-us.apache.org/repos/asf/maven/blob/64c41950/maven-model-bui
>> >  
>> lder/src/main/java/org/apache/maven/model/profile/activation/FileProfileAc
>> > tivator.java
>> > ----------------------------------------------------------------------
>> > diff --git
>> >  
>> a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activat
>> > ion/FileProfileActivator.java
>> >  
>> b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activa
>> > tion/FileProfileActivator.java index 039c37b..ae20762 100644
>> > ---
>> >  
>> a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activat
>> > ion/FileProfileActivator.java +++
>> >  
>> b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activat
>> > ion/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}" ) )
>> >          {
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: git commit: [MNG-5608] added a warning on ${project.basedir} use for profile activation

Posted by Hervé BOUTEMY <he...@free.fr>.
I don't think so: DefaultModelValidator is the *effective model* validator
It contains validations that happen when everything is done: it's too late for 
profile activation controls

Regards,

Hervé

Le dimanche 23 mars 2014 20:29:42 Robert Scholte a écrit :
> Hi Hervé,
> 
> I think this should have been fixed in the
> org.apache.maven.model.validation.DefaultModelValidator.
> That's the location where all these kinds of validations are done.
> A ProfileActivator has only one task: Determines whether the specified
> profile is active in the given activator context.
> 
> regards,
> Robert
> 
> Op Sun, 23 Mar 2014 19:58:28 +0100 schreef <hb...@apache.org>:
> > Repository: maven
> > 
> > Updated Branches:
> >   refs/heads/master 3c7744a9a -> 64c419506
> > 
> > [MNG-5608] added a warning on ${project.basedir} use for profile
> > activation
> > 
> > Project: http://git-wip-us.apache.org/repos/asf/maven/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/64c41950
> > Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/64c41950
> > Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/64c41950
> > 
> > Branch: refs/heads/master
> > Commit: 64c41950671b6b5472532cd2e34f28fff17c5fee
> > Parents: 3c7744a
> > Author: Hervé Boutemy <hb...@apache.org>
> > Authored: Sun Mar 23 19:58:26 2014 +0100
> > Committer: Hervé Boutemy <hb...@apache.org>
> > Committed: Sun Mar 23 19:58:26 2014 +0100
> > 
> > ----------------------------------------------------------------------
> > 
> >  .../maven/model/profile/activation/FileProfileActivator.java | 8
> > 
> > ++++++++
> > 
> >  1 file changed, 8 insertions(+)
> > 
> > ----------------------------------------------------------------------
> > 
> > 
> > http://git-wip-us.apache.org/repos/asf/maven/blob/64c41950/maven-model-bui
> > lder/src/main/java/org/apache/maven/model/profile/activation/FileProfileAc
> > tivator.java
> > ----------------------------------------------------------------------
> > diff --git
> > a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activat
> > ion/FileProfileActivator.java
> > b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activa
> > tion/FileProfileActivator.java index 039c37b..ae20762 100644
> > ---
> > a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activat
> > ion/FileProfileActivator.java +++
> > b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activat
> > ion/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}" ) )
> >          {
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: git commit: [MNG-5608] added a warning on ${project.basedir} use for profile activation

Posted by Robert Scholte <rf...@apache.org>.
Hi Hervé,

I think this should have been fixed in the  
org.apache.maven.model.validation.DefaultModelValidator.
That's the location where all these kinds of validations are done.
A ProfileActivator has only one task: Determines whether the specified  
profile is active in the given activator context.

regards,
Robert

Op Sun, 23 Mar 2014 19:58:28 +0100 schreef <hb...@apache.org>:

> Repository: maven
> Updated Branches:
>   refs/heads/master 3c7744a9a -> 64c419506
>
>
> [MNG-5608] added a warning on ${project.basedir} use for profile
> activation
>
> Project: http://git-wip-us.apache.org/repos/asf/maven/repo
> Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/64c41950
> Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/64c41950
> Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/64c41950
>
> Branch: refs/heads/master
> Commit: 64c41950671b6b5472532cd2e34f28fff17c5fee
> Parents: 3c7744a
> Author: Hervé Boutemy <hb...@apache.org>
> Authored: Sun Mar 23 19:58:26 2014 +0100
> Committer: Hervé Boutemy <hb...@apache.org>
> Committed: Sun Mar 23 19:58:26 2014 +0100
>
> ----------------------------------------------------------------------
>  .../maven/model/profile/activation/FileProfileActivator.java | 8  
> ++++++++
>  1 file changed, 8 insertions(+)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/64c41950/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
> ----------------------------------------------------------------------
> 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 039c37b..ae20762 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}" ) )
>          {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org