[
https://issues.apache.org/jira/browse/MNG-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15141363#comment-15141363
]
Karl Heinz Marbaise commented on MNG-5973:
------------------------------------------
Why do you use such internals? Why not using in such cases the information of
Jenkins like {{WORKSPACE}} which references the root of your workspace which
would fulfil the same (sounds a little bit wrong for me)...Furthermore you can
check existence of properties via
[maven-enforcer-plugin|http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html].
Apart from that as far as i know you can define jacoco to create a report file
{{*.exec}} in each module which can be merged in the end.....and finally
created a report from it...
[~michael-o] That will not work, cause things like JVM parameters
{{$\{maven.projectBasedir}/.mvn/jvm.config}} will be located there as well
which are needed before Maven has started. So the logic is needed anyway.
> maven.multiModuleProjectDirectory is not set
> --------------------------------------------
>
> Key: MNG-5973
> URL: https://issues.apache.org/jira/browse/MNG-5973
> Project: Maven
> Issue Type: Bug
> Components: Bootstrap & Build
> Affects Versions: 3.3.9
> Reporter: Harald Wellmann
>
> h3. Scenario
> I'm using $\{maven.multiModuleProjectDirectory\} as part of a property
> definition in my POM:
> {noformat}
> <properties>
>
> <sonar.jacoco.reportPath>$\{maven.multiModuleProjectDirectory\}/target/jacoco.exec</sonar.jacoco.reportPath>
> </properties>
> {noformat}
> (Please ignore the backslashes - I can't find out how to properly escape the
> braces for JIRA.)
> This works fine when running Maven from the command line, but when building
> the same project on Jenkins, the variable is not set, there is no error
> message, and my build creates a directory called
> {{/path/to/workspace/$\{maven.multiModuleProjectDirectory\}/target}}.
> h3. Analysis
> It seems the property {{maven.multiModuleProjectDirectory}} is set in the
> {{bin/mvn}} shell script and not within the Java application. Since Jenkins
> does not use the shell script but has a special way of embedding Maven, this
> explains the effect.
> Is there a way to let the Maven Java application compute the property instead
> of having it passed in? If not, can Maven check that the variable is set and
> fail fast otherwise?
> At the very least, this special behaviour of
> {{maven.multiModuleProjectDirectory}} should be documented somewhere - up to
> now, I haven't found any user-visible reference to this property except a
> line in the release notes at the time it was introduced.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)