public Artifact find( Artifact artifact ) { File artifactFile = new File( 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 ); if ( artifactFile.exists() ) { artifact.setResolved( true ); } return artifact; }
public String toString() { StringBuilder sb = new StringBuilder( 256 ); sb.append( " id: " ).append( getId() ).append( '\n' ); sb.append( " url: " ).append( getUrl() ).append( '\n' ); sb.append( " layout: " ).append( layout != null ? layout : "none" ).append( '\n' ); if ( snapshots != null ) { sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() ); sb.append( ", update => " ).append( snapshots.getUpdatePolicy() ).append( "]\n" ); } if ( releases != null ) { sb.append( " releases: [enabled => " ).append( releases.isEnabled() ); sb.append( ", update => " ).append( releases.getUpdatePolicy() ).append( "]\n" ); } return sb.toString(); }
return new DefaultArtifactRepository( "localRepository", "file://" + localRepo.getAbsolutePath(), new DefaultRepositoryLayout() );
public String getKey() { return getId(); }
/** * Initializes the local repository. * * @param localRepositoryDirName the path to the local repository. */ private void initLocalRepository(final String localRepositoryDirName) { String name = localRepositoryDirName; if (!name.startsWith("file:")) { name = "file://" + name; } localRepository = new DefaultArtifactRepository("local", name, repositoryLayout); }
repo = new DefaultArtifactRepository( id, url, repoLayout );
repo = new DefaultArtifactRepository(id, url, repoLayout);
public void addMirror( String id, String mirrorOf, String url ) { if ( id == null ) { id = "mirror-" + anonymousMirrorIdSeed++; getLogger().warn( "You are using a mirror that doesn't declare an <id/> element. Using \'" + id + "\' instead:\nId: " + id + "\nmirrorOf: " + mirrorOf + "\nurl: " + url + "\n" ); } ArtifactRepository mirror = new DefaultArtifactRepository( id, url, null ); //to preserve first wins, don't add repeated mirrors. if (!mirrors.containsKey( mirrorOf )) { mirrors.put( mirrorOf, mirror ); } }
repo = new DefaultArtifactRepository( id, url, repoLayout );
repo = new DefaultArtifactRepository(id, url, repoLayout);
repo = new DefaultArtifactRepository(id, url, repoLayout);
protected void setUp() throws Exception { super.setUp(); String localRepo = System.getProperty( "maven.repo.local" ); if ( localRepo == null ) { File settingsFile = new File( System.getProperty( "user.home" ), ".m2/settings.xml" ); if ( settingsFile.exists() ) { Settings settings = new SettingsXpp3Reader().read( ReaderFactory.newXmlReader( settingsFile ) ); localRepo = settings.getLocalRepository(); } } if ( localRepo == null ) { localRepo = System.getProperty( "user.home" ) + "/.m2/repository"; } ArtifactRepositoryLayout repositoryLayout = (ArtifactRepositoryLayout) container.lookup( ArtifactRepositoryLayout.ROLE, "default" ); localRepository = new DefaultArtifactRepository( "local", "file://" + localRepo, repositoryLayout ); }
return new DefaultArtifactRepository( "local-repository", "file://" + localRepository, new DefaultRepositoryLayout() );
private ArtifactRepository getLocalRepository() { if ( repository == null ) { return new DefaultArtifactRepository( "local-repository", "file://" + settings.getLocalRepository(), new DefaultRepositoryLayout() ); } else { return new DefaultArtifactRepository( repository.getName(), "file://" + repository.getLocation(), new DefaultRepositoryLayout() ); } }
return new DefaultArtifactRepository( "localRepository", "file://" + localRepo.getAbsolutePath(), new DefaultRepositoryLayout() );
protected ArtifactRepository createLocalArtifactRepository() { if ( localRepository == null ) { localRepository = getDefaultLocalRepository(); } ArtifactRepositoryLayout repositoryLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, localRepository.getLayout() ); return new DefaultArtifactRepository( "local", "file://" + localRepository.getLocation(), repositoryLayout ); }
repoUrl = repoUrl.substring(0, paramIndex); repo = new DefaultArtifactRepository( repoUrl, repoUrl,
protected ArtifactRepository createLocalArtifactRepository() { ArtifactRepositoryLayout repositoryLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, getLocalRepository().getLayout() ); return new DefaultArtifactRepository( "local", "file://" + getLocalRepository().getPath(), repositoryLayout ); }
private ArtifactRepository getLocalRepository() { String repo = localRepository; if ( getSettings() != null && !StringUtils.isEmpty( getSettings().getLocalRepository() ) ) { repo = getSettings().getLocalRepository(); } return new DefaultArtifactRepository( "local-repository", "file://" + repo, new DefaultRepositoryLayout() ); }
repoUrl = repoUrl.substring(0, paramIndex); repo = new DefaultArtifactRepository( repoUrl, repoUrl,