Search in sources :

Example 1 with VerifierService

use of org.eclipse.tycho.p2.tools.verifier.facade.VerifierService in project tycho by eclipse.

the class VerifyIntegrityRepositoryMojo method execute.

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
    File repositoryDir = getBuildDirectory().getChild("repository");
    logger.info("Verifying p2 repositories in " + repositoryDir);
    VerifierService verifier = p2.getService(VerifierService.class);
    URI repositoryUri = repositoryDir.toURI();
    try {
        if (!verifier.verify(repositoryUri, repositoryUri, getBuildDirectory())) {
            throw new MojoFailureException("The repository is invalid.");
        }
    } catch (FacadeException e) {
        throw new MojoExecutionException("Verification failed", e);
    }
}
Also used : FacadeException(org.eclipse.tycho.p2.tools.FacadeException) VerifierService(org.eclipse.tycho.p2.tools.verifier.facade.VerifierService) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) MojoFailureException(org.apache.maven.plugin.MojoFailureException) File(java.io.File) URI(java.net.URI)

Aggregations

File (java.io.File)1 URI (java.net.URI)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)1 VerifierService (org.eclipse.tycho.p2.tools.verifier.facade.VerifierService)1