Search in sources :

Example 1 with MavenLogger

use of org.eclipse.tycho.core.shared.MavenLogger in project tycho by eclipse.

the class VerifierServiceImpl method verify.

@Override
public boolean verify(URI metadataRepositoryUri, URI artifactRepositoryUri, BuildOutputDirectory tempDirectory) throws FacadeException {
    MavenLogger logger = mavenContext.getLogger();
    logger.debug("Checking metadata from '" + metadataRepositoryUri + "' and artifacts from '" + artifactRepositoryUri + "'");
    IProvisioningAgent agent = Activator.createProvisioningAgent(tempDirectory);
    try {
        try {
            final IMetadataRepository metadata = loadMetadataRepository(metadataRepositoryUri, agent);
            final IArtifactRepository artifactRepository = loadArtifactRepository(artifactRepositoryUri, agent);
            boolean valid = true;
            valid &= verifyReferencedArtifactsExist(metadata, artifactRepository, logger);
            valid &= verifyAllArtifactContent(artifactRepository, logger);
            if (valid) {
                logger.info("The integrity of the metadata repository '" + metadataRepositoryUri + "' and artifact repository '" + artifactRepositoryUri + "' has been verified successfully");
            }
            return valid;
        } catch (ProvisionException e) {
            throw new FacadeException(e);
        }
    } finally {
        agent.stop();
    }
}
Also used : FacadeException(org.eclipse.tycho.p2.tools.FacadeException) MavenLogger(org.eclipse.tycho.core.shared.MavenLogger) ProvisionException(org.eclipse.equinox.p2.core.ProvisionException) IProvisioningAgent(org.eclipse.equinox.p2.core.IProvisioningAgent) IArtifactRepository(org.eclipse.equinox.p2.repository.artifact.IArtifactRepository) IMetadataRepository(org.eclipse.equinox.p2.repository.metadata.IMetadataRepository)

Aggregations

IProvisioningAgent (org.eclipse.equinox.p2.core.IProvisioningAgent)1 ProvisionException (org.eclipse.equinox.p2.core.ProvisionException)1 IArtifactRepository (org.eclipse.equinox.p2.repository.artifact.IArtifactRepository)1 IMetadataRepository (org.eclipse.equinox.p2.repository.metadata.IMetadataRepository)1 MavenLogger (org.eclipse.tycho.core.shared.MavenLogger)1 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)1