{"action":"created","issue":{"url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/issues/3","labels_url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/issues/3/comments","events_url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/issues/3/events","html_url":"https://github.com/mojohaus/flatten-maven-plugin/issues/3","id":94333068,"number":3,"title":"Variable substitution during install phase does not consider environment variable","user":{"login":"wykapedia","id":8344360,"avatar_url":"https://avatars.githubusercontent.com/u/8344360?v=3","gravatar_id":"","url":"https://api.github.com/users/wykapedia","html_url":"https://github.com/wykapedia","followers_url":"https://api.github.com/users/wykapedia/followers","following_url":"https://api.github.com/users/wykapedia/following{/other_user}","gists_url":"https://api.github.com/users/wykapedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wykapedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wykapedia/subscriptions","organizations_url":"https://api.github.com/users/wykapedia/orgs","repos_url":"https://api.github.com/users/wykapedia/repos","events_url":"https://api.github.com/users/wykapedia/events{/privacy}","received_events_url":"https://api.github.com/users/wykapedia/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/milestones/1","html_url":"https://github.com/mojohaus/flatten-maven-plugin/milestones/release:1.0.0","labels_url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/milestones/1/labels","id":1301105,"number":1,"title":"release:1.0.0","description":"","creator":{"login":"hohwille","id":1923119,"avatar_url":"https://avatars.githubusercontent.com/u/1923119?v=3","gravatar_id":"","url":"https://api.github.com/users/hohwille","html_url":"https://github.com/hohwille","followers_url":"https://api.github.com/users/hohwille/followers","following_url":"https://api.github.com/users/hohwille/following{/other_user}","gists_url":"https://api.github.com/users/hohwille/gists{/gist_id}","starred_url":"https://api.github.com/users/hohwille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hohwille/subscriptions","organizations_url":"https://api.github.com/users/hohwille/orgs","repos_url":"https://api.github.com/users/hohwille/repos","events_url":"https://api.github.com/users/hohwille/events{/privacy}","received_events_url":"https://api.github.com/users/hohwille/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":6,"state":"open","created_at":"2015-09-11T13:37:45Z","updated_at":"2015-11-27T19:02:12Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-07-10T15:46:51Z","updated_at":"2015-11-27T23:07:48Z","closed_at":null,"body":"Consider the command: `mvn clean flatten:flatten install -Dbuild.version=1.0.0-RELEASE`\r\n\r\nThe parent pom.xml file has a section with dynamic version based on environment variable:\r\n```xml\r\n    <version>${build.version}</version>\r\n    <properties>\r\n       <build.version>0.1-SNAPSHOT</build.version>\r\n    </properties>\r\n```\r\nWhen running flatten, the `${build.version}` is not replaced with the environment variable, but instead replaced with the value of the fallback property `<build.version>` declared in the parent pom.  The versions of the child poms now show `<version>0.1-SNAPSHOT</version>`"},"comment":{"url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/issues/comments/160225078","html_url":"https://github.com/mojohaus/flatten-maven-plugin/issues/3#issuecomment-160225078","issue_url":"https://api.github.com/repos/mojohaus/flatten-maven-plugin/issues/3","id":160225078,"user":{"login":"hohwille","id":1923119,"avatar_url":"https://avatars.githubusercontent.com/u/1923119?v=3","gravatar_id":"","url":"https://api.github.com/users/hohwille","html_url":"https://github.com/hohwille","followers_url":"https://api.github.com/users/hohwille/followers","following_url":"https://api.github.com/users/hohwille/following{/other_user}","gists_url":"https://api.github.com/users/hohwille/gists{/gist_id}","starred_url":"https://api.github.com/users/hohwille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hohwille/subscriptions","organizations_url":"https://api.github.com/users/hohwille/orgs","repos_url":"https://api.github.com/users/hohwille/repos","events_url":"https://api.github.com/users/hohwille/events{/privacy}","received_events_url":"https://api.github.com/users/hohwille/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T23:07:48Z","updated_at":"2015-11-27T23:07:48Z","body":"I added a JUnit as well so I can debug easily into mavens internals.\r\nThe problems is in ```StringSearchModelInterpolator``` or more precisely in its ```StringSearchInterpolator```. It has a list of ```valueSources```. When I debug my test this list has 8 elements. Three of them (4,5,6) are ```MapBasedValueSource```. Number 4 is empty, number 5 seems to contain the properties from the POM and number 6 contains the system properties.\r\nAs properties re interpolated and resolved in the order of these value sources the POM property is overriding the system property. So in other words the order of 5 and 6 is reversed and incorrect.\r\nI have no clue why and how to resolve this. Parts of this code seem to have some history...."}}