
kr.motd.maven.os.EclipseStartup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of os-maven-plugin Show documentation
Show all versions of os-maven-plugin Show documentation
A Maven extension/plugin that generates various useful platform-dependent project properties normalized from
${os.name} and ${os.arch}.
package kr.motd.maven.os;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.IStartup;
import org.osgi.framework.Bundle;
import java.util.Collections;
import java.util.Properties;
public class EclipseStartup extends Detector implements IStartup {
private static final String ID = EclipseStartup.class.getPackage().getName();
private ILog logger;
@Override
public void earlyStartup() {
Bundle bundle = Platform.getBundle(ID);
logger = Platform.getLog(bundle);
detect(new Properties(), Collections.emptyList());
}
@Override
protected void log(String message) {
logger.log(new Status(IStatus.INFO, ID, message));
}
@Override
protected void logProperty(String name, String value) {
logger.log(new Status(IStatus.INFO, ID, name + ": " + value));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy