[
https://jira.codehaus.org/browse/SUREFIRE-790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=283488#comment-283488
]
Karel Piwko commented on SUREFIRE-790:
--------------------------------------
I've created an implementation of this feature, you can check the code in pull
request https://github.com/apache/maven-surefire/pull/2.
How does it work?
{code:xml}
<configuration>
<propagateExecutionContext>true</propagateExecutionContext>
<!-- optional -->
<executionContextNamespace>maven.execution</executionContextNamespace>
</configuration>
{code}
This will make following system properties available in either
forked/non-forked tests
* maven.execution.pom - pom.xml file currently executed, e.g. actual pom file
(not the parent for multimodules)
* maven.execution.user-settings - path to user settings.xml (e.g. mvn -s)
* maven.execution.global-settings - path to global settings.xml (e.g. mvn -gs)
* maven.execution.activeProfiles - list of active profiles in the project
* maven.execution.offline - offline flag (e.g. mvn -o)
This extension uses reflection, the very same way as SUREFIRE-121 and requires
Maven 3.0.x to get MavenExecutionRequest object. If will log a failure.
Integration test is included.
As this is disabled by default, I'm convinced that the clean constraint is not
violated.
> Allow forked process to access the Maven session of parent
> ----------------------------------------------------------
>
> Key: SUREFIRE-790
> URL: https://jira.codehaus.org/browse/SUREFIRE-790
> Project: Maven Surefire
> Issue Type: New Feature
> Components: process forking
> Affects Versions: 2.10
> Reporter: Karel Piwko
>
> Forked process should be able to get information from a "parent process",
> which is a Maven build execution.
> This will allow the test to access information like which pom.xml file being
> processed, settings.xml and Maven Reactor plugin.
> This feature is needed to any test which want to interfere with Maven
> repositories with Aether, for instance.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira