-
Notifications
You must be signed in to change notification settings - Fork 87
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
pom.xml doesn't read my properties #26
Comments
This does not work nor is it the intention of properties maven plugin and furthermore what would be the advantage to read properties from a file to define versions of dependencies? |
So this plugin doesn't replace entirely the |
It does not replace the |
Don't agree at all: properties should properties indeed dependent of their representation and not some what maybe properties under some trivial circumstances. So basically this should be build into Maven. |
@khmarbaise you want to share these versions between maven and and one other build system and you want to centralize the information at one place. And obviously, in the middle of a big XML file, it is not the best interoperable way to do it. |
@AlexGreg AlexGreg i am also facing the same problem. Could you please share the solution. |
@shilpa1989 the only reliable way I found is to have a "pom-template.xml" and the other build system create "pom.xml" from it. It's terrible, but any attempt of parametrizing version in pom lead to subtle and non immediate breaking in plugins. |
A template is good for project creation, not for the whole lifecycle. |
Usecase in git(flow) for the feature suggested in this issue: Possible fix is to set It would be really convenient if we could specify the relevant dependency-versions in an isolated property-file and only do the Any workarounds for isolating dependency-versions outside pom.xml? |
This kind of use case is useful for user acceptance ( selenium ) testing in my opinion. A separate pom drags a dependency from a repository to test it - the actual release / snapshot number is important for deciding on how to recreate the db using incremental release sql. Being able to load properties for a given environment and specify version numbers of dependencies can help in automated user acceptance testing (Selenium). |
What is the point of the properties maven plugin? How do we read properties from it? I can understand that it does not make sense to inject properties into the version tag - but what about injecting properties else where in the pom.xml file ? |
The plugin's own landing page defines the use case of reading properties from a file:
And in the read-project-properties goal page it states:
So with verbiage like
It's fair to assume it can be used the in the same ways pom properties are afforded since it's an alternate to a pom property What would be the advantage of not allowing this? Just because it wasn't the 'intention' doesn't mean things can't evolve? Clearly the community at large has a unified assumption that this would be possible due to the documentation verbiage and goal descriptors. I would recommend to either update the documentation to support what this is intended for more concisely or just give the people what they want? |
For this particular use-case (defining dependency versions), it might not be possible with a plugin at all, since it seems that Maven resolves the dependencies before executing any plugin (even the This may also be of interest: https://stackoverflow.com/questions/28565091/how-to-get-a-maven-plugin-to-run-before-dependency-resolution |
Hello
my pom file is the following:
and inside the my.properties file, located at the same level as the pom, only
log4j.version=2.5
.Now, when I do a
mvn install
I get'dependencies.dependency.version' for org.apache.logging.log4j:log4j:jar must be a valid version but is '${log4j.version}'. @ line 37, column 18
The text was updated successfully, but these errors were encountered: