Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any existing mode/switch that will resolve/replace a property (not a ${var}) #259

Open
jeacott1 opened this issue Mar 4, 2022 · 0 comments

Comments

@jeacott1
Copy link

jeacott1 commented Mar 4, 2022

Following is an example of the tiresome double handling of maven properties that is required if a property is to be effectively flattened including parameter values passed in from the cmd line. eg

mvn install -Dbuild.num=66 ...

if I have a pom with some default property set:

    <properties>
        <build.num>SNAPSHOT</build.num>
        <internal.build.num>${build.num}</internal.build.num>
        <other.things>use-${internal.build.num}</other.things>
    </properties>

   the rest of the maven config uses ${internal.build.num}

after flatten this would become

    <properties>
        <build.num>SNAPSHOT</build.num>
        <internal.build.num>66</internal.build.num>
       <other.things>use-66</other.things>
    </properties>

I'd like to know if there is any option to forego this dance and simply have the flatten-maven-plugin also replace the affected property directly?
ie:

    <properties>
        <build.num>SNAPSHOT</build.num>
        <other.things>use-${build.num}</other.things>
    </properties>

   the rest of the maven config uses ${build.num}

after flatten this would become

    <properties>
        <build.num>66</build.num>
        <other.things>use-66</other.things>
    </properties>

this would be so much simpler to deal with and would eliminate the care required and the tedious duplication of properties just to effectively flatten them.

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant