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

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

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

origin: apache/maven

@Override
public String getBasedir()
{
  return ( userLocalArtifactRepository != null ) ? userLocalArtifactRepository.getBasedir() : null;
}
origin: apache/maven

@Override
public MavenExecutionRequest setLocalRepository( ArtifactRepository localRepository )
{
  this.localRepository = localRepository;
  if ( localRepository != null )
  {
    setLocalRepositoryPath( new File( localRepository.getBasedir() ).getAbsoluteFile() );
  }
  return this;
}
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

@Override
public Artifact find( Artifact artifact )
{
  File artifactFile = new File( localRepository.getBasedir(), pathOf( artifact ) );
  // We need to set the file here or the resolver will fail with an NPE, not fully equipped to deal
  // with multiple local repository implementations yet.
  artifact.setFile( artifactFile );
  return artifact;
}
origin: apache/maven

private LegacyLocalRepositoryManager( ArtifactRepository delegate )
{
  this.delegate = Objects.requireNonNull( delegate, "delegate cannot be null" );
  ArtifactRepositoryLayout layout = delegate.getLayout();
  repo =
    new LocalRepository( new File( delegate.getBasedir() ),
               ( layout != null ) ? layout.getClass().getSimpleName() : "legacy" );
  /*
   * NOTE: "invoker:install" vs "appassembler:assemble": Both mojos use the artifact installer to put an artifact
   * into a repository. In the first case, the result needs to be a proper local repository that one can use for
   * local artifact resolution. In the second case, the result needs to precisely obey the path information of the
   * repository's layout to allow pointing at artifacts within the repository. Unfortunately,
   * DefaultRepositoryLayout does not correctly describe the layout of a local repository which unlike a remote
   * repository never uses timestamps in the filename of a snapshot artifact. The discrepancy gets notable when a
   * remotely resolved snapshot artifact gets passed into pathOf(). So producing a proper local artifact path
   * using DefaultRepositoryLayout requires us to enforce usage of the artifact's base version. This
   * transformation however contradicts the other use case of precisely obeying the repository's layout. The below
   * flag tries to detect which use case applies to make both plugins happy.
   */
  realLocalRepo = ( layout instanceof DefaultRepositoryLayout ) && "local".equals( delegate.getId() );
}
origin: org.apache.maven/maven-artifact

public void updateVersion( String version, ArtifactRepository localRepository )
{
  setResolvedVersion( version );
  setFile( new File( localRepository.getBasedir(), localRepository.pathOf( this ) ) );
}
origin: apache/maven

public void updateVersion( String version, ArtifactRepository localRepository )
{
  setResolvedVersion( version );
  setFile( new File( localRepository.getBasedir(), localRepository.pathOf( this ) ) );
}
origin: fabric8io/docker-maven-plugin

private FixedStringSearchInterpolator createRepositoryInterpolator()
{
  final Properties settingsProperties = new Properties();
  final MavenSession session = getMavenSession();
  if (getLocalRepository() != null) {
    settingsProperties.setProperty("localRepository", getLocalRepository().getBasedir());
    settingsProperties.setProperty("settings.localRepository", getLocalRepository().getBasedir());
  }
  else if (session != null && session.getSettings() != null) {
    settingsProperties.setProperty("localRepository", session.getSettings().getLocalRepository() );
    settingsProperties.setProperty("settings.localRepository", getLocalRepository().getBasedir() );
  }
  return FixedStringSearchInterpolator.create(new PropertiesBasedValueSource(settingsProperties));
}
origin: apache/maven

public void storeInLocalRepository( ArtifactRepository localRepository, ArtifactRepository remoteRepository )
  throws RepositoryMetadataStoreException
{
  File destination =
    new File( localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata( this,
                                                remoteRepository ) );
  // ----------------------------------------------------------------------------
  // I'm fully aware that the file could just be moved using File.rename but
  // there are bugs in various JVM that have problems doing this across
  // different filesystem. So we'll incur the small hit to actually copy
  // here and be safe. jvz.
  // ----------------------------------------------------------------------------
  try
  {
    FileUtils.copyFile( file, destination );
  }
  catch ( IOException e )
  {
    throw new RepositoryMetadataStoreException( "Error copying POM to the local repository.", e );
  }
}
origin: org.apache.maven/maven-project

public void storeInLocalRepository( ArtifactRepository localRepository,
                  ArtifactRepository remoteRepository )
  throws RepositoryMetadataStoreException
{
  File f = transformedFile == null ? originalFile : transformedFile;
  if ( f == null )
  {
    return;
  }
  
  File destination = new File( localRepository.getBasedir(),
                 localRepository.pathOfLocalRepositoryMetadata( this, remoteRepository ) );
  // ----------------------------------------------------------------------------
  // I'm fully aware that the file could just be moved using File.rename but
  // there are bugs in various JVM that have problems doing this across
  // different filesystem. So we'll incur the small hit to actually copy
  // here and be safe. jvz.
  // ----------------------------------------------------------------------------
  try
  {
    FileUtils.copyFile( f, destination );
  }
  catch ( IOException e )
  {
    throw new RepositoryMetadataStoreException( "Error copying POM to the local repository.", e );
  }
}
origin: fabric8io/docker-maven-plugin

private File getLocalMavenRepoFile(MavenSession session, File source) {
  ArtifactRepository localRepo = session.getLocalRepository();
  if (localRepo == null) {
    log.warn("No local repo found so not adding any extra watches in the local repository");
    return null;
  }
  Artifact artifact = getArtifactFromJar(source);
  if (artifact != null) {
    try {
      return new File(localRepo.getBasedir(), localRepo.pathOf(artifact));
    } catch (InvalidArtifactRTException e) {
      log.warn("Cannot get the local repository path for %s in base dir %s : %s",
           artifact, localRepo.getBasedir(), e.getMessage());
    }
  }
  return null;
}
origin: apache/maven

public static RepositorySystemSession overlay( ArtifactRepository repository, RepositorySystemSession session,
                        RepositorySystem system )
{
  if ( repository == null || repository.getBasedir() == null )
  {
    return session;
  }
  if ( session != null )
  {
    LocalRepositoryManager lrm = session.getLocalRepositoryManager();
    if ( lrm != null && lrm.getRepository().getBasedir().equals( new File( repository.getBasedir() ) ) )
    {
      return session;
    }
  }
  else
  {
    session = new DefaultRepositorySystemSession();
  }
  final LocalRepositoryManager llrm = new LegacyLocalRepositoryManager( repository );
  return new DefaultRepositorySystemSession( session ).setLocalRepositoryManager( llrm );
}
origin: apache/maven

new File( localRepo.getBasedir(), localRepo.pathOfLocalRepositoryMetadata( metadata, remoteRepository ) );
origin: apache/maven

private void localRepository( MavenExecutionRequest request )
  throws MavenExecutionRequestPopulationException
{
  // ------------------------------------------------------------------------
  // Local Repository
  //
  // 1. Use a value has been passed in via the configuration
  // 2. Use value in the resultant settings
  // 3. Use default value
  // ------------------------------------------------------------------------
  if ( request.getLocalRepository() == null )
  {
    request.setLocalRepository( createLocalRepository( request ) );
  }
  if ( request.getLocalRepositoryPath() == null )
  {
    request.setLocalRepositoryPath( new File( request.getLocalRepository().getBasedir() ).getAbsoluteFile() );
  }
}
origin: apache/maven

File metadataFile = new File( localRepository.getBasedir(),
               localRepository.pathOfLocalRepositoryMetadata( this, remoteRepository ) );
origin: apache/maven

File metadataFile = new File( localRepository.getBasedir(),
               localRepository.pathOfLocalRepositoryMetadata( repoMetadata, remoteRepository ) );
origin: apache/maven

file = new File( localRepository.getBasedir(),
         localRepository.pathOfLocalRepositoryMetadata( metadata, deploymentRepository ) );
origin: apache/maven

  new File( localRepo.getBasedir(), localRepo.pathOfLocalRepositoryMetadata( metadata, repository ) );
boolean update;
origin: apache/maven

LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() );
origin: org.apache.maven.plugins/maven-install-plugin

/**
 * Gets the path of the specified artifact metadata within the local repository. Note that the returned path need
 * not exist (yet).
 *
 * @param metadata The artifact metadata whose local repo path should be determined, must not be <code>null</code>.
 * @return The absolute path to the artifact metadata when installed, never <code>null</code>.
 */
protected File getLocalRepoFile( ArtifactMetadata metadata )
{
  String path = localRepository.pathOfLocalRepositoryMetadata( metadata, localRepository );
  return new File( localRepository.getBasedir(), path );
}
org.apache.maven.artifact.repositoryArtifactRepositorygetBasedir

Popular methods of ArtifactRepository

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JComboBox (javax.swing)
  • JPanel (javax.swing)
  • Top Vim plugins
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