net.sf.debianmaven.InstallMojo Maven / Gradle / Ivy
package net.sf.debianmaven;
import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
/**
* Installs the generated Debian package in the current system.
*
* Uses external utilities: dpkg and sudo.
*
* @goal install
*/
public class InstallMojo extends AbstractDebianMojo
{
private void runInstall() throws IOException, MojoExecutionException
{
if (getPackageFile().exists())
runProcess(new String[]{"sudo", "dpkg", "--force-confdef", "-i", getPackageFile().toString()}, true);
else
getLog().warn("Debian package file not found; doing nothing.");
}
protected void executeDebMojo() throws MojoExecutionException
{
try
{
runInstall();
}
catch (IOException e)
{
throw new MojoExecutionException(e.toString());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy