/** * Generate internal profile (for the purpose of custom assembly builder) for given <code>stage</code>. * @param stage a {@link Stage} for which the profile is being generated * @param parentProfiles all profiles for given stage will be used as parent profiles * @param repositories repositories to use in generated profile * @param features features to declare in generated profile * @param bundles bundles to declare in generated profile * @return */ private Profile generateProfile(Stage stage, Map<String, Stage> parentProfiles, Map<String, RepositoryInfo> repositories, Map<String, Stage> features, Map<String, Stage> bundles) { String name = "generated-" + stage.name().toLowerCase(); List<String> stagedParentProfiles = getStaged(stage, parentProfiles); if (stagedParentProfiles.isEmpty()) { LOGGER.info("Generating {} profile", name); } else { LOGGER.info("Generating {} profile with parents: {}", name, stagedParentProfiles.stream().collect(Collectors.joining(", "))); } return ProfileBuilder.Factory.create(name) .setParents(stagedParentProfiles) .setRepositories(getStagedRepositories(stage, repositories)) .setFeatures(getStaged(stage, features)) .setBundles(getStaged(stage, bundles)) .getProfile(); }
/** * <p>Turns direct maven dependencies into startup/boot/installed artifacts.</p> * <p>{@link MavenProject#getDependencyArtifacts()} is deprecated, but we don't want (?) transitive * dependencies given by {@link MavenProject#getArtifacts()}.</p> */ @SuppressWarnings("deprecation") private void processDirectMavenDependencies() { for (Artifact artifact : project.getDependencyArtifacts()) { Builder.Stage stage = Builder.Stage.fromMavenScope(artifact.getScope()); if (stage == null) { continue; } String uri = artifactToMvn(artifact); switch (getType(artifact)) { case "kar": addUris(stage, uri, startupKars, bootKars, installedKars); break; case "features": addUris(stage, uri, startupRepositories, bootRepositories, installedRepositories); break; case "bundle": addUris(stage, uri, startupBundles, bootBundles, installedBundles); break; } } }
/** * Generate internal profile (for the purpose of custom assembly builder) for given <code>stage</code>. * @param stage a {@link Stage} for which the profile is being generated * @param parentProfiles all profiles for given stage will be used as parent profiles * @param repositories repositories to use in generated profile * @param features features to declare in generated profile * @param bundles bundles to declare in generated profile * @return */ private Profile generateProfile(Stage stage, Map<String, Stage> parentProfiles, Map<String, RepositoryInfo> repositories, Map<String, Stage> features, Map<String, Stage> bundles) { String name = "generated-" + stage.name().toLowerCase(); List<String> stagedParentProfiles = getStaged(stage, parentProfiles); if (stagedParentProfiles.isEmpty()) { LOGGER.info("Generating {} profile", name); } else { LOGGER.info("Generating {} profile with parents: {}", name, stagedParentProfiles.stream().collect(Collectors.joining(", "))); } return ProfileBuilder.Factory.create(name) .setParents(stagedParentProfiles) .setRepositories(getStagedRepositories(stage, repositories)) .setFeatures(getStaged(stage, features)) .setBundles(getStaged(stage, bundles)) .getProfile(); }
/** * <p>Turns direct maven dependencies into startup/boot/installed artifacts.</p> * <p>{@link MavenProject#getDependencyArtifacts()} is deprecated, but we don't want (?) transitive * dependencies given by {@link MavenProject#getArtifacts()}.</p> */ @SuppressWarnings("deprecation") private void processDirectMavenDependencies() { for (Artifact artifact : project.getDependencyArtifacts()) { Builder.Stage stage = Builder.Stage.fromMavenScope(artifact.getScope()); if (stage == null) { continue; } String uri = artifactToMvn(artifact); switch (getType(artifact)) { case "kar": addUris(stage, uri, startupKars, bootKars, installedKars); break; case "features": addUris(stage, uri, startupRepositories, bootRepositories, installedRepositories); break; case "bundle": addUris(stage, uri, startupBundles, bootBundles, installedBundles); break; } } }