hcoles / pitest

State of the art mutation testing system for the JVM
Apache License 2.0
1.7k stars 357 forks source link

Maven variables ${settings.*} not expanded #1333

Open martinoconnor opened 4 months ago

martinoconnor commented 4 months ago

https://github.com/hcoles/pitest/blob/dd84e8bad21e410b91c83674243079832935bc03/pitest-maven/src/main/java/org/pitest/maven/MojoToReportOptionsConverter.java#L490

When setting up JMockit as referenced here https://jmockit.github.io/tutorial/Introduction.html#maven

<plugins>
   <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.22.2</version> <!-- or some other version -->
      <configuration>
         <argLine>
            -javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
         </argLine>
      </configuration>
   </plugin>
</plugins>

The reference to ${settings.localrepository} is not expanded and the minion fails to find the JMockit jar

One solution might be to inject the Settings parameter into the Mojo and search for references for each of the properties. Not as elegant as iterating through properties but perhaps we only need the localRepository property anyway

hcoles commented 4 months ago

Thanks for the PR. I'll be able to look at this in a couple of weeks.