Search in sources :

Example 1 with Dependency

use of io.quarkus.maven.dependency.Dependency in project kogito-runtimes by kiegroup.

the class KogitoQuarkusResourceUtils method kogitoBuildContext.

public static KogitoBuildContext kogitoBuildContext(Path outputTarget, Iterable<Path> paths, IndexView index, Dependency appArtifact) {
    // scan and parse paths
    AppPaths.BuildTool buildTool;
    if (System.getProperty("org.gradle.appname") == null) {
        buildTool = AppPaths.BuildTool.MAVEN;
    } else {
        buildTool = AppPaths.BuildTool.GRADLE;
    }
    AppPaths appPaths = AppPaths.fromQuarkus(outputTarget, paths, buildTool);
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    KogitoBuildContext context = QuarkusKogitoBuildContext.builder().withApplicationPropertyProvider(new KogitoQuarkusApplicationPropertiesProvider()).withClassLoader(classLoader).withClassAvailabilityResolver(className -> classAvailabilityResolver(classLoader, index, className)).withAppPaths(appPaths).withGAV(new KogitoGAV(appArtifact.getGroupId(), appArtifact.getArtifactId(), appArtifact.getVersion())).build();
    if (!context.hasClassAvailable(QuarkusKogitoBuildContext.QUARKUS_REST)) {
        LOGGER.info("Disabling REST generation because class '" + QuarkusKogitoBuildContext.QUARKUS_REST + "' is not available");
        context.setApplicationProperty(KogitoBuildContext.KOGITO_GENERATE_REST, "false");
    }
    if (!context.hasClassAvailable(QuarkusKogitoBuildContext.QUARKUS_DI)) {
        LOGGER.info("Disabling dependency injection generation because class '" + QuarkusKogitoBuildContext.QUARKUS_DI + "' is not available");
        context.setApplicationProperty(KogitoBuildContext.KOGITO_GENERATE_DI, "false");
    }
    return context;
}
Also used : KiePath(org.kie.memorycompiler.resources.KiePath) DotName(org.jboss.jandex.DotName) LoggerFactory(org.slf4j.LoggerFactory) AdditionalStaticResourceBuildItem(io.quarkus.vertx.http.deployment.spi.AdditionalStaticResourceBuildItem) GeneratedFileWriter(org.kie.kogito.codegen.core.utils.GeneratedFileWriter) BuildProducer(io.quarkus.deployment.annotations.BuildProducer) ArrayList(java.util.ArrayList) GeneratedBeanBuildItem(io.quarkus.arc.deployment.GeneratedBeanBuildItem) CompositeIndex(org.jboss.jandex.CompositeIndex) AppPaths(org.kie.kogito.codegen.api.utils.AppPaths) Dependency(io.quarkus.maven.dependency.Dependency) ResourceReader(org.kie.memorycompiler.resources.ResourceReader) Path(java.nio.file.Path) IndexView(org.jboss.jandex.IndexView) GeneratedResourceBuildItem(io.quarkus.deployment.builditem.GeneratedResourceBuildItem) KogitoBuildContext(org.kie.kogito.codegen.api.context.KogitoBuildContext) Logger(org.slf4j.Logger) GeneratedFileType(org.kie.kogito.codegen.api.GeneratedFileType) Files(java.nio.file.Files) Collection(java.util.Collection) NativeImageResourceBuildItem(io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem) IOException(java.io.IOException) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) KogitoGAV(org.kie.kogito.KogitoGAV) QuarkusKogitoBuildContext(org.kie.kogito.codegen.api.context.impl.QuarkusKogitoBuildContext) Paths(java.nio.file.Paths) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) GeneratedFile(org.kie.kogito.codegen.api.GeneratedFile) Collections(java.util.Collections) AppPaths(org.kie.kogito.codegen.api.utils.AppPaths) KogitoGAV(org.kie.kogito.KogitoGAV) KogitoBuildContext(org.kie.kogito.codegen.api.context.KogitoBuildContext) QuarkusKogitoBuildContext(org.kie.kogito.codegen.api.context.impl.QuarkusKogitoBuildContext)

Example 2 with Dependency

use of io.quarkus.maven.dependency.Dependency in project quarkus by quarkusio.

the class InfoCommandHandler method resolveProjectState.

protected static ProjectState resolveProjectState(ApplicationModel appModel, ExtensionCatalog currentCatalog) {
    final ProjectState.Builder projectBuilder = ProjectState.builder();
    final Collection<ArtifactCoords> importedPlatformBoms = appModel.getPlatforms().getImportedPlatformBoms();
    if (importedPlatformBoms.isEmpty()) {
        return projectBuilder.build();
    }
    final Map<String, ExtensionProvider.Builder> extProviderBuilders = new LinkedHashMap<>(importedPlatformBoms.size());
    importedPlatformBoms.forEach(bom -> {
        projectBuilder.addPlatformBom(bom);
        extProviderBuilders.put(ExtensionProvider.key(bom, true), ExtensionProvider.builder().setArtifact(bom).setPlatform(true));
    });
    final Map<WorkspaceModuleId, ModuleState.Builder> projectModuleBuilders = new HashMap<>();
    final Map<ArtifactKey, List<ModuleState.Builder>> directModuleDeps = new HashMap<>();
    final WorkspaceModule appModule = appModel.getAppArtifact().getWorkspaceModule();
    if (appModule != null) {
        final ModuleState.Builder module = ModuleState.builder().setWorkspaceModule(appModule).setMainModule(true);
        projectModuleBuilders.put(appModule.getId(), module);
        appModule.getDirectDependencies().forEach(d -> directModuleDeps.computeIfAbsent(d.getKey(), dk -> new ArrayList<>()).add(module));
        for (Dependency constraint : appModule.getDirectDependencyConstraints()) {
            if (extProviderBuilders.containsKey(constraint.toCompactCoords())) {
                module.addPlatformBom(constraint);
            }
        }
    }
    for (ResolvedDependency dep : appModel.getDependencies()) {
        if (dep.getWorkspaceModule() != null) {
            projectModuleBuilders.computeIfAbsent(dep.getWorkspaceModule().getId(), k -> {
                final ModuleState.Builder module = ModuleState.builder().setWorkspaceModule(dep.getWorkspaceModule());
                dep.getWorkspaceModule().getDirectDependencies().forEach(d -> directModuleDeps.computeIfAbsent(d.getKey(), dk -> new ArrayList<>()).add(module));
                return module;
            });
        }
    }
    final Map<ArtifactKey, TopExtensionDependency.Builder> directExtDeps = new HashMap<>();
    for (ResolvedDependency dep : appModel.getDependencies()) {
        if (dep.isFlagSet(DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT)) {
            directExtDeps.put(dep.getKey(), TopExtensionDependency.builder().setResolvedDependency(dep).setTransitive(!directModuleDeps.containsKey(dep.getKey())));
        } else if (dep.isRuntimeExtensionArtifact() && directModuleDeps.containsKey(dep.getKey())) {
            directExtDeps.put(dep.getKey(), TopExtensionDependency.builder().setResolvedDependency(dep));
        }
    }
    if (directExtDeps.isEmpty()) {
        return projectBuilder.build();
    }
    currentCatalog.getExtensions().forEach(e -> {
        final ArtifactKey key = e.getArtifact().getKey();
        final TopExtensionDependency.Builder dep = directExtDeps.get(key);
        if (dep != null) {
            dep.setCatalogMetadata(e);
        }
    });
    for (TopExtensionDependency.Builder extBuilder : directExtDeps.values()) {
        final List<ModuleState.Builder> modules = directModuleDeps.getOrDefault(extBuilder.getKey(), Collections.emptyList());
        final TopExtensionDependency dep = extBuilder.setTransitive(modules.isEmpty()).build();
        projectBuilder.addExtensionDependency(dep);
        for (ModuleState.Builder module : modules) {
            module.addExtensionDependency(dep);
        }
        final ExtensionProvider.Builder provider = extProviderBuilders.computeIfAbsent(dep.getProviderKey(), k -> ExtensionProvider.builder().setOrigin(dep.getOrigin()));
        provider.addExtension(dep);
    }
    for (ExtensionProvider.Builder builder : extProviderBuilders.values()) {
        projectBuilder.addExtensionProvider(builder.build());
    }
    for (ModuleState.Builder builder : projectModuleBuilders.values()) {
        projectBuilder.addModule(builder.build());
    }
    return projectBuilder.build();
}
Also used : ArtifactCoords(io.quarkus.maven.dependency.ArtifactCoords) ArtifactKey(io.quarkus.maven.dependency.ArtifactKey) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) ExtensionProvider(io.quarkus.devtools.project.state.ExtensionProvider) LinkedHashMap(java.util.LinkedHashMap) ArrayList(java.util.ArrayList) List(java.util.List) WorkspaceModuleId(io.quarkus.bootstrap.workspace.WorkspaceModuleId) Dependency(io.quarkus.maven.dependency.Dependency) TopExtensionDependency(io.quarkus.devtools.project.state.TopExtensionDependency) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) ModuleState(io.quarkus.devtools.project.state.ModuleState) ProjectState(io.quarkus.devtools.project.state.ProjectState) WorkspaceModule(io.quarkus.bootstrap.workspace.WorkspaceModule) TopExtensionDependency(io.quarkus.devtools.project.state.TopExtensionDependency)

Example 3 with Dependency

use of io.quarkus.maven.dependency.Dependency in project quarkus by quarkusio.

the class JarResultBuildStep method walkFileDependencyForDependency.

private void walkFileDependencyForDependency(Path root, FileSystem runnerZipFs, Map<String, String> seen, Map<String, Set<Dependency>> duplicateCatcher, Map<String, List<byte[]>> concatenatedEntries, Predicate<String> ignoredEntriesPredicate, Dependency appDep, Set<String> existingEntries, Set<String> mergeResourcePaths) throws IOException {
    final Path metaInfDir = root.resolve("META-INF");
    Files.walkFileTree(root, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {

        @Override
        public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
            final String relativePath = toUri(root.relativize(dir));
            if (!relativePath.isEmpty()) {
                addDir(runnerZipFs, relativePath);
            }
            return FileVisitResult.CONTINUE;
        }

        @Override
        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
            final String relativePath = toUri(root.relativize(file));
            // then we don't add it to the uber jar
            if (isBlockOrSF(relativePath) && file.relativize(metaInfDir).getNameCount() == 1) {
                if (log.isDebugEnabled()) {
                    log.debug("Signature file " + file.toAbsolutePath() + " from app " + "dependency " + appDep + " will not be included in uberjar");
                }
                return FileVisitResult.CONTINUE;
            }
            if (!existingEntries.contains(relativePath)) {
                if (UBER_JAR_CONCATENATED_ENTRIES_PREDICATE.test(relativePath) || mergeResourcePaths.contains(relativePath)) {
                    concatenatedEntries.computeIfAbsent(relativePath, (u) -> new ArrayList<>()).add(Files.readAllBytes(file));
                    return FileVisitResult.CONTINUE;
                } else if (!ignoredEntriesPredicate.test(relativePath)) {
                    duplicateCatcher.computeIfAbsent(relativePath, (a) -> new HashSet<>()).add(appDep);
                    if (!seen.containsKey(relativePath)) {
                        seen.put(relativePath, appDep.toString());
                        Files.copy(file, runnerZipFs.getPath(relativePath), StandardCopyOption.REPLACE_EXISTING);
                    }
                }
            }
            return FileVisitResult.CONTINUE;
        }
    });
}
Also used : Path(java.nio.file.Path) Manifest(java.util.jar.Manifest) TransformedClassesBuildItem(io.quarkus.deployment.builditem.TransformedClassesBuildItem) Arrays(java.util.Arrays) BufferedInputStream(java.io.BufferedInputStream) Enumeration(java.util.Enumeration) URL(java.net.URL) UberJarIgnoredResourceBuildItem(io.quarkus.deployment.pkg.builditem.UberJarIgnoredResourceBuildItem) BooleanSupplier(java.util.function.BooleanSupplier) QuarkusBuildCloseablesBuildItem(io.quarkus.deployment.builditem.QuarkusBuildCloseablesBuildItem) Map(java.util.Map) ZipFile(java.util.zip.ZipFile) Path(java.nio.file.Path) ZipEntry(java.util.zip.ZipEntry) EnumSet(java.util.EnumSet) PathVisit(io.quarkus.paths.PathVisit) SimpleFileVisitor(java.nio.file.SimpleFileVisitor) ZipUtils(io.quarkus.fs.util.ZipUtils) Predicate(java.util.function.Predicate) JarBuildItem(io.quarkus.deployment.pkg.builditem.JarBuildItem) Collection(java.util.Collection) StandardOpenOption(java.nio.file.StandardOpenOption) MutableJarApplicationModel(io.quarkus.bootstrap.model.MutableJarApplicationModel) SerializedApplication(io.quarkus.bootstrap.runner.SerializedApplication) Set(java.util.Set) PathVisitor(io.quarkus.paths.PathVisitor) FileSystem(java.nio.file.FileSystem) Attributes(java.util.jar.Attributes) Collectors(java.util.stream.Collectors) AdditionalApplicationArchiveBuildItem(io.quarkus.deployment.builditem.AdditionalApplicationArchiveBuildItem) StandardCharsets(java.nio.charset.StandardCharsets) PackageConfig(io.quarkus.deployment.pkg.PackageConfig) UncheckedIOException(java.io.UncheckedIOException) FileUtil(io.quarkus.deployment.util.FileUtil) FileVisitResult(java.nio.file.FileVisitResult) LegacyJarRequiredBuildItem(io.quarkus.deployment.pkg.builditem.LegacyJarRequiredBuildItem) NativeImageSourceJarBuildItem(io.quarkus.deployment.pkg.builditem.NativeImageSourceJarBuildItem) List(java.util.List) Stream(java.util.stream.Stream) GACT(io.quarkus.maven.dependency.GACT) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) Optional(java.util.Optional) GeneratedNativeImageClassBuildItem(io.quarkus.deployment.builditem.GeneratedNativeImageClassBuildItem) ZipOutputStream(java.util.zip.ZipOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) QuarkusEntryPoint(io.quarkus.bootstrap.runner.QuarkusEntryPoint) Logger(org.jboss.logging.Logger) HashMap(java.util.HashMap) CurateOutcomeBuildItem(io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem) StandardCopyOption(java.nio.file.StandardCopyOption) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) BiPredicate(java.util.function.BiPredicate) BuildStep(io.quarkus.deployment.annotations.BuildStep) IoUtils(io.quarkus.bootstrap.util.IoUtils) ArtifactKey(io.quarkus.maven.dependency.ArtifactKey) ClassLoadingConfig(io.quarkus.deployment.configuration.ClassLoadingConfig) Dependency(io.quarkus.maven.dependency.Dependency) ObjectOutputStream(java.io.ObjectOutputStream) BuildSystemTargetBuildItem(io.quarkus.deployment.pkg.builditem.BuildSystemTargetBuildItem) OutputStream(java.io.OutputStream) GeneratedResourceBuildItem(io.quarkus.deployment.builditem.GeneratedResourceBuildItem) ApplicationArchivesBuildItem(io.quarkus.deployment.builditem.ApplicationArchivesBuildItem) UberJarRequiredBuildItem(io.quarkus.deployment.pkg.builditem.UberJarRequiredBuildItem) Files(java.nio.file.Files) BufferedWriter(java.io.BufferedWriter) SystemUtils(org.apache.commons.lang3.SystemUtils) FileOutputStream(java.io.FileOutputStream) ArtifactResultBuildItem(io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem) IOException(java.io.IOException) FileAlreadyExistsException(java.nio.file.FileAlreadyExistsException) BasicFileAttributes(java.nio.file.attribute.BasicFileAttributes) Consumer(java.util.function.Consumer) ApplicationArchive(io.quarkus.deployment.ApplicationArchive) GeneratedClassBuildItem(io.quarkus.deployment.builditem.GeneratedClassBuildItem) FileVisitOption(java.nio.file.FileVisitOption) Paths(java.nio.file.Paths) OutputTargetBuildItem(io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem) ZipUtils.wrapForJDK8232879(io.quarkus.fs.util.ZipUtils.wrapForJDK8232879) ApplicationInfoBuildItem(io.quarkus.deployment.builditem.ApplicationInfoBuildItem) AppCDSRequestedBuildItem(io.quarkus.deployment.pkg.builditem.AppCDSRequestedBuildItem) UberJarMergedResourceBuildItem(io.quarkus.deployment.pkg.builditem.UberJarMergedResourceBuildItem) Comparator(java.util.Comparator) Collections(java.util.Collections) MainClassBuildItem(io.quarkus.deployment.builditem.MainClassBuildItem) InputStream(java.io.InputStream) FileVisitResult(java.nio.file.FileVisitResult) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) BasicFileAttributes(java.nio.file.attribute.BasicFileAttributes) HashSet(java.util.HashSet)

Example 4 with Dependency

use of io.quarkus.maven.dependency.Dependency in project quarkus by quarkusio.

the class ConditionalDependencyScenarioTwoTest method assertAppModel.

@Override
protected void assertAppModel(ApplicationModel appModel) throws Exception {
    final Set<Dependency> deploymentDeps = appModel.getDependencies().stream().filter(d -> d.isDeploymentCp() && !d.isRuntimeCp()).map(d -> new ArtifactDependency(d)).collect(Collectors.toSet());
    final Set<Dependency> expected = new HashSet<>();
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-f-deployment", TsArtifact.DEFAULT_VERSION), "compile", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-g-deployment", TsArtifact.DEFAULT_VERSION), "compile", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-h-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-k-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-l-deployment", TsArtifact.DEFAULT_VERSION), "compile", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-j-deployment", TsArtifact.DEFAULT_VERSION), "compile", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-m-deployment", TsArtifact.DEFAULT_VERSION), "compile", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-n-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-i-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-o-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-p-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-r-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-s-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-t-deployment", TsArtifact.DEFAULT_VERSION), "compile", DependencyFlags.DEPLOYMENT_CP));
    expected.add(new ArtifactDependency(new GACTV(TsArtifact.DEFAULT_GROUP_ID, "ext-u-deployment", TsArtifact.DEFAULT_VERSION), "runtime", DependencyFlags.DEPLOYMENT_CP));
    assertEquals(expected, new HashSet<>(deploymentDeps));
}
Also used : HashSet(java.util.HashSet) DependencyFlags(io.quarkus.maven.dependency.DependencyFlags) ApplicationModel(io.quarkus.bootstrap.model.ApplicationModel) ArtifactDependency(io.quarkus.maven.dependency.ArtifactDependency) TsQuarkusExt(io.quarkus.bootstrap.resolver.TsQuarkusExt) Set(java.util.Set) BootstrapFromOriginalJarTestBase(io.quarkus.deployment.runnerjar.BootstrapFromOriginalJarTestBase) Dependency(io.quarkus.maven.dependency.Dependency) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) Collectors(java.util.stream.Collectors) GACTV(io.quarkus.maven.dependency.GACTV) ArtifactDependency(io.quarkus.maven.dependency.ArtifactDependency) ArtifactDependency(io.quarkus.maven.dependency.ArtifactDependency) Dependency(io.quarkus.maven.dependency.Dependency) GACTV(io.quarkus.maven.dependency.GACTV) HashSet(java.util.HashSet)

Example 5 with Dependency

use of io.quarkus.maven.dependency.Dependency in project quarkus by quarkusio.

the class PackageAppTestBase method assertExtensionDependencies.

private static void assertExtensionDependencies(ApplicationModel appModel, String[] expectedExtensions) {
    final Set<String> expectedRuntime = new HashSet<>(expectedExtensions.length);
    final Set<String> expectedDeployment = new HashSet<>(expectedExtensions.length);
    for (String rtId : expectedExtensions) {
        expectedRuntime.add(TsArtifact.DEFAULT_GROUP_ID + ":" + rtId + "::jar:" + TsArtifact.DEFAULT_VERSION);
        expectedDeployment.add(TsArtifact.DEFAULT_GROUP_ID + ":" + rtId + "-deployment" + "::jar:" + TsArtifact.DEFAULT_VERSION);
    }
    final Collection<ResolvedDependency> rtDeps = appModel.getRuntimeDependencies();
    for (Dependency dep : rtDeps) {
        final String coords = dep.toGACTVString();
        assertTrue(expectedRuntime.contains(coords), coords);
    }
    assertEquals(expectedExtensions.length, rtDeps.size());
    final List<Dependency> deploymentOnly = appModel.getDependencies().stream().filter(d -> d.isDeploymentCp() && !d.isRuntimeCp()).collect(Collectors.toList());
    for (Dependency dep : deploymentOnly) {
        final String coords = dep.toGACTVString();
        assertTrue(expectedDeployment.contains(coords), coords);
    }
    assertEquals(expectedExtensions.length, deploymentOnly.size());
}
Also used : Assertions.fail(org.junit.jupiter.api.Assertions.fail) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) CuratedApplication(io.quarkus.bootstrap.app.CuratedApplication) Arrays(java.util.Arrays) TsDependency(io.quarkus.bootstrap.resolver.TsDependency) JarFile(java.util.jar.JarFile) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ArtifactDependency(io.quarkus.maven.dependency.ArtifactDependency) AugmentAction(io.quarkus.bootstrap.app.AugmentAction) Dependency(io.quarkus.maven.dependency.Dependency) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Path(java.nio.file.Path) OutputStream(java.io.OutputStream) AugmentResult(io.quarkus.bootstrap.app.AugmentResult) Properties(java.util.Properties) Iterator(java.util.Iterator) Files(java.nio.file.Files) BufferedWriter(java.io.BufferedWriter) Collection(java.util.Collection) Set(java.util.Set) BootstrapConstants(io.quarkus.bootstrap.BootstrapConstants) IOException(java.io.IOException) ContentProvider(io.quarkus.bootstrap.resolver.TsArtifact.ContentProvider) TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) BootstrapTestBase(io.quarkus.bootstrap.resolver.BootstrapTestBase) Attributes(java.util.jar.Attributes) Collectors(java.util.stream.Collectors) List(java.util.List) Stream(java.util.stream.Stream) QuarkusBootstrap(io.quarkus.bootstrap.app.QuarkusBootstrap) ApplicationModel(io.quarkus.bootstrap.model.ApplicationModel) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) Collections(java.util.Collections) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) TsDependency(io.quarkus.bootstrap.resolver.TsDependency) ArtifactDependency(io.quarkus.maven.dependency.ArtifactDependency) Dependency(io.quarkus.maven.dependency.Dependency) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) HashSet(java.util.HashSet)

Aggregations

Dependency (io.quarkus.maven.dependency.Dependency)18 ArtifactDependency (io.quarkus.maven.dependency.ArtifactDependency)13 GACTV (io.quarkus.maven.dependency.GACTV)12 HashSet (java.util.HashSet)12 Collectors (java.util.stream.Collectors)8 TsDependency (io.quarkus.bootstrap.resolver.TsDependency)7 ResolvedDependency (io.quarkus.maven.dependency.ResolvedDependency)7 ArrayList (java.util.ArrayList)6 Set (java.util.Set)6 ApplicationModel (io.quarkus.bootstrap.model.ApplicationModel)5 TsArtifact (io.quarkus.bootstrap.resolver.TsArtifact)5 IOException (java.io.IOException)5 Path (java.nio.file.Path)5 HashMap (java.util.HashMap)5 List (java.util.List)5 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)5 TsQuarkusExt (io.quarkus.bootstrap.resolver.TsQuarkusExt)4 DependencyFlags (io.quarkus.maven.dependency.DependencyFlags)4 Files (java.nio.file.Files)4 CuratedApplication (io.quarkus.bootstrap.app.CuratedApplication)3