Example usage for org.apache.maven.artifact.repository RepositoryRequest setForceUpdate

List of usage examples for org.apache.maven.artifact.repository RepositoryRequest setForceUpdate

Introduction

In this page you can find the example usage for org.apache.maven.artifact.repository RepositoryRequest setForceUpdate.

Prototype

RepositoryRequest setForceUpdate(boolean forceUpdate);

Source Link

Document

Enables/disabled forced checks for updated artifacts/metadata on remote repositories.

Usage

From source file:org.eclipse.che.maven.CheArtifactResolver.java

License:Apache License

private void injectSession1(RepositoryRequest request, MavenSession session) {
    if (session != null) {
        request.setOffline(session.isOffline());
        request.setForceUpdate(session.getRequest().isUpdateSnapshots());
    }//from w  w  w.j a va 2  s  .c  o m
}

From source file:org.eclipse.ebr.maven.ModelUtil.java

License:Open Source License

void configureRepositoryRequest(final RepositoryRequest request) throws MojoExecutionException {
    request.setLocalRepository(getMavenSession().getLocalRepository());
    if (!getMavenSession().isOffline()) {
        try {/*from   w  ww  . ja  v a  2s .  c om*/
            request.setRemoteRepositories(getRepositories(false));
        } catch (final InvalidRepositoryException e) {
            getLog().debug(e);
            throw new MojoExecutionException(format(
                    "Unable to create the default remote repository. Please verify the Maven configuration. %s",
                    e.getMessage()));
        }
    }
    request.setOffline(getMavenSession().isOffline());
    request.setForceUpdate(RepositoryPolicy.UPDATE_POLICY_ALWAYS
            .equals(getMavenSession().getRepositorySession().getUpdatePolicy()));
}