Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-417

Infinite loop when loading self-referencing properties

Agile BoardAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • maven-filtering-1.3
    • maven-filtering-3.2.0
    • maven-filtering
    • None
    • Maven 3.2.5. Maven-filtering-1.3.

    Description

      I've recently encountered a situation in which maven-resources-plugin would hang indefinitely when using resource filtering. I've managed to track it down to the loadPropertyFile and getPropertyValue methods in PropertyUtils.

      getPropertyValue appears to have some protection against a property referring to itself. So, the following properties file loads fine:

      test=${test}
      test2=${test2}
      

      With the value of the "test" property ending up as "${test}". However, if you load the following properties file:

      test=${test2}
      test2=${test2}
      

      then getPropertyValue seems to get stuck in a loop attempting to resolve the property.

      In our case, this was encountered as a result of a misconfiguration (our filters.properties is being generated based on a number of sources, and something was configured incorrectly). Causing the Maven process to hang indefinitely (while using 100% of a CPU core) isn't ideal behaviour.

      I have reproduced this in isolation by directly invoking PropertyUtils.loadPropertyFile(File, null) with the the above data as the input file.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            michael-o Michael Osipov
            pmilliken Paul Milliken
            Votes:
            0 Vote for this issue
            Watchers:
            6 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment