Open marioja opened 7 years ago
Same issue here :-( Did you find a solution for this? @marioja
It has been so long and I do not recall but I think no solution was found
I would try Maven 3.6.0 to see if it works.
I am facing the same issue in Maven 3.6.0, any updates?
Still no solution for this? It's clearly a use-case many developers face.
I have the same issue.
Trying to define a path in a properties file: myDir=my/cool/directory
Cannot use this property in pom.xml
<testResource>
<directory>${project.basedir}/${myDir}</directory>
</testResource>
It works if I specifying the custom property in <properties>
tag of the pom.xml. But I need it in a separate file.
I have the same issue.
Trying to define a path in a properties file:
myDir=my/cool/directory
Cannot use this property in pom.xml<testResource> <directory>${project.basedir}/${myDir}</directory> </testResource>
It works if I specifying the custom property in
<properties>
tag of the pom.xml. But I need it in a separate file.
Did anyone resolve this - what is the point of the properties maven plugin if you cannot read properties from it? - I think am missing something.
@marioja @tuxedo0801 @javaspeak @GuptaMegha @flocsy @achimmihca
Guys, that plugin is not goin to solve this problem. The problem is that the DOM of POM is parsed before any build. So when this plugins of yours are parsed, at this time. there is no such property defined as you specified in the <goal>
tag, so maven just thinks ${SCM.goal}
is the name. The same stuff would happen with dependencies versions for example.
To solve this problem you can provide properties to maven via command line, like -DSCM.goal
in your case. Then the maven will parse POM, and SCM.goal
or whatever property you want will be already defined before build, so you will have ${SCM.goal} value substituted.
@marioja Please, close this issue. It is not the plugin fault. I will raise the issue about post-POM-parsing variables interpolation in Maven Jira.
@Mikhail2048 did you create issue in Maven jira? Can you share issue number?
@slawekjaranowski Yep, I have already submitted the Jira ticket. here it is.
I added #115 - please look.
I have the following pom file:
When I run it I get this output:
If I uncomment the SCM.goals property definition in the POM file, all runs fine. I remember reading somewhere about properties contributed by the properties maven plugin can only be used in configuration (although it seems to work in my executions). Can someone explain why this is the case and whether there is a way to make this work?