Ability to reference the test directory in the pom.xml under test? #193
-
Given a background info What I'm trying to do is have the Here's a specific example of what I mean: https://github.com/openrewrite/rewrite-maven-plugin/blob/0b51dc8b0da87b4652f2b605c4e09e14e69afe51/src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/pom.xml#L27-L29 I'd like the If I have the Currently I'm partially referencing the full path using Is there any way to do this? Thanks in advance for any guidance, I appreciate the time. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
So I started to investigate the problem. The problem with An alternative solution to find configurations for builds is either via classpath (usually via a dependency separate module within the reactor like maven-checkstyle-plugin is doing it or versions-maven-plugin or via external resource URI ). My recommendation is not to use I've taken a look into the code why it's needed. To find the @Parameter(defaultValue = "${session}", readonly = true, required = true)
protected MavenSession session;
....
MavenProject mavenProject = session.getProjectDependencyGraph().getSortedProjects().get(0); This would give you the mavenProject at the top level...within the reactor. Apart from that I will take a deeper look into that see if I could find a different (maybe better solution) for the problem. see #194 What me currently puzzles is that |
Beta Was this translation helpful? Give feedback.
So I started to investigate the problem.
The problem with
maven.multiModuleProjectDirectory
is that it is interpolated of themvn.cmd
ormvn
script and could be wrong in some situations. In exactly the situation happens within the integration tests because you have a project in the directorymaven-it/org/openwrite/maven/RewriteDryRun/multi_module_project
. Themvn
process will be started with that directory and themvn
script tries to find the root which results in finding it on the levelrewrite-maven-plugin
(root level) because there.mvn
has been found. That's the reason why you had to use${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/…