Maven
  1. Maven
  2. MNG-3690

inheriting properties doesn't work if name of property is too long

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.9
    • Fix Version/s: None
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      when i used a property that was 30 characters long, it wasn't propagated. when i shortened it to only be 20, it worked. i don't know what the limit is, but this was a very sly bug.

        Activity

        Hide
        Joseph Marques added a comment -

        i use "mvn help:effective-pom" to confirm that this property was NOT passed when it was 30 chars, and that things DID work when the length shrank to 20 chars.

        Show
        Joseph Marques added a comment - i use "mvn help:effective-pom" to confirm that this property was NOT passed when it was 30 chars, and that things DID work when the length shrank to 20 chars.
        Hide
        Joseph Marques added a comment -

        fyi, i'm referring to length of the property NAME not the property value.

        Show
        Joseph Marques added a comment - fyi, i'm referring to length of the property NAME not the property value.
        Hide
        Joseph Marques added a comment -

        hmm...investigating more into this it appears it might have to do with weird caching. if i just change the value of some property at some parent-parent pom.xml, the new value does not trickle down if i try to execute "mvn" from the child level. i need to path up to the ancestor, build "mvn -N install" from there, and then go back down to the child. this makes using properties set at parent levels rather clunky. i want to be able to change the property at a parent level, and have that take immediate effect if i execute from any child module. is there a way to enable this?

        Show
        Joseph Marques added a comment - hmm...investigating more into this it appears it might have to do with weird caching. if i just change the value of some property at some parent-parent pom.xml, the new value does not trickle down if i try to execute "mvn" from the child level. i need to path up to the ancestor, build "mvn -N install" from there, and then go back down to the child. this makes using properties set at parent levels rather clunky. i want to be able to change the property at a parent level, and have that take immediate effect if i execute from any child module. is there a way to enable this?
        Hide
        Benjamin Bentmann added a comment -

        i want to be able to change the property at a parent level, and have that take immediate effect if i execute from any child module. is there a way to enable this?

        In principal it should be possible: Maven tries to look up parent POMs from the local filesystem by following the module's <relativePath> element (of course, the version of the parent POM found at this location must match the version specified in the child or Maven continues the search in the repos).

        Can you provide a test project that demonstrates your issues?

        Show
        Benjamin Bentmann added a comment - i want to be able to change the property at a parent level, and have that take immediate effect if i execute from any child module. is there a way to enable this? In principal it should be possible: Maven tries to look up parent POMs from the local filesystem by following the module's <relativePath> element (of course, the version of the parent POM found at this location must match the version specified in the child or Maven continues the search in the repos). Can you provide a test project that demonstrates your issues?
        Hide
        Joseph Marques added a comment -

        sure, i'll see what i can pull together over the weekend. in the meantime, i'll tell you that I don't use the relativePath element explicitly in any of my poms, so it should default to "../pom.xml"

        from my testing, what i'm seeing happening is that it's someone reference an only version of the parent pom.xml. if i "mvn -N install" the parent, then the child will see the updated value.

        thanks in advance.

        Show
        Joseph Marques added a comment - sure, i'll see what i can pull together over the weekend. in the meantime, i'll tell you that I don't use the relativePath element explicitly in any of my poms, so it should default to "../pom.xml" from my testing, what i'm seeing happening is that it's someone reference an only version of the parent pom.xml. if i "mvn -N install" the parent, then the child will see the updated value. thanks in advance.
        Hide
        Joseph Marques added a comment -

        ok, i finally found some time to get back to this. when i tried to extract a minimalistic project hierarchy that reproduced this bug, i didn't encounter the bug anymore. so, in a relatively clean setup without many other things going on the poms, things work as intended and properties are cascaded down to the nested modules as long as the parent info is set properly. but there definitely is an issue in one of the projects i use maven for, so i'm going to continue investigating and will post back when i pinpoint what the issue is (and attached a project demonstrating it).

        Show
        Joseph Marques added a comment - ok, i finally found some time to get back to this. when i tried to extract a minimalistic project hierarchy that reproduced this bug, i didn't encounter the bug anymore. so, in a relatively clean setup without many other things going on the poms, things work as intended and properties are cascaded down to the nested modules as long as the parent info is set properly. but there definitely is an issue in one of the projects i use maven for, so i'm going to continue investigating and will post back when i pinpoint what the issue is (and attached a project demonstrating it).
        Hide
        Brett Porter added a comment -

        please reopen if you find a test project that reproduces it

        Show
        Brett Porter added a comment - please reopen if you find a test project that reproduces it

          People

          • Assignee:
            Brett Porter
            Reporter:
            Joseph Marques
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: