/** * Creates the local repository for the integration tests. If the user specified a custom repository location, the * custom repository will have the same identifier, layout and policies as the real local repository. That means * apart from the location, the custom repository will be indistinguishable from the real repository such that its * usage is transparent to the integration tests. * * @return The local repository for the integration tests, never <code>null</code>. * @throws MojoExecutionException If the repository could not be created. */ private void createTestRepository() throws MojoExecutionException { if ( !localRepositoryPath.exists() && !localRepositoryPath.mkdirs() ) { throw new MojoExecutionException( "Failed to create directory: " + localRepositoryPath ); } projectBuildingRequest = repositoryManager.setLocalRepositoryBasedir( session.getProjectBuildingRequest(), localRepositoryPath ); }
/** * Appends the artifact path into the specified StringBuilder. * * @param art {@link Artifact} * @param sb {@link StringBuilder} */ protected void appendArtifactPath( Artifact art, StringBuilder sb ) { if ( prefix == null ) { String file = art.getFile().getPath(); // substitute the property for the local repo path to make the classpath file portable. if ( StringUtils.isNotEmpty( localRepoProperty ) ) { File localBasedir = repositoryManager.getLocalRepositoryBasedir( session.getProjectBuildingRequest() ); file = StringUtils.replace( file, localBasedir.getAbsolutePath(), localRepoProperty ); } sb.append( file ); } else { // TODO: add param for prepending groupId and version. sb.append( prefix ); sb.append( File.separator ); sb.append( DependencyUtil.getFormattedFileName( art, this.stripVersion, this.prependGroupId, this.useBaseVersion, this.stripClassifier ) ); } }
repositoryManager.getPathForLocalArtifact( projectBuildingRequest, artifact ) );
File targetFile = new File( repositoryManager.getLocalRepositoryBasedir( buildingRequest ), repositoryManager.getPathForLocalArtifact( buildingRequest, a ) );
getRepositoryManager().setLocalRepositoryBasedir( session.getProjectBuildingRequest(), outputDirectory );
public ArchetypeCatalog getArchetypeCatalog( ProjectBuildingRequest buildingRequest ) throws ArchetypeDataSourceException File localRepo = repositoryManager.getLocalRepositoryBasedir( buildingRequest );
buildingRequest = repositoryManager.setLocalRepositoryBasedir( buildingRequest, tempRepo ); buildingRequest = repositoryManager.setLocalRepositoryBasedir( buildingRequest, repositoryDirectory );
public void updateCatalog( ProjectBuildingRequest buildingRequest, Archetype archetype ) throws ArchetypeDataSourceException File localRepo = repositoryManager.getLocalRepositoryBasedir( buildingRequest );
repositoryManager.setLocalRepositoryBasedir( buildingRequest, localRepositoryDirectory );