Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6096293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:54:38+00:00 2026-05-23T12:54:38+00:00

I am using resource filtering to replace some ${values} in a property file. e.g.

  • 0

I am using resource filtering to replace some ${values} in a property file.

e.g. the file contains
PROPERTY=${VALUE}

I want ${VALUE} to be replaced with environment variable $VALUE which works well if $VALUE is set when the build runs. Awesome.

However, these env vars are only set in our official build environment (by Jenkins) and not in developer builds so the ${values} are left in the property file after filtering which can break stuff. I’d rather not require env vars in developer environments as that always leads to fragile dev builds and whiny devs.

How can I use the environment variable value if its set and use another default property value if the env var isn’t set?

From my testing it works the other way around by default, in that properties set in the pom will override environment variables for the purpose of resource filtering.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:54:39+00:00Added an answer on May 23, 2026 at 12:54 pm

    I’m using the profile for determining as

    <profiles>
      <profile>
        <activation>
          <activeByDefault>true</activeByDefault>
          <property>
            <name>!myproperty</name>
          </property>
        </activation>
        ...
        <properties>
           <myproperty>some value</myproperty>
        </properties>
      </profile>
      ...
    </profiles>
    

    Please note

    1. The activeByDefault is set to true with purpose to enable it by default.
    2. The !myproperty means this property is missing or not existed.
    3. If the myproperty is not existed, just use the myproperty defined at the properties instead.

    You may see further information at http://maven.apache.org/guides/introduction/introduction-to-profiles.html

    I hope this may help to achieve your requirement.

    Regards,

    Charlee Ch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While working a project tonight, I ended up using one .js resource file for
I've having problems with resource filtering using m2eclipse Maven support in Eclipse. It seems
Short story I've got a PHP script filtering incoming mail using a .qmail file.
I'm having some trouble using resource files. In my project I'm using a bunch
I am creating one application in which I am using resource files to keep
I am using Resource file(.Resx format) to store configuration settings for a WP7 application.
Greetings all, I'm trying to localize a .NET/C# project. I'm using string resource files
Using a restful resource in Rails, I would like to be able to insert
I using the Rails resource_controller plugin. I have a ReleasesController, which is nested within
Does anyone know a good online resource about using SQL Server 2005 dependency cache

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.