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

  • Home
  • SEARCH
  • 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 8316069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:16:28+00:00 2026-06-08T21:16:28+00:00

I am developing a project which uses versioning: version name is typed in POM

  • 0

I am developing a project which uses versioning:

  1. version name is typed in POM file

  2. It is also used as a part of to-be-created .msi file name : file_[version].msi

  3. It is used in a service name, after this project is installed from .msi
    Those params are kept in locations as follows:

    a).properties file as a Spring param: version=0340

    b)in pom.xml <package-version>0340</package-version>

    c)as a <filename><version>.wxs file, used by build.xml

    d) also in the abovementioned .wxs file as a MsiProductVersion = "3.4.0" (notice the dots)

Is there a way to define a parameter in some other config file, that would populate those files with proper data, as to keep the version in one place only. Now it is easy to overlook one param, and build a 340.msi which will display 330 Service as its name. I find it difficult since not all files belong to one model (like Spring).

  • 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-06-08T21:16:29+00:00Added an answer on June 8, 2026 at 9:16 pm

    You can configure Maven to replace “variables” in resources. Add this to your POM:

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        ...
    </build>
    

    Now you can use ${project.version} and it will be replaced with the version from the POM in all files below src/main/resources and src/test/resources.

    As for the other files, you can either use an embedded Ant task in your POM or write a small script (Ant, bash, whatever you like) that reads the POM and creates the other three files from templates.

    Another option is to write a unit tests which reads all files and makes sure that they contains the correct values. That way, the version won’t be updated automatically but a) the version doesn’t change that often (which probably causes your problem) and b) the tests are much more powerful than what you can do in a script (they can, for example, read&update binary files).

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

Sidebar

Related Questions

I take part in developing a Java project, which uses some C++ components, thus
I'm currently developing on a project which uses some TimerJobs. One of the jobs
I am in the middle of developing a project, which uses ASP.NET/C#. I am
I am developing a maven plugin, which uses a third party jar file ,
I'm developing a Windows Phone 7 project which uses a local SQLite database. The
I am developing a project which works with multiple arithmetic types. So I made
I am going to be developing a large project which will include a large
I am developing an android project in which I have to load from group
I am developing an android app in which I have included a library project,
I am developing a simple class library project, which will give me a dll.

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.