HannesWell commented on code in PR #148:
URL:
https://github.com/apache/maven-toolchains-plugin/pull/148#discussion_r3206825883
##########
pom.xml:
##########
@@ -146,4 +146,34 @@ under the License.
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>run-its</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>3.6.1</version>
+ <executions>
+ <execution>
+ <id>sanitize-java-home</id>
+ <goals>
+ <goal>regex-property</goal>
+ </goals>
+ <!-- Prevent it-test failures on Windows due to interpretation
of back-slashes in paths.-->
Review Comment:
This fails the execution on Windows because the back-slashes used on Windows
are interpreted as escape characters when the properties file of the
invoker-plugin is read.
E.g. a value of
```
invoker.environmentVariables.JAVA_X_HOME = C:\abc\def\ghi
```
(Probably) similar to "C:\abc\def\ghi" being an invalid string literal in
Java such value is not properly read from that properties file, which leads to
a `JAVA_X_HOME` env variable with null value and subsequently fails the
ToolchainDiscoverer execution.
##########
src/it/select-jdk-env-multi/invoker.properties:
##########
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals = compile
+invoker.environmentVariables.JAVA_X_HOME = ${java.home.sanitized}
+invoker.environmentVariables.JAVA_Y_HOME = ${java.home.sanitized}
Review Comment:
See
https://github.com/apache/maven-toolchains-plugin/pull/148#discussion_r3206825883.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]