This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static String getMacAddress() throws Exception { | |
| String macAddress = null; | |
| String command = "ifconfig"; | |
| String osName = System.getProperty("os.name"); | |
| System.out.println("Operating System is " + osName); | |
| if (osName.startsWith("Windows")) { | |
| command = "ipconfig /all"; | |
| } else if (osName.startsWith("Linux") || osName.startsWith("Mac") || osName.startsWith("HP-UX") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.example; | |
| import java.net.InetAddress; | |
| import java.net.NetworkInterface; | |
| import java.net.SocketException; | |
| import java.net.UnknownHostException; | |
| import java.util.Enumeration; | |
| /** | |
| * @project: ${MAC_IP} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-resources-plugin</artifactId> | |
| <version>3.0.2</version> | |
| <executions> | |
| <execution> | |
| <id>copy-resources</id> | |
| <phase>generate-resources</phase> |