diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java index 0d181821cf..ea21ec9b03 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java @@ -86,7 +86,7 @@ public class MavenIT0146InstallerSnapshotNaming Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Properties properties = verifier.newDefaultFilterProperties(); - properties.setProperty( "@host@", InetAddress.getLocalHost().getCanonicalHostName() ); + properties.setProperty( "@host@", InetAddress.getLoopbackAddress().getCanonicalHostName() ); properties.setProperty( "@port@", Integer.toString( port ) ); verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties ); @@ -125,7 +125,7 @@ public class MavenIT0146InstallerSnapshotNaming verifier = newVerifier( testDir.getAbsolutePath() ); Properties properties = verifier.newDefaultFilterProperties(); - properties.setProperty( "@host@", InetAddress.getLocalHost().getCanonicalHostName() ); + properties.setProperty( "@host@", InetAddress.getLoopbackAddress().getCanonicalHostName() ); properties.setProperty( "@port@", Integer.toString( port ) ); verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java index e5ed71e4a3..50de0a8f1d 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java @@ -119,7 +119,7 @@ public class MavenITmng2387InactiveProxyTest Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Properties properties = verifier.newDefaultFilterProperties(); - properties.setProperty( "@host@", InetAddress.getLocalHost().getCanonicalHostName() ); + properties.setProperty( "@host@", InetAddress.getLoopbackAddress().getCanonicalHostName() ); properties.setProperty( "@port@", Integer.toString( port ) ); properties.setProperty( "@proxyPort@", Integer.toString( proxyPort ) ); verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java index 47a4ad16e7..66d6ac27d0 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java @@ -93,7 +93,7 @@ public class MavenITmng4991NonProxyHostsTest filterProps.setProperty( "@port@", Integer.toString( port ) ); int proxyPort = ( (NetworkConnector) proxy.getConnectors()[0] ).getLocalPort(); filterProps.setProperty( "@proxyPort@", Integer.toString( proxyPort ) ); - filterProps.setProperty( "@localhost@", InetAddress.getLocalHost().getCanonicalHostName() ); + filterProps.setProperty( "@localhost@", InetAddress.getLoopbackAddress().getCanonicalHostName() ); verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps ); verifier.addCliOption( "-s" ); verifier.addCliOption( "settings.xml" );