You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@codehaus.org> on 2014/01/09 23:56:45 UTC

[jira] (MNG-5411) Missing file activation only works with hard coded vales

     [ https://jira.codehaus.org/browse/MNG-5411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte updated MNG-5411:
--------------------------------

    Description: 

{code:xml}
<activation><file><missing>...</missing></file></activation>
{code}

Only works when the file name is hard coded between the missing tags to activate a profile.  If instead the file name is listed as a property (or properties) the profile is always active.

e.g.
{code:xml}
...
<properties>
  <exampleFile>example.txt</exampleFile>
  <exampleDirectory>${project.build.directory}/example.txt</sourceDirectory>
</properties>
...
<profiles>
  <profile>
    <activation>
      <file><missing>${exampleDirectory}/${exampleFile}</missing></file>
    </activation>
    ...
  </profile>
  ...
</profiles>
...
{code}

The profile here will be active regardless if the wsdlFile exists.   However, if instead one hard codes the value like so:
{code:xml}  <file><missing>target/example.txt</missing></file> {code}
then the profile is only active when example.txt does not exist.

I'm guessing this is a chicken and egg problem.  The properties section is probably not evaluated until after deciding what profiles should be active.  In which case, the code itself is working as designed, it is just either that design needs to be documented or updated to work the way one would expect.


  was:
<activation><file><missing>...</missing></file></activation>

Only works when the file name is hard coded between the missing tags to activate a profile.  If instead the file name is listed as a property (or properties) the profile is always active.

e.g.

...
<properties>
  <exampleFile>example.txt</exampleFile>
  <exampleDirectory>${project.build.directory}/example.txt</sourceDirectory>
</properties>
...
<profiles>
  <profile>
    <activation>
      <file><missing>${exampleDirectory}/${exampleFile}</missing></file>
    </activation>
    ...
  </profile>
  ...
</profiles>
...

The profile here will be active regardless if the wsdlFile exists.   However, if instead one hard codes the value like so:
  <file><missing>target/example.txt</missing></file>
then the profile is only active when example.txt does not exist.

I'm guessing this is a chicken and egg problem.  The properties section is probably not evaluated until after deciding what profiles should be active.  In which case, the code itself is working as designed, it is just either that design needs to be documented or updated to work the way one would expect.


    
> Missing file activation only works with hard coded vales
> --------------------------------------------------------
>
>                 Key: MNG-5411
>                 URL: https://jira.codehaus.org/browse/MNG-5411
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: POM
>    Affects Versions: 3.0.4
>         Environment: Fedora 17 x86_64, Java 1.7.0_09-icedtea
>            Reporter: Bill Riemers
>            Priority: Minor
>
> {code:xml}
> <activation><file><missing>...</missing></file></activation>
> {code}
> Only works when the file name is hard coded between the missing tags to activate a profile.  If instead the file name is listed as a property (or properties) the profile is always active.
> e.g.
> {code:xml}
> ...
> <properties>
>   <exampleFile>example.txt</exampleFile>
>   <exampleDirectory>${project.build.directory}/example.txt</sourceDirectory>
> </properties>
> ...
> <profiles>
>   <profile>
>     <activation>
>       <file><missing>${exampleDirectory}/${exampleFile}</missing></file>
>     </activation>
>     ...
>   </profile>
>   ...
> </profiles>
> ...
> {code}
> The profile here will be active regardless if the wsdlFile exists.   However, if instead one hard codes the value like so:
> {code:xml}  <file><missing>target/example.txt</missing></file> {code}
> then the profile is only active when example.txt does not exist.
> I'm guessing this is a chicken and egg problem.  The properties section is probably not evaluated until after deciding what profiles should be active.  In which case, the code itself is working as designed, it is just either that design needs to be documented or updated to work the way one would expect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira