本文整理汇总了Java中org.gradle.api.artifacts.repositories.MavenArtifactRepository类的典型用法代码示例。如果您正苦于以下问题:Java MavenArtifactRepository类的具体用法?Java MavenArtifactRepository怎么用?Java MavenArtifactRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MavenArtifactRepository类属于org.gradle.api.artifacts.repositories包,在下文中一共展示了MavenArtifactRepository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createPublishTasksForEachMavenRepo
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
private void createPublishTasksForEachMavenRepo(ModelMap<Task> tasks, PublishingExtension extension, final Task publishLifecycleTask, final MavenPublicationInternal publication,
final String publicationName) {
for (final MavenArtifactRepository repository : extension.getRepositories().withType(MavenArtifactRepository.class)) {
final String repositoryName = repository.getName();
String publishTaskName = "publish" + capitalize(publicationName) + "PublicationTo" + capitalize(repositoryName) + "Repository";
tasks.create(publishTaskName, PublishToMavenRepository.class, new Action<PublishToMavenRepository>() {
public void execute(PublishToMavenRepository publishTask) {
publishTask.setPublication(publication);
publishTask.setRepository(repository);
publishTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP);
publishTask.setDescription("Publishes Maven publication '" + publicationName + "' to Maven repository '" + repositoryName + "'.");
}
});
publishLifecycleTask.dependsOn(publishTaskName);
}
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:20,代码来源:MavenPublishPlugin.java
示例2: resolvePluginDependencies
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
private ClassPath resolvePluginDependencies(final PluginUseMetaData metadata) {
DependencyResolutionServices resolution = dependencyResolutionServicesFactory.create();
RepositoryHandler repositories = resolution.getResolveRepositoryHandler();
final String repoUrl = metadata.implementation.get("repo");
repositories.maven(new Action<MavenArtifactRepository>() {
public void execute(MavenArtifactRepository mavenArtifactRepository) {
mavenArtifactRepository.setUrl(repoUrl);
}
});
Dependency dependency = resolution.getDependencyHandler().create(metadata.implementation.get("gav"));
ConfigurationContainerInternal configurations = (ConfigurationContainerInternal) resolution.getConfigurationContainer();
ConfigurationInternal configuration = configurations.detachedConfiguration(dependency);
try {
Set<File> files = configuration.getResolvedConfiguration().getFiles(Specs.satisfyAll());
return new DefaultClassPath(files);
} catch (ResolveException e) {
throw new DependencyResolutionException("Failed to resolve all plugin dependencies from " + repoUrl, e.getCause());
}
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:24,代码来源:PluginResolutionServiceResolver.java
示例3: internalCreateArtifactRepository
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
@Override
protected ArtifactRepository internalCreateArtifactRepository(RepositoryHandler repositoryHandler) {
return repositoryHandler.maven(new Action<MavenArtifactRepository>() {
@Override
public void execute(MavenArtifactRepository mavenArtifactRepository) {
mavenArtifactRepository.setName(getArtifactRepositoryName());
mavenArtifactRepository.setUrl(getUrl());
Credentials credentials = authenticationSupport().getConfiguredCredentials();
if (credentials != null) {
((AuthenticationSupportedInternal)mavenArtifactRepository).setConfiguredCredentials(credentials);
mavenArtifactRepository.authentication(new Action<AuthenticationContainer>() {
@Override
public void execute(AuthenticationContainer authenticationContainer) {
authenticationContainer.addAll(authenticationSupport().getConfiguredAuthentication());
}
});
}
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:DefaultMavenPluginRepository.java
示例4: createAndroidTasks
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
@Mutate
public void createAndroidTasks(
ModelMap<Task> tasks,
ModelMap<AndroidComponentSpec> androidSpecs,
TaskManager taskManager,
SdkHandler sdkHandler,
Project project, AndroidComponentModelSourceSet androidSources) {
// setup SDK repositories.
for (final File file : sdkHandler.getSdkLoader().getRepositories()) {
project.getRepositories().maven(new Action<MavenArtifactRepository>() {
@Override
public void execute(MavenArtifactRepository repo) {
repo.setUrl(file.toURI());
}
});
}
// TODO: determine how to provide functionalities of variant API objects.
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:BaseComponentModelPlugin.java
示例5: createPublishTasksForEachMavenRepo
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
private void createPublishTasksForEachMavenRepo(CollectionBuilder<Task> tasks, PublishingExtension extension, final Task publishLifecycleTask, final MavenPublicationInternal publication,
final String publicationName) {
for (final MavenArtifactRepository repository : extension.getRepositories().withType(MavenArtifactRepository.class)) {
final String repositoryName = repository.getName();
String publishTaskName = String.format("publish%sPublicationTo%sRepository", capitalize(publicationName), capitalize(repositoryName));
tasks.create(publishTaskName, PublishToMavenRepository.class, new Action<PublishToMavenRepository>() {
public void execute(PublishToMavenRepository publishTask) {
publishTask.setPublication(publication);
publishTask.setRepository(repository);
publishTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP);
publishTask.setDescription(String.format("Publishes Maven publication '%s' to Maven repository '%s'.", publicationName, repositoryName));
//Because dynamic rules are not yet implemented we have to violate input immutability here as an interim step
publishLifecycleTask.dependsOn(publishTask);
}
});
}
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:21,代码来源:MavenPublishPlugin.java
示例6: mavenRepo
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
public DependencyResolver mavenRepo(Map<String, ?> args, Closure configClosure) {
DeprecationLogger.nagUserOfReplacedMethod("RepositoryHandler.mavenRepo()", "maven()");
Map<String, Object> modifiedArgs = new HashMap<String, Object>(args);
if (modifiedArgs.containsKey("urls")) {
List<?> urls = flattenCollections(modifiedArgs.remove("urls"));
if (!urls.isEmpty()) {
modifiedArgs.put("url", urls.get(0));
List<?> extraUrls = urls.subList(1, urls.size());
modifiedArgs.put("artifactUrls", extraUrls);
}
}
MavenArtifactRepository repository = repositoryFactory.createMavenRepository();
ConfigureUtil.configureByMap(modifiedArgs, repository);
DependencyResolver resolver = repositoryFactory.toResolver(repository);
ConfigureUtil.configure(configClosure, resolver);
addRepository(repositoryFactory.createResolverBackedRepository(resolver), "mavenRepo");
return resolver;
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:20,代码来源:DefaultRepositoryHandler.java
示例7: publish
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
@TaskAction
public void publish() {
MavenPublicationInternal publicationInternal = getPublicationInternal();
if (publicationInternal == null) {
throw new InvalidUserDataException("The 'publication' property is required");
}
MavenArtifactRepository repository = getRepository();
if (repository == null) {
throw new InvalidUserDataException("The 'repository' property is required");
}
doPublish(publicationInternal, repository);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:PublishToMavenRepository.java
示例8: doPublish
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
private void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
new PublishOperation(publication, repository.getName()) {
@Override
protected void publish() throws Exception {
MavenPublisher remotePublisher = new MavenRemotePublisher(getLoggingManagerFactory(), getMavenRepositoryLocator(), getTemporaryDirFactory(), getRepositoryTransportFactory());
MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(remotePublisher);
MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
validatingPublisher.publish(publication.asNormalisedPublication(), repository);
}
}.run();
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:PublishToMavenRepository.java
示例9: GradleWagonMavenDeployAction
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
public GradleWagonMavenDeployAction(File pomFile, MavenArtifactRepository artifactRepository, RepositoryTransportFactory repositoryTransportFactory) {
super(pomFile, null);
this.artifactRepository = artifactRepository;
this.repositoryTransportFactory = repositoryTransportFactory;
registerWagonProtocols();
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:MavenRemotePublisher.java
示例10: publish
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
public void publish(MavenNormalizedPublication publication, MavenArtifactRepository artifactRepository) {
validateIdentity(publication);
validateArtifacts(publication);
checkNoDuplicateArtifacts(publication);
delegate.publish(publication, artifactRepository);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:ValidatingMavenPublisher.java
示例11: publish
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
public void publish(MavenNormalizedPublication publication, MavenArtifactRepository artifactRepository) {
STATIC_LOCK.lock();
try {
delegate.publish(publication, artifactRepository);
} finally {
STATIC_LOCK.unlock();
}
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:StaticLockingMavenPublisher.java
示例12: gradle
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
public MavenArtifactRepository gradle(final Action<? super MavenArtifactRepository> action) {
return repositories.maven(new Action<MavenArtifactRepository>() {
public void execute(MavenArtifactRepository repository) {
repository.setName("gradleJs");
repository.setUrl(GRADLE_PUBLIC_JAVASCRIPT_REPO_URL);
action.execute(repository);
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:JavaScriptRepositoriesExtension.java
示例13: createArtifactRepository
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
@Override
public ArtifactRepository createArtifactRepository(RepositoryHandler repositoryHandler) {
return repositoryHandler.maven(new Action<MavenArtifactRepository>() {
@Override
public void execute(MavenArtifactRepository mavenArtifactRepository) {
mavenArtifactRepository.setUrl("https://plugins.gradle.org/m2");
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DefaultGradlePluginPortal.java
示例14: createMavenLocalRepository
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
public MavenArtifactRepository createMavenLocalRepository() {
MavenArtifactRepository mavenRepository = instantiator.newInstance(DefaultMavenLocalArtifactRepository.class, fileResolver, transportFactory,
locallyAvailableResourceFinder, instantiator, artifactFileStore, pomParser, createAuthenticationContainer());
final File localMavenRepository = localMavenRepositoryLocator.getLocalMavenRepository();
mavenRepository.setUrl(localMavenRepository);
return mavenRepository;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultBaseRepositoryFactory.java
示例15: publish
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
@TaskAction
public void publish() {
MavenPublicationInternal publicationInternal = getPublicationInternal();
if (publicationInternal == null) {
throw new InvalidUserDataException("The 'publication' property is required");
}
MavenArtifactRepository repository = getRepository();
if (repository == null) {
throw new InvalidUserDataException("The 'repository' property is required");
}
doPublish(publicationInternal, repository);
}
开发者ID:alibaba,项目名称:atlas,代码行数:16,代码来源:PublishToMavenRepositoryHook.java
示例16: getRepository
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
@Override
public MavenArtifactRepository getRepository() {
if (super.getRepository() == null) {
// Instantiate the default MavenLocal repository if none has been set explicitly
MavenArtifactRepository mavenLocalRepository = getBaseRepositoryFactory().createMavenLocalRepository();
mavenLocalRepository.setName(ArtifactRepositoryContainer.DEFAULT_MAVEN_LOCAL_REPO_NAME);
setRepository(mavenLocalRepository);
}
return super.getRepository();
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:12,代码来源:PublishToMavenLocal.java
示例17: doPublish
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
@Override
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
new PublishOperation(publication, repository) {
@Override
protected void publish() throws Exception {
MavenPublisher antBackedPublisher = new AntTaskBackedMavenLocalPublisher(getLoggingManagerFactory(), getTemporaryDirFactory());
MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher);
MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
validatingPublisher.publish(publication.asNormalisedPublication(), repository);
}
}.run();
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:13,代码来源:PublishToMavenLocal.java
示例18: doPublish
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
new PublishOperation(publication, repository) {
@Override
protected void publish() throws Exception {
MavenPublisher antBackedPublisher = new AntTaskBackedMavenPublisher(getLoggingManagerFactory(), getTemporaryDirFactory());
MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher);
MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
validatingPublisher.publish(publication.asNormalisedPublication(), repository);
}
}.run();
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:12,代码来源:PublishToMavenRepository.java
示例19: publish
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
public void publish(MavenNormalizedPublication publication, MavenArtifactRepository artifactRepository) {
logger.info("Publishing to repository {}", artifactRepository);
T deployTask = createDeployTask();
deployTask.setProject(AntUtil.createProject());
MavenSettingsSupplier mavenSettingsSupplier = new EmptyMavenSettingsSupplier();
mavenSettingsSupplier.supply(deployTask);
postConfigure(deployTask, artifactRepository);
addPomAndArtifacts(deployTask, publication);
execute(deployTask);
mavenSettingsSupplier.done();
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:15,代码来源:AbstractAntTaskBackedMavenPublisher.java
示例20: createMavenLocalRepository
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; //导入依赖的package包/类
public MavenArtifactRepository createMavenLocalRepository() {
MavenArtifactRepository mavenRepository = instantiator.newInstance(DefaultMavenLocalArtifactRepository.class, fileResolver, createPasswordCredentials(), transportFactory,
locallyAvailableResourceFinder, artifactFileStore);
final File localMavenRepository = localMavenRepositoryLocator.getLocalMavenRepository();
mavenRepository.setUrl(localMavenRepository);
return mavenRepository;
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:DefaultBaseRepositoryFactory.java
注:本文中的org.gradle.api.artifacts.repositories.MavenArtifactRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论