project.basedir in file-based profile activation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

project.basedir in file-based profile activation

Justin Georgeson
With 3.3.9 and 3.5.0 When I use this

  <profiles>
    <profile>
      <id>my-profile-id</id>
      <activation>
        <file>
          <exists>${project.basedir}${file.separator}somefile.txt</exists>
        </file>
      </activation>
      ....
    </profile>
  </profiles>

I see this warning

[WARNING] Some problems were encountered while building the effective model for com.example:basedir:jar:1.0-SNAPSHOT
[WARNING] 'profiles.profile[my-profile-id].activation.file.exists' Failed to interpolate file location ${project.basedir}${file.separator}somefile.txt for profile jacoco-read-manifest: ${project.basedir} expression not supported during profile activation, use ${basedir} instead

I was under the impression that ${basedir} is deprecated in favor of ${project.basedir}, many years ago at that.

Side note, is it actually worthwhile to use ${file.separator} like this, or is that generally only useful when you're outputting stuff to the user and want it to look pretty?

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: project.basedir in file-based profile activation

Jörg Schaible-5
Justin Georgeson wrote:

> With 3.3.9 and 3.5.0 When I use this
>
>   <profiles>
>     <profile>
>       <id>my-profile-id</id>
>       <activation>
>         <file>
>           <exists>${project.basedir}${file.separator}somefile.txt</exists>
>         </file>
>       </activation>
>       ....
>     </profile>
>   </profiles>
>
> I see this warning
>
> [WARNING] Some problems were encountered while building the effective
> [model for com.example:basedir:jar:1.0-SNAPSHOT WARNING]
> ['profiles.profile[my-profile-id].activation.file.exists' Failed to
> [interpolate file location ${project.basedir}${file.separator}somefile.txt
> [for profile jacoco-read-manifest: ${project.basedir} expression not
> [supported during profile activation, use ${basedir} instead
>
> I was under the impression that ${basedir} is deprecated in favor of
> ${project.basedir}, many years ago at that.

That won't help, because string substitution did not happen yet at the time
profiles are activated. There's only a special support for ${user.home} and
${env.HOME}, but that's it. Anything else cannot not work.

> Side note, is it actually worthwhile to use ${file.separator} like this,
> or is that generally only useful when you're outputting stuff to the user
> and want it to look pretty?

Use normal slashes.

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [EXTERNAL] Re: project.basedir in file-based profile activation

Justin Georgeson


> -----Original Message-----
> From: Jörg Schaible [mailto:[hidden email]]
> Sent: Friday, June 23, 2017 1:03 AM
> To: [hidden email]
> Subject: [EXTERNAL] Re: project.basedir in file-based profile activation
>
> External Sender: Use caution with links/attachments.
>
>
>
> Justin Georgeson wrote:
>
> > With 3.3.9 and 3.5.0 When I use this
> >
> >   <profiles>
> >     <profile>
> >       <id>my-profile-id</id>
> >       <activation>
> >         <file>
> >           <exists>${project.basedir}${file.separator}somefile.txt</exists>
> >         </file>
> >       </activation>
> >       ....
> >     </profile>
> >   </profiles>
> >
> > I see this warning
> >
> > [WARNING] Some problems were encountered while building the effective
> > [model for com.example:basedir:jar:1.0-SNAPSHOT WARNING]
> > ['profiles.profile[my-profile-id].activation.file.exists' Failed to
> > [interpolate file location
> > ${project.basedir}${file.separator}somefile.txt
> > [for profile jacoco-read-manifest: ${project.basedir} expression not
> > [supported during profile activation, use ${basedir} instead
> >
> > I was under the impression that ${basedir} is deprecated in favor of
> > ${project.basedir}, many years ago at that.
>
> That won't help, because string substitution did not happen yet at the time
> profiles are activated. There's only a special support for ${user.home} and
> ${env.HOME}, but that's it. Anything else cannot not work.

So it's a bad message in that the problem is having used a property at all, rather than having used that specific property?

> > Side note, is it actually worthwhile to use ${file.separator} like
> > this, or is that generally only useful when you're outputting stuff to
> > the user and want it to look pretty?
>
> Use normal slashes.
>
> Cheers,
> Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [EXTERNAL] Re: project.basedir in file-based profile activation

Pascal
If I recall correctly, in this specific place you are still supposed to use
${basedir} instead of project.basedir

Am 23.06.2017 3:02 nachm. schrieb "Justin Georgeson" <[hidden email]>:



> -----Original Message-----
> From: Jörg Schaible [mailto:[hidden email]]
> Sent: Friday, June 23, 2017 1:03 AM
> To: [hidden email]
> Subject: [EXTERNAL] Re: project.basedir in file-based profile activation
>
> External Sender: Use caution with links/attachments.
>
>
>
> Justin Georgeson wrote:
>
> > With 3.3.9 and 3.5.0 When I use this
> >
> >   <profiles>
> >     <profile>
> >       <id>my-profile-id</id>
> >       <activation>
> >         <file>
> >           <exists>${project.basedir}${file.separator}somefile.txt</
exists>

> >         </file>
> >       </activation>
> >       ....
> >     </profile>
> >   </profiles>
> >
> > I see this warning
> >
> > [WARNING] Some problems were encountered while building the effective
> > [model for com.example:basedir:jar:1.0-SNAPSHOT WARNING]
> > ['profiles.profile[my-profile-id].activation.file.exists' Failed to
> > [interpolate file location
> > ${project.basedir}${file.separator}somefile.txt
> > [for profile jacoco-read-manifest: ${project.basedir} expression not
> > [supported during profile activation, use ${basedir} instead
> >
> > I was under the impression that ${basedir} is deprecated in favor of
> > ${project.basedir}, many years ago at that.
>
> That won't help, because string substitution did not happen yet at the
time
> profiles are activated. There's only a special support for ${user.home}
and
> ${env.HOME}, but that's it. Anything else cannot not work.

So it's a bad message in that the problem is having used a property at all,
rather than having used that specific property?

> > Side note, is it actually worthwhile to use ${file.separator} like
> > this, or is that generally only useful when you're outputting stuff to
> > the user and want it to look pretty?
>
> Use normal slashes.
>
> Cheers,
> Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and
privileged information for the sole use of the intended recipient.  Any
review, use, distribution, or disclosure by others is strictly prohibited.
If you are not the intended recipient (or authorized to receive information
for the intended recipient), please contact the sender by reply e-mail and
delete all copies of this message.
Loading...