congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ArtifactRepository
Code IndexAdd Tabnine to your IDE (free)

How to use
ArtifactRepository
in
org.apache.maven.artifact.repository

Best Java code snippets using org.apache.maven.artifact.repository.ArtifactRepository (Showing top 20 results out of 927)

Refine searchRefine arrow

  • Artifact
  • Logger
  • Log
  • MavenProject
  • RepositoryMetadata
origin: apache/maven

new File( localRepo.getBasedir(), localRepo.pathOfLocalRepositoryMetadata( metadata, remoteRepository ) );
getLogger().info(
  metadata + " could not be found on repository: " + remoteRepository.getId() + ", so will be created" );
origin: apache/maven

throws TransferFailedException, ResourceDoesNotExistException
String remotePath = repository.pathOf( artifact );
ArtifactRepositoryPolicy policy = artifact.isSnapshot() ? repository.getSnapshots() : repository.getReleases();
  logger.debug( "Skipping disabled repository " + repository.getId() + " for resolution of "
           + artifact.getId() );
else if ( artifact.isSnapshot() || !artifact.getFile().exists() )
    logger.debug( "Trying repository " + repository.getId() + " for resolution of " + artifact.getId()
             + " from " + remotePath );
    logger.debug( "  Artifact " + artifact.getId() + " resolved to " + artifact.getFile() );
    artifact.setResolved( true );
        "Failure to resolve " + remotePath + " from " + repository.getUrl()
          + " was cached in the local repository. "
          + "Resolution will not be reattempted until the update interval of "
          + repository.getId() + " has elapsed or updates are forced. Original error: " + error );
        "Failure to resolve " + remotePath + " from " + repository.getUrl()
          + " was cached in the local repository. "
          + "Resolution will not be reattempted until the update interval of "
          + repository.getId() + " has elapsed or updates are forced." );
origin: apache/maven

@Deprecated
public ArtifactRepository getMirrorRepository( ArtifactRepository repository )
{
  Mirror mirror = mirrorSelector.getMirror( repository, legacySupport.getSession().getSettings().getMirrors() );
  if ( mirror != null )
  {
    String id = mirror.getId();
    if ( id == null )
    {
      // TODO this should be illegal in settings.xml
      id = repository.getId();
    }
    log.debug( "Using mirror: " + mirror.getUrl() + " (id: " + id + ")" );
    repository = artifactRepositoryFactory.createArtifactRepository( id, mirror.getUrl(),
                                 repository.getLayout(), repository.getSnapshots(),
                                 repository.getReleases() );
  }
  return repository;
}
origin: apache/maven

private static boolean repositoryEquals( ArtifactRepository r1, ArtifactRepository r2 )
{
  if ( r1 == r2 )
  {
    return true;
  }
  return eq( r1.getId(), r2.getId() ) && eq( r1.getUrl(), r2.getUrl() )
    && repositoryPolicyEquals( r1.getReleases(), r2.getReleases() )
    && repositoryPolicyEquals( r1.getSnapshots(), r2.getSnapshots() );
}
origin: apache/maven

private Date getLocalCopyLastModified( ArtifactRepository localRepository, RepositoryMetadata metadata )
{
  String metadataPath = localRepository.pathOfLocalRepositoryMetadata( metadata, localRepository );
  File metadataFile = new File( localRepository.getBasedir(), metadataPath );
  return metadataFile.isFile() ? new Date( metadataFile.lastModified() ) : null;
}
origin: apache/maven

private void injectMirror( ArtifactRepository repository, Mirror mirror )
{
  if ( mirror != null )
  {
    ArtifactRepository original =
      createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(),
                   repository.getSnapshots(), repository.getReleases() );
    repository.setMirroredRepositories( Collections.singletonList( original ) );
    repository.setId( mirror.getId() );
    repository.setUrl( mirror.getUrl() );
    if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
    {
      repository.setLayout( getLayout( mirror.getLayout() ) );
    }
  }
}
origin: org.apache.maven.doxia/doxia-integration-tools

Artifact artifact = artifactFactory.createArtifactWithClassifier( project.getGroupId(),
                                 project.getArtifactId(),
                                 project.getVersion(), "xml",
                                 "site_" + locale.getLanguage() );
  result = artifact.getFile();
    getLogger().debug( "No site descriptor found for " + project.getId() + " for locale "
      + locale.getLanguage() + ", trying without locale..." );
  getLogger().debug( "Unable to locate site descriptor for locale " + locale.getLanguage() + ": " + e );
  result = new File( localRepository.getBasedir(), localRepository.pathOf( artifact ) );
  result.getParentFile().mkdirs();
  result.createNewFile();
    result = new File( localRepository.getBasedir(), localRepository.pathOf( artifact ) );
    result.getParentFile().mkdirs();
    result.createNewFile();
  result = artifact.getFile();
    getLogger().debug( "No site descriptor found for " + project.getId() + " without locale." );
    result = null;
origin: org.codehaus.mojo/build-helper-maven-plugin

new File( localRepository.getBasedir(), localRepository.pathOf( project.getArtifact() ) );
if ( getLog().isInfoEnabled() )
  getLog().info( localArtifactDirectory.getAbsolutePath() + " removed." );
  getLog().warn( failureMessage );
origin: apache/marmotta

public void printHeader(List<ArtifactRepository> repositories) {
  log.info("");
  log.info("dependencies, and where they are available:");
  final int repCount = repositories.size();
  for (int i = 0; i < repCount; i++) {
    final ArtifactRepository rep = repositories.get(i);
    log.info(String.format("%s%s (%s)",
        StringUtils.repeat("|" + sep, i), rep.getId(), rep.getUrl()));
  }
  log.info(StringUtils.repeat("|" + sep, repCount));
}
origin: apache/maven

if ( artifact.isResolved() )
  artifact.setRepository( repository );
  break;
logger.debug( "Unable to find artifact " + artifact.getId() + " in repository " + repository.getId()
         + " (" + repository.getUrl() + ")", e );
  "Unable to get artifact " + artifact.getId() + " from repository " + repository.getId() + " ("
    + repository.getUrl() + "): " + e.getMessage();
if ( logger.isDebugEnabled() )
  logger.warn( msg, e );
origin: apache/karaf

@Override
public void execute() throws MojoExecutionException {
  if (skip) {
    return;
  }
  if (karafVersion == null) {
    karafVersion = org.apache.karaf.util.Version.karafVersion();
  }
  Hashtable<String, String> config = new Hashtable<>();
  String remoteRepositories = MavenUtil.remoteRepositoryList(project.getRemoteProjectRepositories());
  getLog().info("Using repositories: " + remoteRepositories);
  config.put("maven.repositories", remoteRepositories);
  config.put("maven.localRepository", localRepo.getBasedir());
  if (mavenSession.getRequest().getUserSettingsFile().exists()) {
    config.put("maven.settings", mavenSession.getRequest().getUserSettingsFile().toString());
  }
  // TODO: add more configuration bits ?
  resolver = new ReactorMavenResolver(reactor, MavenResolvers.createMavenResolver(config, "maven"));
  doExecute();
}
origin: org.nuiton/helper-maven-plugin

protected List<ArtifactRepository> createSafeRepositories() {
  List<ArtifactRepository> result = new ArrayList<>();
  ArtifactRepositoryLayout repositoryLayout = new DefaultRepositoryLayout();
  if (this.repositories == null) {
    this.repositories = new TreeMap<>();
  }
  List<String> ids = new ArrayList<>(this.repositories.keySet());
  if (addMavenCentral) {
    ids.add(0, MAVEN_CENTRAL_ID);
    this.repositories.put(MAVEN_CENTRAL_ID, MAVEN_CENTRAL_URL);
  }
  for (String id : ids) {
    String url = this.repositories.get(id).trim();
    ArtifactRepository repo = artifactRepositoryFactory.createDeploymentArtifactRepository(
        String.valueOf(id), url, repositoryLayout, true);
    getLog().info("Will use repository " + repo.getUrl());
    if (verbose) {
      getLog().info(repo.toString());
    }
    result.add(repo);
  }
  return result;
}
origin: org.apache.maven.plugins/maven-project-info-reports-plugin

if ( repo.isBlacklisted() )
if ( ( artifact.isSnapshot() && repo.getSnapshots().isEnabled() ) )
  if ( artifact.getBaseVersion().equals( artifact.getVersion() ) )
        log.error( "Artifact: " + artifact.getId() + " could not be resolved." );
return repo.getUrl() + "/" + repo.pathOf( copyArtifact );
origin: org.codehaus.tycho/tycho-osgi-components

  new File( session.getLocalRepository().getBasedir(), session.getLocalRepository().pathOf( p2Runtime ) );
p2Directory = new File( p2Directory.getParentFile(), "eclipse" );
if ( p2Directory.exists() && !p2Runtime.isSnapshot() )
logger.debug( "Resolving P2 runtime" );
  repositories.addAll( project.getPluginArtifactRepositories() );
  if ( logger.isDebugEnabled() )
    logger.warn( "Could not resolve tycho-p2-runtime", e );
if ( p2Runtime.getFile().lastModified() > p2Directory.lastModified() )
  logger.debug( "Unpacking P2 runtime to " + p2Directory );
  unArchiver.setSourceFile( p2Runtime.getFile() );
  unArchiver.setDestDirectory( p2Directory.getParentFile() );
  try
origin: apache/maven

public boolean isUpdateRequired( Artifact artifact, ArtifactRepository repository )
  File file = artifact.getFile();
  ArtifactRepositoryPolicy policy = artifact.isSnapshot() ? repository.getSnapshots() : repository.getReleases();
    if ( getLogger().isDebugEnabled() )
      getLogger().debug(
        "Skipping update check for " + artifact + " (" + file + ") from " + repository.getId() + " ("
          + repository.getUrl() + ")" );
  if ( getLogger().isDebugEnabled() )
    getLogger().debug(
      "Determining update check for " + artifact + " (" + file + ") from " + repository.getId() + " ("
        + repository.getUrl() + ")" );
origin: com.itemis.maven.plugins/unleash-maven-plugin

@PostConstruct
public void init() {
 // setting the artifact version to a release version temporarily since the dist repository checks for a snapshot
 // version of the artifact. Maybe this can be implemented in a different manner but then we would have to setup the
 // repository manually
 org.apache.maven.artifact.Artifact projectArtifact = this.project.getArtifact();
 String oldVersion = projectArtifact.getVersion();
 projectArtifact.setVersion("1");
 // replace properties in remote repository URL and getting the remote repo
 ArtifactRepository artifactRepository = this.project.getDistributionManagementArtifactRepository();
 if (artifactRepository != null) {
  PomPropertyResolver propertyResolver = new PomPropertyResolver(this.project, this.settings, this.profiles,
    this.releaseArgs);
  artifactRepository.setUrl(propertyResolver.expandPropertyReferences(artifactRepository.getUrl()));
  this.deploymentRepository = RepositoryUtils.toRepo(artifactRepository);
 }
 // resetting the artifact version
 projectArtifact.setVersion(oldVersion);
 for (MavenProject p : this.reactorProjects) {
  // puts the initial module artifact coordinates into the cache
  addArtifactCoordinates(ProjectToCoordinates.POM.apply(p), ReleasePhase.PRE_RELEASE);
  // caching of SCM settings of every POM in order to go back to it before setting next dev version
  this.cachedScmSettings.put(ProjectToCoordinates.EMPTY_VERSION.apply(p), p.getModel().getScm());
  Optional<Document> parsedPOM = PomUtil.parsePOM(p);
  if (parsedPOM.isPresent()) {
   this.originalPOMs.put(ProjectToCoordinates.EMPTY_VERSION.apply(p), parsedPOM.get());
  }
 }
}
origin: apache/maven

if ( !artifact.isSnapshot() || Artifact.LATEST_VERSION.equals( artifact.getBaseVersion() ) )
artifact.addMetadata( metadata );
Metadata repoMetadata = metadata.getMetadata();
String version = null;
if ( repoMetadata != null && repoMetadata.getVersioning() != null )
if ( getLogger().isDebugEnabled() )
  if ( !version.equals( artifact.getBaseVersion() ) )
    if ( artifact.getRepository() != null )
      message += " from repository " + artifact.getRepository().getId();
    getLogger().debug( message );
    getLogger().debug( artifact.getArtifactId() + ": using locally installed snapshot" );
origin: org.eclipse.tycho/tycho-core

File artifactFile = new File(session.getLocalRepository().getBasedir(), session.getLocalRepository()
    .pathOf(artifact));
File eclipseDir = new File(artifactFile.getParentFile(), "eclipse");
locker.lock();
try {
  if (!eclipseDir.exists() || artifact.isSnapshot()) {
    logger.debug("Extracting Tycho's OSGi runtime");
    if (artifact.getFile().lastModified() > eclipseDir.lastModified()) {
      logger.debug("Unpacking Tycho's OSGi runtime to " + eclipseDir);
      try {
        FileUtils.deleteDirectory(eclipseDir);
      } catch (IOException e) {
        logger.warn("Failed to delete Tycho's OSGi runtime " + eclipseDir + ": " + e.getMessage());
      unArchiver.setSourceFile(artifact.getFile());
      unArchiver.setDestDirectory(eclipseDir.getParentFile());
      try {
origin: egineering-llc/gitflow-helper-maven-plugin

/**
 * Builds a RemoteRepository for resolving artifacts.
 *
 * @param altRepository the repository identifier or alt-syntax specification
 * @return the resolve remote repository
 * @throws MojoExecutionException if the provided repository specification defines an invalid repository layout
 * @throws MojoFailureException if the provided repository specification is invalid
 */
RemoteRepository getRepository(final String altRepository) throws MojoExecutionException, MojoFailureException {
  if (getLog().isDebugEnabled()) {
    getLog().debug("Creating remote Aether repository (to resolve remote artifacts) for: " + altRepository);
  }
  // Get an appropriate injected ArtifactRepository. (This resolves authentication in the 'normal' manner from Maven)
  ArtifactRepository remoteArtifactRepo = getDeploymentRepository(altRepository);
  if (getLog().isDebugEnabled()) {
    getLog().debug("Resolved maven deployment repository. Transcribing to Aether Repository...");
  }
  RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(remoteArtifactRepo.getId(), remoteArtifactRepo.getLayout().getId(), remoteArtifactRepo.getUrl());
  // Add authentication.
  if (remoteArtifactRepo.getAuthentication() != null) {
    if (getLog().isDebugEnabled()) {
      getLog().debug("Maven deployment repsoitory has Authentication. Transcribing to Aether Authentication...");
    }
    remoteRepoBuilder.setAuthentication(new AuthenticationBuilder().addUsername(remoteArtifactRepo.getAuthentication().getUsername())
        .addPassword(remoteArtifactRepo.getAuthentication().getPassword())
        .addPrivateKey(remoteArtifactRepo.getAuthentication().getPrivateKey(), remoteArtifactRepo.getAuthentication().getPassphrase())
        .build());
  }
  return remoteRepoBuilder.build();
}
origin: org.apache.continuum/continuum-artifact-manager

successful = artifact.isResolved();
getLogger().info( "Unable to find resource '" + artifact.getId() + "' in repository " +
           repository.getId() + " (" + repository.getUrl() + ")" );
getLogger().warn( "Unable to get resource '" + artifact.getId() + "' from repository " +
           repository.getId() + " (" + repository.getUrl() + "): " + e.getMessage() );
org.apache.maven.artifact.repositoryArtifactRepository

Javadoc

Abstraction of an artifact repository. Artifact repositories can be remote, local, or even build reactor or IDE workspace.

Most used methods

  • getBasedir
  • pathOf
  • getUrl
  • getId
  • getLayout
  • getSnapshots
  • getReleases
  • find
  • pathOfLocalRepositoryMetadata
  • getAuthentication
  • getProtocol
  • pathOfRemoteRepositoryMetadata
  • getProtocol,
  • pathOfRemoteRepositoryMetadata,
  • setAuthentication,
  • getProxy,
  • setProxy,
  • setUrl,
  • isBlacklisted,
  • setId,
  • setLayout,
  • findVersions

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JCheckBox (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now