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

Preserve existing properties (like Ant does) #21

Closed
borisbrodski opened this issue Jan 29, 2016 · 6 comments · Fixed by #103
Closed

Preserve existing properties (like Ant does) #21

borisbrodski opened this issue Jan 29, 2016 · 6 comments · Fixed by #103
Milestone

Comments

@borisbrodski
Copy link
Contributor

I need an option to preserve existing properties from being overwritten.
This will match the Ant behavior, where you can define each property only once.

Since I need this behavior anyway I will implement it myself.
If you find this useful I will be happy to contribute.

borisbrodski added a commit to borisbrodski/properties-maven-plugin that referenced this issue Jan 29, 2016
@khmarbaise
Copy link
Member

Do you have a use case for this wished behaviour ?

@borisbrodski
Copy link
Contributor Author

Yes, of cause.

In my project I have a number of property files, that are currently used by Ant. Those property files get loaded in a defined order: first files from user directory, than shared files from git repositories.

This allows users to change any property value from the shared property files (from git repositories) by defining those properties first in the user property files. (Ones defined, the property value stays the same)

Now in Maven, I would like to just load all property files simulating the Ant behavior. This is not possible without such feature, that I propose here.

@khmarbaise
Copy link
Member

Can you tell what kind of information those properties contain?

@borisbrodski
Copy link
Contributor Author

Sure:

  • Options controlling some build steps:
    • like code coverage configuration (On/Off, Packages to instrument)
    • usage of different compilers (Eclipse Compiler / JDK compiler)
  • URLs/Credentials to different application servers. Used for IT-tests, remote configuration, load tests.
  • JDBC connections to different databases
  • Paths to some tools, like Unlocker.exe on Windows
    (needed to remove files, that are used by other programs, like Eclipse)

The default configuration is commited to the Git repository. But any developer can change any property value by putting it into his local property file. Ant loads local files first, than files from Git repository.

So my goal is just to simulate Ant behavior on Maven. This will allow me to use the same property files with both Ant and Maven.

@themarquee
Copy link

I'd find an override option useful as well. We've developed a tool (really an orchestration of several existing Maven plugins) and are loading several "default" properties into the pom using this plugin to cut down on the number of properties required for each project to define. If the project overrides the default, we'd like to keep that existing property, if they don't define it, then we'd like to load the default value from a file in a utility jar.

@BhuvaneshMani
Copy link

Has this change merged and available for use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment