@@ -213,7 +213,8 @@ private String getContainerFile() {
213
213
* altDeploymentDirectory to be used by default.
214
214
*/
215
215
private String getMavenSetup () {
216
- String result = """
216
+
217
+ return """
217
218
echo "MAVEN_HOME:$MAVEN_HOME"
218
219
PATH="${MAVEN_HOME}/bin:$PATH"
219
220
@@ -278,14 +279,18 @@ private String getMavenSetup() {
278
279
</altDeploymentRepository>
279
280
</properties>
280
281
</profile>
282
+ <profile>
283
+ <id>PROXY_ENABLED</id>
284
+ <activation>
285
+ <activeByDefault>true</activeByDefault>
286
+ </activation>
287
+ <properties>
288
+ <PROXY_ENABLED>false</PROXY_ENABLED>
289
+ </properties>
290
+ </profile>
281
291
</profiles>
282
292
283
293
<interactiveMode>false</interactiveMode>
284
- """ ;
285
-
286
- // This block is only needed when running outside of JBS
287
- if (isEmpty (System .getenv ("jvm-build-service" ))) {
288
- result += """
289
294
<!--
290
295
Needed for Maven 3.9+. Switched to native resolver
291
296
https://maven.apache.org/guides/mini/guide-resolver-transport.html
@@ -304,13 +309,12 @@ private String getMavenSetup() {
304
309
</configuration>
305
310
</server>
306
311
</servers>
307
-
308
312
<proxies>
309
313
<proxy>
310
314
<id>indy-http</id>
311
- <active>true </active>
315
+ <active>${PROXY_ENABLED} </active>
312
316
<protocol>http</protocol>
313
- <host>indy-generic -proxy</host>
317
+ <host>domain -proxy</host>
314
318
<port>80</port>
315
319
<!-- <username>build-ADDTW3JAGHYAA+tracking</username> -->
316
320
<username>${BUILD_ID}+tracking</username>
@@ -319,19 +323,16 @@ private String getMavenSetup() {
319
323
</proxy>
320
324
<proxy>
321
325
<id>indy-https</id>
322
- <active>true </active>
326
+ <active>${PROXY_ENABLED} </active>
323
327
<protocol>https</protocol>
324
- <host>indy-generic -proxy</host>
328
+ <host>domain -proxy</host>
325
329
<port>80</port>
326
330
<username>${BUILD_ID}+tracking</username>
327
331
<password>${ACCESS_TOKEN}</password>
328
332
<nonProxyHosts>${PROXY_URL}|localhost</nonProxyHosts>
329
333
</proxy>
330
334
</proxies>
331
- """ ;
332
- }
333
335
334
- result += """
335
336
</settings>
336
337
EOF
337
338
@@ -368,8 +369,6 @@ private String getMavenSetup() {
368
369
</toolchains>
369
370
EOF
370
371
""" .formatted (javaVersion );
371
-
372
- return result ;
373
372
}
374
373
375
374
0 commit comments