You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Bill Riemers (JIRA)" <ji...@codehaus.org> on 2012/12/18 15:18:13 UTC

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

Bill Riemers created MNG-5411:
---------------------------------

             Summary: 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


<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.


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

        

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

Posted by "Bill Riemers (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MNG-5411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=315869#comment-315869 ] 

Bill Riemers commented on MNG-5411:
-----------------------------------

Looks like from MNG-3524 this is actually a known issue.   How about changing the category of this report to documentation, rather than closing it.   As it is clear the restrictions in this activation method are obvious from the documentation.  Once one knows the restrictions it is only a minor issue.
                
> 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
>
> <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.

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