Maven Shared Components
  1. Maven Shared Components
  2. MSHARED-177

Filter files are not filtered with already known filter values

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: maven-filtering-1.0
    • Component/s: maven-filtering
    • Labels:
      None
    • Environment:
      all
    • Patch Submitted:
      Yes
    • Number of attachments :
      3

      Description

      While loading multiple Filter files the current file is filtered but the combined filter properties are not updated.

      The problem is related that the current filter properties are combined before they are filterd.
      The copmbined values are not updated after filtering...

      Attached is a patch that will also update the value in the combinedProperties

      1. DefaultMavenFileFilter.patch
        6 kB
        Daniel Mohni
      2. PropertyUtils.patch
        0.5 kB
        Daniel Mohni
      3. PropertyUtilsTest.patch
        1 kB
        Daniel Mohni

        Issue Links

          Activity

          Hide
          Olivier Lamy added a comment -

          Hello,
          I wonder if you have any unit tests for this issue (or a test project in resources plugin) ?

          Show
          Olivier Lamy added a comment - Hello, I wonder if you have any unit tests for this issue (or a test project in resources plugin) ?
          Hide
          Daniel Mohni added a comment -

          I will create a unit test for this issue when I am back from holiday, but this will have to wait until end of January when I get back to work...

          I faced the problem working on a customer site project, using the assembly-plugin version 2.2, we used multiple filter files to create environment specific configurations.

          Filter File A contains portions of a value of Filter File B, using the key of File B to replace a value in a resource file still contained the key of File A...

          Show
          Daniel Mohni added a comment - I will create a unit test for this issue when I am back from holiday, but this will have to wait until end of January when I get back to work... I faced the problem working on a customer site project, using the assembly-plugin version 2.2, we used multiple filter files to create environment specific configurations. Filter File A contains portions of a value of Filter File B, using the key of File B to replace a value in a resource file still contained the key of File A...
          Hide
          Olivier Lamy added a comment -

          ok sounds reasonnable use case.
          Don't miss to create an issue in MASSEMBLY too for upgrading the lib version.
          Thanks

          Show
          Olivier Lamy added a comment - ok sounds reasonnable use case. Don't miss to create an issue in MASSEMBLY too for upgrading the lib version. Thanks
          Hide
          Daniel Mohni added a comment - - edited

          Created UnitTest to check if already known filters are applied

          Show
          Daniel Mohni added a comment - - edited Created UnitTest to check if already known filters are applied
          Hide
          Olivier Lamy added a comment -

          Thanks Daniel.
          But I have applied only your patch for the unit test and it doesn't fail.
          I'd like to have a junit which failed without the other patch and successed with the it.
          To ensure the bug is fixed.

          Show
          Olivier Lamy added a comment - Thanks Daniel. But I have applied only your patch for the unit test and it doesn't fail. I'd like to have a junit which failed without the other patch and successed with the it. To ensure the bug is fixed.
          Hide
          Daniel Mohni added a comment -

          Unfortunatly this correct. As there is no acces to the combinedProperties this can not be verified.
          I think that the problem should be fixed somewhere else.
          Looking deeper thru the code I don't understand why my patch worked....
          I'l try to find a better patch

          Show
          Daniel Mohni added a comment - Unfortunatly this correct. As there is no acces to the combinedProperties this can not be verified. I think that the problem should be fixed somewhere else. Looking deeper thru the code I don't understand why my patch worked.... I'l try to find a better patch
          Hide
          Daniel Mohni added a comment -

          I created another patch that will fix the problem on the DefaultMavenFileFilter.
          The PropertyUtils Patches are obsolete and should not be used.
          I don't know how to delete the already attached files.

          TestCase with FilterFiles is included

          Show
          Daniel Mohni added a comment - I created another patch that will fix the problem on the DefaultMavenFileFilter. The PropertyUtils Patches are obsolete and should not be used. I don't know how to delete the already attached files. TestCase with FilterFiles is included
          Hide
          Olivier Lamy added a comment -

          fixed rev 1065840
          Thanks !

          Show
          Olivier Lamy added a comment - fixed rev 1065840 Thanks !

            People

            • Assignee:
              Olivier Lamy
              Reporter:
              Daniel Mohni
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: