private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); Module module = configuration.getModule(); for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) { MavenPom pom = resolver.getPom(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier( pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(), pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(), pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion() ); publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId)); } } }); }
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) { MavenPom pom = resolver.getPom(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier( pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(), pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(), pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion() ); publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId)); } } }); }
private boolean onlyContainsMavenResolvers(Collection<ArtifactRepository> repositories) { for (ArtifactRepository repository : repositories) { if (!(repository instanceof MavenResolver)) { return false; } } return true; }
public MavenResolver createMavenInstaller() { PomFilterContainer pomFilterContainer = createPomFilterContainer( mavenFactory.createMavenPomFactory(configurationContainer, scopeMapping, fileResolver)); return new BaseMavenInstaller(pomFilterContainer, createArtifactPomContainer(pomMetaInfoProvider, pomFilterContainer, createArtifactPomFactory()), loggingManagerFactory.create(), mavenSettingsProvider, mavenRepositoryLocator); }
public MavenResolver mavenInstaller() { return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME); }
public MavenResolver mavenInstaller(Closure configureClosure) { return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME, ConfigureUtil.configureUsing(configureClosure)); }
public MavenResolver mavenInstaller(Map<String, ?> args) { return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME, new ConfigureByMapAction<MavenResolver>(args)); }
public MavenResolver mavenInstaller(Map<String, ?> args, Closure configureClosure) { //noinspection unchecked return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME, Actions.<MavenResolver>composite( new ConfigureByMapAction<MavenResolver>(args), ConfigureUtil.configureUsing(configureClosure) )); }
private MavenResolver createMavenInstaller() { return deployerFactory.createMavenInstaller(); }
public MavenResolver createMavenInstaller() { PomFilterContainer pomFilterContainer = createPomFilterContainer( mavenFactory.createMavenPomFactory(configurationContainer, scopeMapping, fileResolver)); return new BaseMavenInstaller(pomFilterContainer, createArtifactPomContainer(pomMetaInfoProvider, pomFilterContainer, createArtifactPomFactory()), loggingManagerFactory.create()); }
public MavenResolver mavenInstaller(Closure configureClosure) { return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME, new ClosureBackedAction<MavenResolver>(configureClosure)); }
public MavenResolver mavenInstaller(Map<String, ?> args, Closure configureClosure) { //noinspection unchecked return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME, Actions.<MavenResolver>composite( new ConfigureByMapAction<MavenResolver>(args), new ClosureBackedAction<MavenResolver>(configureClosure) )); }
/** * Adds a repository for installing to a local Maven cache. This repository can not be used for resolving dependencies. * * @return The added repository * @see #mavenInstaller(java.util.Map, groovy.lang.Closure) (java.util.Map, groovy.lang.Closure) */ MavenResolver mavenInstaller();
/** * Adds a repository for installing to a local Maven cache. This repository can not be used for resolving dependencies. * * @param configureClosure A closure to use to configure the repository. * @return The added repository * @see #mavenInstaller(java.util.Map, groovy.lang.Closure) (java.util.Map, groovy.lang.Closure) */ MavenResolver mavenInstaller(Closure configureClosure);
/** * Adds a repository for installing to a local Maven cache. This repository can not be used for resolving dependencies. * * The following parameter are accepted as keys for the map: * * <table summary="Shows property keys and associated values"> * <tr><th>Key</th> * <th>Description of Associated Value</th></tr> * <tr><td><code>name</code></td> * <td><em>(optional)</em> The name of the repository. The default is <em>mavenInstaller-{SOME_ID}</em>. * The name is used in the console output, * to point to information related to a particular repository. A name must be unique amongst a repository group. * </td></tr> * </table> * * @param args The argument to create the repository * @return The added repository * @see #mavenInstaller(java.util.Map, groovy.lang.Closure) (java.util.Map, groovy.lang.Closure) */ MavenResolver mavenInstaller(Map<String, ?> args);
/** * Adds a repository for installing to a local Maven cache. This repository can not be used for resolving dependencies. * * @param args The argument to create the repository * @param configureClosure A closure to use to configure the repository. * @return The added repository */ MavenResolver mavenInstaller(Map<String, ?> args, Closure configureClosure);
MavenResolver createMavenInstaller();