• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DeploymentException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.aether.deployment.DeploymentException的典型用法代码示例。如果您正苦于以下问题:Java DeploymentException类的具体用法?Java DeploymentException怎么用?Java DeploymentException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DeploymentException类属于org.eclipse.aether.deployment包,在下文中一共展示了DeploymentException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: execute

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
@Override
public void execute(ExecutionContext context) throws MojoExecutionException, MojoFailureException {
  this.log.info("Deploying the release artifacts into the distribution repository");

  try {
    Collection<Artifact> deployedArtifacts = this.deployer.deployArtifacts(this.metadata.getReleaseArtifacts());
    if (!deployedArtifacts.isEmpty()) {
      this.log.debug("\tDeployed the following release artifacts to the remote repository:");
      for (Artifact a : deployedArtifacts) {
        this.log.debug("\t\t" + a);
      }
    }
  } catch (DeploymentException e) {
    throw new MojoFailureException("Unable to deploy artifacts into remote repository.", e);
  }
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:17,代码来源:DeployArtifacts.java


示例2: deploy

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
@Override
public void deploy(final String pom,
                   final Artifact... artifacts) {
    try {
        final DeployRequest deployRequest = new DeployRequest();

        for (Artifact artifact : artifacts) {
            deployRequest.addArtifact(artifact);
        }

        deployRequest.setRepository(getRepository());

        Aether.getAether().getSystem().deploy(Aether.getAether().getSession(),
                                              deployRequest);
    } catch (DeploymentException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:FileSystemArtifactRepository.java


示例3: publish

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
/**
 * @param descriptor an {@link Artifact}, holding the maven coordinates for the published files
 *     less the extension that is to be derived from the files. The {@code descriptor} itself will
 *     not be published as is, and the {@link File} attached to it (if any) will be ignored.
 * @param toPublish {@link File}(s) to be published using the given coordinates. The filename
 *     extension of each given file will be used as a maven "extension" coordinate
 */
public DeployResult publish(Artifact descriptor, List<File> toPublish)
    throws DeploymentException {
  String providedExtension = descriptor.getExtension();
  if (!providedExtension.isEmpty()) {
    LOG.warn(
        "Provided extension %s of artifact %s to be published will be ignored. The extensions "
            + "of the provided file(s) will be used",
        providedExtension, descriptor);
  }
  List<Artifact> artifacts = new ArrayList<>(toPublish.size());
  for (File file : toPublish) {
    artifacts.add(
        new SubArtifact(
            descriptor,
            descriptor.getClassifier(),
            Files.getFileExtension(file.getAbsolutePath()),
            file));
  }
  return publish(artifacts);
}
 
开发者ID:facebook,项目名称:buck,代码行数:28,代码来源:Publisher.java


示例4: deployArtifacts

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
/**
 * Deploys the given artifacts to the configured remote Maven repositories.
 *
 * @param artifacts the artifacts to deploy.
 * @return the artifacts that have been deployed successfully.
 * @throws DeploymentException if anything goes wrong during the deployment process.
 */
public Collection<Artifact> deployArtifacts(Collection<Artifact> artifacts) throws DeploymentException {
  DeployRequest request = new DeployRequest();
  request.setArtifacts(artifacts);
  request.setRepository(this.metadata.getDeploymentRepository());
  DeployResult result = this.deployer.deploy(this.repoSession, request);
  return result.getArtifacts();
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:15,代码来源:ArtifactDeployer.java


示例5: deployUsingAether

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
private DeployResult deployUsingAether(Artifact artifact, Artifact pom, RemoteRepository deploymentRepository) throws DeploymentException {
	RepositorySystem system = aetherConfigurer.newRepositorySystem();
	RepositorySystemSession session = aetherConfigurer.newSession(system, mvnConsumerConfigurer.getLocalM2Repo());
	DeployRequest deployRequest = new DeployRequest();
	deployRequest.addArtifact(artifact).addArtifact(pom);
	deployRequest.setRepository(deploymentRepository);
	DeployResult result = system.deploy(session, deployRequest);
	return result;
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:10,代码来源:MavenDeployer.java


示例6: afterSessionEnd

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
@Override
public void afterSessionEnd(MavenSession session) throws MavenExecutionException {
  boolean errors = !session.getResult().getExceptions().isEmpty();

  if (!deployAtEndRequests.isEmpty()) {

    log.info("");
    log.info("------------------------------------------------------------------------");

    if (errors) {
      log.info("-- Not performing deploy at end due to errors                         --");
    } else {
      log.info("-- Performing deploy at end                                           --");
      log.info("------------------------------------------------------------------------");

      synchronized (deployAtEndRequests) {
        for (DeployRequest deployRequest : deployAtEndRequests) {
          try {
            deploy(session.getRepositorySession(), deployRequest);
          } catch (DeploymentException e) {
            log.error(e.getMessage(), e);
            throw new MavenExecutionException(e.getMessage(), e);
          }
        }
        deployAtEndRequests.clear();
      }
    }

    log.info("------------------------------------------------------------------------");
  }
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:32,代码来源:DeployParticipant.java


示例7: doExecute

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
/**
 * Deploy each of the provided {@link Module}s, along with their SubArtifacts (POMs, JavaDoc bundle, etc.), to the repository location
 * indicated by {@link #repositoryUrl}.
 */
@Override 
public void doExecute(Set<Module> artifacts) throws MojoExecutionException, MojoFailureException {

   	RemoteRepository.Builder builder = new RemoteRepository.Builder(repositoryId, repositoryType, repositoryUrl);
	Authentication authentication = getAuthentication(repositoryId);
   	builder.setAuthentication(authentication);

   	LOGGER.info("Deploying to repositoryId '{}' with credentials: {}", repositoryId, authentication == null ? null : authentication.toString());
   	
   	RemoteRepository repository = builder.build();
	
	for (Module artifact : artifacts) {
     
		DeployRequest deployRequest = new DeployRequest();
		deployRequest.addArtifact(artifact); 
       	deployRequest.setRepository(repository);
       	
		for (Artifact subArtifact : artifact.getAttachments()) {
        	deployRequest.addArtifact(subArtifact);
        }
        
        try {
			repositorySystem.deploy(repositorySystemSession, deployRequest);
		} catch (DeploymentException e) {
			throw new MojoFailureException("Deployment failed: ", e);
		}	

	}		
}
 
开发者ID:isomorphic-software,项目名称:isc-maven-plugin,代码行数:34,代码来源:DeployMojo.java


示例8: deploy

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
/** convenience method */
public void deploy(RemoteRepository target, Artifact ... artifacts) throws DeploymentException {
    deploy(target, null, Arrays.asList(artifacts));
}
 
开发者ID:mlhartme,项目名称:maven-embedded,代码行数:5,代码来源:Maven.java


示例9: deploy

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
public void deploy(RepositorySystemSession session, DeployRequest deployRequest) throws DeploymentException {
  repoSystem.deploy(session, deployRequest);
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:4,代码来源:DeployParticipant.java


示例10: publishTargets

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
private boolean publishTargets(
    ImmutableList<BuildTarget> buildTargets, CommandRunnerParams params) {
  ImmutableSet.Builder<MavenPublishable> publishables = ImmutableSet.builder();
  boolean success = true;
  for (BuildTarget buildTarget : buildTargets) {
    BuildRule buildRule = getBuild().getRuleResolver().requireRule(buildTarget);
    Preconditions.checkNotNull(buildRule);

    if (!(buildRule instanceof MavenPublishable)) {
      params
          .getBuckEventBus()
          .post(
              ConsoleEvent.severe(
                  "Cannot publish rule of type %s", buildRule.getClass().getName()));
      success &= false;
      continue;
    }

    MavenPublishable publishable = (MavenPublishable) buildRule;
    if (!publishable.getMavenCoords().isPresent()) {
      params
          .getBuckEventBus()
          .post(
              ConsoleEvent.severe(
                  "No maven coordinates specified for %s",
                  buildTarget.getUnflavoredBuildTarget().getFullyQualifiedName()));
      success &= false;
      continue;
    }
    publishables.add(publishable);
  }

  Publisher publisher =
      new Publisher(
          params.getCell().getFilesystem(),
          Optional.ofNullable(remoteRepo),
          Optional.ofNullable(username),
          Optional.ofNullable(password),
          dryRun);

  try {
    ImmutableSet<DeployResult> deployResults =
        publisher.publish(
            DefaultSourcePathResolver.from(
                new SourcePathRuleFinder(getBuild().getRuleResolver())),
            publishables.build());
    for (DeployResult deployResult : deployResults) {
      printArtifactsInformation(params, deployResult);
    }
  } catch (DeploymentException e) {
    params.getConsole().printBuildFailureWithoutStacktraceDontUnwrap(e);
    return false;
  }
  return success;
}
 
开发者ID:facebook,项目名称:buck,代码行数:56,代码来源:PublishCommand.java


示例11: errorRaisedForDuplicateFirstOrderDeps

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
@Test
public void errorRaisedForDuplicateFirstOrderDeps()
    throws DeploymentException, NoSuchBuildTargetException {
  // Construct a graph that looks like this.  A and B have maven coordinates set.
  // A   B
  //  \ /
  //   C
  BuildTarget publishableTargetA =
      BuildTargetFactory.newInstance("//:a").withFlavors(JavaLibrary.MAVEN_JAR);
  BuildTarget publishableTargetB =
      BuildTargetFactory.newInstance("//:b").withFlavors(JavaLibrary.MAVEN_JAR);
  BuildTarget targetC = BuildTargetFactory.newInstance("//:c");

  TargetNode<?, ?> depNode =
      JavaLibraryBuilder.createBuilder(targetC).addSrc(Paths.get("c.java")).build();
  TargetNode<?, ?> publishableANode =
      JavaLibraryBuilder.createBuilder(publishableTargetA)
          .addSrc(Paths.get("a.java"))
          .setMavenCoords(MVN_COORDS_A)
          .addDep(targetC)
          .build();
  TargetNode<?, ?> publishableBNode =
      JavaLibraryBuilder.createBuilder(publishableTargetB)
          .addSrc(Paths.get("b.java"))
          .setMavenCoords(MVN_COORDS_B)
          .addDep(targetC)
          .build();

  TargetGraph targetGraph =
      TargetGraphFactory.newInstance(depNode, publishableANode, publishableBNode);
  BuildRuleResolver resolver =
      new SingleThreadedBuildRuleResolver(
          targetGraph, new DefaultTargetNodeToBuildRuleTransformer());
  SourcePathResolver pathResolver =
      DefaultSourcePathResolver.from(new SourcePathRuleFinder(resolver));

  MavenPublishable publishableA = (MavenPublishable) resolver.requireRule(publishableTargetA);
  MavenPublishable publishableB = (MavenPublishable) resolver.requireRule(publishableTargetB);

  expectedException.expect(DeploymentException.class);
  expectedException.expectMessage(
      Matchers.containsString(targetC.getUnflavoredBuildTarget().getFullyQualifiedName()));
  expectedException.expectMessage(
      Matchers.containsString(
          publishableTargetA.getUnflavoredBuildTarget().getFullyQualifiedName()));
  expectedException.expectMessage(
      Matchers.containsString(
          publishableTargetB.getUnflavoredBuildTarget().getFullyQualifiedName()));

  publisher.publish(pathResolver, ImmutableSet.of(publishableA, publishableB));
}
 
开发者ID:facebook,项目名称:buck,代码行数:52,代码来源:PublisherTest.java


示例12: errorRaisedForDuplicateFirstOrderAndTransitiveDep

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
@Test
public void errorRaisedForDuplicateFirstOrderAndTransitiveDep()
    throws DeploymentException, NoSuchBuildTargetException {
  // Construct a graph that looks like this.  A and B have maven coordinates set.
  // A   B
  // |   |
  // C   |
  //  \ /
  //   D
  BuildTarget publishableTargetA =
      BuildTargetFactory.newInstance("//:a").withFlavors(JavaLibrary.MAVEN_JAR);
  BuildTarget publishableTargetB =
      BuildTargetFactory.newInstance("//:b").withFlavors(JavaLibrary.MAVEN_JAR);
  BuildTarget targetC = BuildTargetFactory.newInstance("//:c");
  BuildTarget targetD = BuildTargetFactory.newInstance("//:d");

  TargetNode<?, ?> transitiveDepNode =
      JavaLibraryBuilder.createBuilder(targetD).addSrc(Paths.get("d.java")).build();
  TargetNode<?, ?> depNode =
      JavaLibraryBuilder.createBuilder(targetC)
          .addSrc(Paths.get("c.java"))
          .addDep(targetD)
          .build();
  TargetNode<?, ?> publishableANode =
      JavaLibraryBuilder.createBuilder(publishableTargetA)
          .addSrc(Paths.get("a.java"))
          .setMavenCoords(MVN_COORDS_A)
          .addDep(targetC)
          .build();
  TargetNode<?, ?> publishableBNode =
      JavaLibraryBuilder.createBuilder(publishableTargetB)
          .addSrc(Paths.get("b.java"))
          .setMavenCoords(MVN_COORDS_B)
          .addDep(targetD)
          .build();

  TargetGraph targetGraph =
      TargetGraphFactory.newInstance(
          transitiveDepNode, depNode, publishableANode, publishableBNode);
  BuildRuleResolver resolver =
      new SingleThreadedBuildRuleResolver(
          targetGraph, new DefaultTargetNodeToBuildRuleTransformer());
  SourcePathResolver pathResolver =
      DefaultSourcePathResolver.from(new SourcePathRuleFinder(resolver));

  MavenPublishable publishableA = (MavenPublishable) resolver.requireRule(publishableTargetA);
  MavenPublishable publishableB = (MavenPublishable) resolver.requireRule(publishableTargetB);

  expectedException.expect(DeploymentException.class);
  expectedException.expectMessage(
      Matchers.containsString(targetD.getUnflavoredBuildTarget().getFullyQualifiedName()));
  expectedException.expectMessage(
      Matchers.containsString(
          publishableTargetA.getUnflavoredBuildTarget().getFullyQualifiedName()));
  expectedException.expectMessage(
      Matchers.containsString(
          publishableTargetB.getUnflavoredBuildTarget().getFullyQualifiedName()));

  publisher.publish(pathResolver, ImmutableSet.of(publishableA, publishableB));
}
 
开发者ID:facebook,项目名称:buck,代码行数:61,代码来源:PublisherTest.java


示例13: errorRaisedForDuplicateTransitiveDeps

import org.eclipse.aether.deployment.DeploymentException; //导入依赖的package包/类
@Test
public void errorRaisedForDuplicateTransitiveDeps()
    throws DeploymentException, NoSuchBuildTargetException {
  // Construct a graph that looks like this.  A and B have maven coordinates set.
  // A   B
  // |   |
  // C   D
  //  \ /
  //   E
  BuildTarget publishableTargetA =
      BuildTargetFactory.newInstance("//:a").withFlavors(JavaLibrary.MAVEN_JAR);
  BuildTarget publishableTargetB =
      BuildTargetFactory.newInstance("//:b").withFlavors(JavaLibrary.MAVEN_JAR);
  BuildTarget targetC = BuildTargetFactory.newInstance("//:c");
  BuildTarget targetD = BuildTargetFactory.newInstance("//:d");
  BuildTarget targetE = BuildTargetFactory.newInstance("//:e");

  TargetNode<?, ?> transitiveDepNode =
      JavaLibraryBuilder.createBuilder(targetE).addSrc(Paths.get("e.java")).build();
  TargetNode<?, ?> dep1Node =
      JavaLibraryBuilder.createBuilder(targetC)
          .addSrc(Paths.get("c.java"))
          .addDep(targetE)
          .build();
  TargetNode<?, ?> dep2Node =
      JavaLibraryBuilder.createBuilder(targetD)
          .addSrc(Paths.get("d.java"))
          .addDep(targetE)
          .build();
  TargetNode<?, ?> publishableANode =
      JavaLibraryBuilder.createBuilder(publishableTargetA)
          .addSrc(Paths.get("a.java"))
          .setMavenCoords(MVN_COORDS_A)
          .addDep(targetC)
          .build();
  TargetNode<?, ?> publishableBNode =
      JavaLibraryBuilder.createBuilder(publishableTargetB)
          .addSrc(Paths.get("b.java"))
          .setMavenCoords(MVN_COORDS_B)
          .addDep(targetD)
          .build();

  TargetGraph targetGraph =
      TargetGraphFactory.newInstance(
          transitiveDepNode, dep1Node, dep2Node, publishableANode, publishableBNode);
  BuildRuleResolver resolver =
      new SingleThreadedBuildRuleResolver(
          targetGraph, new DefaultTargetNodeToBuildRuleTransformer());
  SourcePathResolver pathResolver =
      DefaultSourcePathResolver.from(new SourcePathRuleFinder(resolver));

  MavenPublishable publishableA = (MavenPublishable) resolver.requireRule(publishableTargetA);
  MavenPublishable publishableB = (MavenPublishable) resolver.requireRule(publishableTargetB);

  expectedException.expect(DeploymentException.class);
  expectedException.expectMessage(
      Matchers.containsString(targetE.getUnflavoredBuildTarget().getFullyQualifiedName()));
  expectedException.expectMessage(
      Matchers.containsString(
          publishableTargetA.getUnflavoredBuildTarget().getFullyQualifiedName()));
  expectedException.expectMessage(
      Matchers.containsString(
          publishableTargetB.getUnflavoredBuildTarget().getFullyQualifiedName()));

  publisher.publish(pathResolver, ImmutableSet.of(publishableA, publishableB));
}
 
开发者ID:facebook,项目名称:buck,代码行数:67,代码来源:PublisherTest.java



注:本文中的org.eclipse.aether.deployment.DeploymentException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EntityProcessPrincipal类代码示例发布时间:2022-05-23
下一篇:
Java VelocityView类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap