io.linguarobot.aws.cdk.maven.node.LinuxNodeInstaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-cdk-maven-plugin Show documentation
Show all versions of aws-cdk-maven-plugin Show documentation
The AWS CDK Maven plugin produces and deploys CloudFormation templates based on the cloud infrastructure defined
by means of CDK. The goal of the project is to improve the experience of Java developers while working with
CDK by eliminating the need for installing Node.js and interacting with the CDK application by means of CDK
Toolkit.
package io.linguarobot.aws.cdk.maven.node;
import io.linguarobot.aws.cdk.maven.process.ProcessRunner;
import java.nio.file.Path;
/**
* Node.js installer for Linux.
*/
public class LinuxNodeInstaller extends UnixNodeInstaller {
public LinuxNodeInstaller(ProcessRunner processRunner, Path localRepositoryPath) {
super(processRunner, localRepositoryPath, "linux", getArch());
}
private static String getArch() {
String arch = System.getProperty("os.arch");
if (arch.equals("arm")) {
String osVersion = System.getProperty("os.version");
if (osVersion.contains("v7")) {
arch = "armv7l";
} else {
throw new NodeInstallationException("The architecture is not supported: " + arch);
}
} else if (arch.equals("aarch64")) {
arch = "arm64";
} else if (!arch.equals("ppc64le") && !arch.equals("s390x")) {
if (arch.contains("64")) {
arch = "x64";
} else {
throw new NodeInstallationException("The architecture is not supported: " + arch);
}
}
return arch;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy