/** * Creates and returns a new {@link MavenResolverSystem} instance * * @return A new {@link MavenResolverSystem} instance */ public static MavenResolverSystem resolver() { return Resolvers.use(MavenResolverSystem.class); }
/** * Creates and returns a new {@link ConfigurableMavenResolverSystem} instance which may be used to create new * {@link MavenResolverSystem} instances * * @return A new {@link ConfigurableMavenResolverSystem} instance which may be used to create new * {@link MavenResolverSystem} instances */ public static ConfigurableMavenResolverSystem configureResolver() { return Resolvers.configure(ConfigurableMavenResolverSystem.class); }
public MavenImporterImpl(Archive<?> archive) { // this is needed to boostrap session Resolvers.use(MavenResolverSystem.class); this.session = new MavenWorkingSessionImpl(); this.archive = archive; }
public MavenImporterImpl(Archive<?> archive) { // this is needed to boostrap session Resolvers.use(MavenResolverSystem.class); this.session = new MavenWorkingSessionImpl(); this.archive = archive; }
/** * Specifies a POM file the EmbeddedMaven should be used for. * <p> * This method offers you to use a Resolver EmbeddedMaven API for additional easy setting of Maven Invoker that * is internally used. * </p> * <p> * If you prefer more powerful approach that is less comfortable and more boilerplate, then use the method * {@link #withMavenInvokerSet(InvocationRequest, Invoker)} * </p> * * @param pomFile POM file the EmbeddedMaven should be used for * @return Set EmbeddedMaven instance */ public static PomEquippedEmbeddedMaven forProject(File pomFile) { PomUnequippedEmbeddedMaven embeddedMaven = Resolvers.use(PomUnequippedEmbeddedMaven.class); return embeddedMaven.setPom(pomFile); }
/** * Configures the {@link MavenResolverSystem} with <code>settings.xml</code> and POM metadata as picked up from the * environment (these properties are set by the ShrinkWrap Maven Resolver Plugin). * * @param cl The {@link ClassLoader} used to create the new instance; required * @return The {@link MavenResolverSystem} configured with <code>settings.xml</code> and POM metadata as picked up * from the environment * @throws IllegalArgumentException * If the {@link ClassLoader} is not specified * @throws InvalidEnvironmentException * If this is executed outside the context of the ShrinkWrap Maven Resolver Plugin Environment */ public static PomEquippedResolveStage configureResolverViaPlugin(final ClassLoader cl) throws InvalidEnvironmentException, IllegalArgumentException { final ConfigurableMavenResolverSystem resolverSystem = Resolvers.use(ConfigurableMavenResolverSystem.class, cl); return resolverSystem.configureViaPlugin(); }
/** * Specifies an {@link InvocationRequest} and an {@link Invoker} the EmbeddedMaven should be used with. * <p> * When you use this approach, it is expected that both instances are properly set by you and no additional * parameters (such as -DskipTests) is added by Resolver. You can also observe some limited functionality * provided by Resolver API. * </p> * <p> * If you prefer more comfortable and less boilerplate approach, then use the method {@link #forProject(String)} * </p> * * @param request An {@link InvocationRequest} the EmbeddedMaven should be used with * @param invoker An {@link Invoker} the EmbeddedMaven should be used with * @return Set EmbeddedMaven instance */ public static MavenInvokerEquippedEmbeddedMaven withMavenInvokerSet(InvocationRequest request, Invoker invoker) { MavenInvokerUnequippedEmbeddedMaven embeddedMaven = Resolvers.use(MavenInvokerUnequippedEmbeddedMaven.class); return embeddedMaven.setMavenInvoker(request, invoker); } }
/** * Specifies a POM file the EmbeddedMaven should be used for. * <p> * This method offers you to use a Resolver EmbeddedMaven API for additional easy setting of Maven Invoker that * is internally used. * </p> * <p> * If you prefer more powerful approach that is less comfortable and more boilerplate, then use the method * {@link #withMavenInvokerSet(InvocationRequest, Invoker)} * </p> * * @param pomFile POM file the EmbeddedMaven should be used for * @return Set EmbeddedMaven instance */ public static PomEquippedEmbeddedMaven forProject(File pomFile) { PomUnequippedEmbeddedMaven embeddedMaven = Resolvers.use(PomUnequippedEmbeddedMaven.class); return embeddedMaven.setPom(pomFile); }
/** * Specifies an {@link InvocationRequest} and an {@link Invoker} the EmbeddedMaven should be used with. * <p> * When you use this approach, it is expected that both instances are properly set by you and no additional * parameters (such as -DskipTests) is added by Resolver. You can also observe some limited functionality * provided by Resolver API. * </p> * <p> * If you prefer more comfortable and less boilerplate approach, then use the method {@link #forProject(String)} * </p> * * @param request An {@link InvocationRequest} the EmbeddedMaven should be used with * @param invoker An {@link Invoker} the EmbeddedMaven should be used with * @return Set EmbeddedMaven instance */ public static MavenInvokerEquippedEmbeddedMaven withMavenInvokerSet(InvocationRequest request, Invoker invoker) { MavenInvokerUnequippedEmbeddedMaven embeddedMaven = Resolvers.use(MavenInvokerUnequippedEmbeddedMaven.class); return embeddedMaven.setMavenInvoker(request, invoker); } }