private ArtifactRepository getDeploymentRepository( ArtifactRepositoryFactory factory, ArtifactRepositoryLayout layout, String repositoryId, String repositoryUrl) throws ComponentLookupException { if (repositoryUrl == null) return null; final ArtifactRepository repository = factory.createDeploymentArtifactRepository( repositoryId, repositoryUrl, layout, uniqueVersion); return new WrappedArtifactRepository(repository, uniqueVersion); }
private List<String> deployArtifactRepository() throws MojoExecutionException { ArtifactRepositoryLayout artifactRepositoryLayout = availableRepositoryLayouts.get(repositoryLayout); if (artifactRepositoryLayout == null) { throw new MojoExecutionException("Unknown repository layout '" + repositoryLayout + "'."); } // The repo where the jar files will be installed ArtifactRepository artifactRepository = artifactRepositoryFactory.createDeploymentArtifactRepository( project.getArtifactId(), "file://" + outputDirectory.getAbsolutePath() + "/lib", artifactRepositoryLayout, false); List<String> classPaths = new ArrayList<String>(); for (Artifact artifact : artifacts) { classPaths.add(installArtifact(artifactRepository, artifact)); } // install the project's artifact in the new repository classPaths.add(installArtifact(artifactRepository, projectArtifact)); return classPaths; }