From cbe964d3035270d28aa50bcc32e16c05b7ef174e Mon Sep 17 00:00:00 2001 From: Carter Cundiff Date: Wed, 30 Oct 2024 17:07:15 -0400 Subject: [PATCH] #434 Create baton migration for Quarkus Java 17 upgrade --- DRAFT_RELEASE_NOTES.md | 57 ++++-- bom/bom-component/pom.xml | 2 +- foundation/foundation-drift-detection/pom.xml | 2 +- .../cucumber.test.cdi.context.java.vm | 6 +- .../data-delivery-pyspark/pipeline.pom.xml.vm | 2 +- .../data-delivery-spark/pipeline.pom.xml.vm | 2 +- .../v2/lineage.custom.consumer.chart.yaml.vm | 2 +- .../migration/AbstractPomMigration.java | 63 ++++++ .../v1_10_0/DeltaSparkPomMigration.java | 43 +--- .../v1_10_0/JavaPackageMigration.java | 89 ++++++++ .../PomDependencyVersionMigration.java | 139 +++++++++++++ .../v1_10_0/QuarkusBomMigration.java | 83 ++++++++ ...kPipelineMessagingCdiFactoryMigration.java | 13 -- .../SparkPipelineMessagingPomMigration.java | 13 -- .../SparkPipelineServletApiMigration.java | 65 ++++++ .../src/main/resources/migrations.json | 39 ++++ .../v1_10_0/JavaPackageMigrationSteps.java | 46 +++++ .../PomDependencyVersionMigrationSteps.java | 56 +++++ .../v1_10_0/QuarkusBomMigrationSteps.java | 45 ++++ ...SparkPipelineServletApiMigrationSteps.java | 52 +++++ .../v1_10_0/java-package-migration.feature | 11 + .../pom-dependency-version-migration.feature | 25 +++ .../v1_10_0/quarkus-bom-migration.feature | 16 ++ ...ark-pipeline-servlet-api-migration.feature | 18 ++ .../migration/allClasses.java | 65 ++++++ .../validation/allClasses.java | 65 ++++++ .../migration/all-dependencies-pom.xml | 91 +++++++++ .../dependency-management-profile-pom.xml | 180 ++++++++++++++++ .../migration/skip-pom.xml | 58 ++++++ .../validation/all-dependencies-pom.xml | 97 +++++++++ .../dependency-management-profile-pom.xml | 192 ++++++++++++++++++ .../migration/quarkus-bom-pom.xml | 66 ++++++ .../migration/quarkus-universe-bom-pom.xml | 66 ++++++ .../validation/quarkus-bom-pom.xml | 68 +++++++ .../validation/quarkus-universe-bom-pom.xml | 68 +++++++ .../migration/pom.xml | 70 +++++++ .../skip/pom.xml | 70 +++++++ .../validation/pom.xml | 77 +++++++ pom.xml | 6 + .../pom.xml | 2 +- .../pom.xml | 2 +- 41 files changed, 2039 insertions(+), 93 deletions(-) create mode 100644 foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/JavaPackageMigration.java create mode 100644 foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/PomDependencyVersionMigration.java create mode 100644 foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/QuarkusBomMigration.java create mode 100644 foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineServletApiMigration.java create mode 100644 foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/JavaPackageMigrationSteps.java create mode 100644 foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/PomDependencyVersionMigrationSteps.java create mode 100644 foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/QuarkusBomMigrationSteps.java create mode 100644 foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineServletApiMigrationSteps.java create mode 100644 foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/java-package-migration.feature create mode 100644 foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/pom-dependency-version-migration.feature create mode 100644 foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/quarkus-bom-migration.feature create mode 100644 foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/spark-pipeline-servlet-api-migration.feature create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/JavaPackageMigration/migration/allClasses.java create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/JavaPackageMigration/validation/allClasses.java create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/all-dependencies-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/dependency-management-profile-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/skip-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/validation/all-dependencies-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/validation/dependency-management-profile-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/migration/quarkus-bom-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/migration/quarkus-universe-bom-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/validation/quarkus-bom-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/validation/quarkus-universe-bom-pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/migration/pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/skip/pom.xml create mode 100644 foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/validation/pom.xml diff --git a/DRAFT_RELEASE_NOTES.md b/DRAFT_RELEASE_NOTES.md index 3e6f08b30..b3c6719bb 100644 --- a/DRAFT_RELEASE_NOTES.md +++ b/DRAFT_RELEASE_NOTES.md @@ -1,12 +1,13 @@ # Major Additions -## TBD +## Java 17 Upgrade +The aiSSEMBLE project is now built with Java 17. All dependencies inherited from aiSSEMBLE have been updated to a Java 17 compatible version and automatic migrations (detailed below) have been created to streamline this transition for downstream projects. It is recommended to review non-inherited dependencies and custom logic within your project, as this upgrade can break existing functionality due to deprecated classes and incompatible dependencies. # Breaking Changes -- Note: instructions for adapting to these changes are outlined in the upgrade instructions below. - -With the upgrade to Java 17, the new minimum required Maven version is now 3.9.6. This can result in deprecated classes or incompatible dependencies, please update your modules accordingly. +Note: instructions for adapting to these changes are outlined in the upgrade instructions below. +- All upgrading projects must be built with Java 17 to ensure compatibility with this release. +- The new minimum required Maven version is now `3.9.6` to ensure compatibility with Java 17. # Known Issues _There are no known issues with the 1.10 release._ @@ -17,7 +18,7 @@ _There are no known issues with the 1.10 release._ # How to Upgrade -The following steps will upgrade your project to 1.10. These instructions consist of multiple phases: +The following steps will upgrade your project to `1.10`. These instructions consist of multiple phases: - Automatic Upgrades - no manual action required - Precondition Steps - needed in all situations - Conditional Steps (e.g., Python steps, Java steps, if you use Metadata, etc) @@ -31,11 +32,15 @@ To reduce burden of upgrading aiSSEMBLE, the Baton project is used to automate t | upgrade-tiltfile-aissemble-version-migration | Updates the aiSSEMBLE version within your project's Tiltfile | | upgrade-v2-chart-files-aissemble-version-migration | Updates the Helm chart dependencies within your project's deployment resources (`-deploy/src/main/resources/apps/`) to use the latest version of the aiSSEMBLE | | upgrade-v1-chart-files-aissemble-version-migration | Updates the docker image tags within your project's deployment resources (`-deploy/src/main/resources/apps/`) to use the latest version of the aiSSEMBLE | -| spark-version-upgrade-migration | Updates the Spark Application executor failure parameters to their new key name to ensure compatibility with spark `3.5` | +| spark-version-upgrade-migration | Updates the Spark Application executor failure parameters to their new key name to ensure compatibility with Apache Spark `3.5` | | spark-pipeline-messaging-pom-migration | Updates a Spark pipeline module `pom.xml` with the new CDI classes dependency to ensure messaging compatibility with Java 17 | | spark-pipeline-messaging-cdi-factory-migration | Updates a Spark pipeline module `CdiContainerFactory.java` with the new CDI classes to ensure messaging compatibility with Java 17 | +| spark-pipeline-servlet-api-migration | Updates a Spark pipeline module `pom.xml` with the `javax.servlet-api` dependency to ensure compatibility with Apache Spark `3.5` which has not migrated to Jakarta packages yet | | it-infrastructure-java-upgrade-migration | Updates the Java docker image version in the integration test docker module to JDK 17 | -| log4j-maven-shade-plugin-migration | Updates the Maven Shade Plugin with the new Log4j dependency information | +| log4j-maven-shade-plugin-migration | Updates the Maven Shade Plugin with the new Log4j dependency information | +| quarkus-bom-migration | Updates all references to the `quarkus-bom` and `quarkus-universe-bom` to use the new `aissemble-quarkus-bom` for managing Quarkus dependencies | +| pom-dependency-version-migration | Updates the pom dependencies previously managed by the aiSSEMBLE `bom-component` to include their necessary versions | +| java-package-migration | Updates the affected java classes from their old package name to their new package name to ensure compatibility with the updated Java 17 dependencies. This migration primarily updates `javax.*` packages to their new `jakarta.*` packages | To deactivate any of these migrations, add the following configuration to the `baton-maven-plugin` within your root `pom.xml`: @@ -63,13 +68,28 @@ To deactivate any of these migrations, add the following configuration to the `b ### Beginning the Upgrade To start your aiSSEMBLE upgrade, update your project's pom.xml to use the 1.10.0 version of the build-parent: - ```xml - - com.boozallen.aissemble - build-parent - 1.10.0 - - ``` +```xml + + com.boozallen.aissemble + build-parent + 1.10.0 + +``` + +### BOM Component Replacement +All references to the `com.boozallen.aissemble:bom-component` should be replaced with the new `com.boozallen.aissemble:aissemble-quarkus-bom`: +```diff + + com.boozallen.aissemble +- bom-component ++ aissemble-quarkus-bom + ${version.aissemble} + pom + import + +``` + +## Conditional Steps ### Split Data Records for the Spark Pipeline If your spark pipeline is using `aissemble-data-records-separate-module` profile for your data records, you must add the `` tag for @@ -82,9 +102,6 @@ the `jackson-mapper-asl` dependency artifact in the root pom.xml file to enable ``` - -## Conditional Steps - ### Kafka Clients Dependency Update Data Access and the Java testing module (`-tests/-tests-java/pom.xml`) no longer need to explicitly set the `kafka-clients` dependency. It can be removed along with its exclusion from the `quarkus-smallrye-reactive-messaging-kafka` dependency. @@ -95,9 +112,11 @@ If you added any custom configurations to the `sparkoperator` service account pe ## Final Steps - Required for All Projects ### Finalizing the Upgrade 1. Run `./mvnw org.technologybrewery.baton:baton-maven-plugin:baton-migrate` to apply the automatic migrations -2. Run `./mvnw clean install` and resolve any manual actions that are suggested +2. Remove the `com.boozallen.aissemble:aissemble-quarkus-bom:${version.aissemble}` dependency from the root `pom.xml` and `-tests/-tests-java/pom.xml` of your project + - **NOTE:** Any Quarkus apps within your project should be updated to include the `com.boozallen.aissemble:aissemble-quarkus-bom:${version.aissemble}` within the `` section of their respective `pom.xml` instead +3. Run `./mvnw clean install` and resolve any manual actions that are suggested - **NOTE:** This will update any aiSSEMBLE dependencies in 'pyproject.toml' files automatically -3. Repeat the previous step until all manual actions are resolved +4. Repeat the previous step until all manual actions are resolved # What's Changed - `pyproject.toml` files updated to allow for Python version `>=3.8`. diff --git a/bom/bom-component/pom.xml b/bom/bom-component/pom.xml index f5a43eb5d..6a7b83b29 100644 --- a/bom/bom-component/pom.xml +++ b/bom/bom-component/pom.xml @@ -94,7 +94,7 @@ org.apache.commons commons-math3 - 3.6.1 + ${version.commons.math} org.postgresql diff --git a/foundation/foundation-drift-detection/pom.xml b/foundation/foundation-drift-detection/pom.xml index f8f626244..88fb6adc9 100644 --- a/foundation/foundation-drift-detection/pom.xml +++ b/foundation/foundation-drift-detection/pom.xml @@ -47,7 +47,7 @@ org.apache.commons commons-math3 - 3.6.1 + ${version.commons.math} diff --git a/foundation/foundation-mda/src/main/resources/templates/cucumber.test.cdi.context.java.vm b/foundation/foundation-mda/src/main/resources/templates/cucumber.test.cdi.context.java.vm index cc3afabe7..536aec7b1 100644 --- a/foundation/foundation-mda/src/main/resources/templates/cucumber.test.cdi.context.java.vm +++ b/foundation/foundation-mda/src/main/resources/templates/cucumber.test.cdi.context.java.vm @@ -15,7 +15,7 @@ import io.smallrye.reactive.messaging.memory.InMemoryConnector; * * Originally generated from: ${templateName} */ -public class TestCdiContext extends PipelinesCdiContext { +public class TestCdiContext implements CdiContext { @Override public List> getCdiClasses() { @@ -24,4 +24,8 @@ public class TestCdiContext extends PipelinesCdiContext { return classes; } + @Override + public List getExtensions() { + return Collections.emptyList(); + } } diff --git a/foundation/foundation-mda/src/main/resources/templates/data-delivery-pyspark/pipeline.pom.xml.vm b/foundation/foundation-mda/src/main/resources/templates/data-delivery-pyspark/pipeline.pom.xml.vm index 01dd48463..fafa0f5ab 100644 --- a/foundation/foundation-mda/src/main/resources/templates/data-delivery-pyspark/pipeline.pom.xml.vm +++ b/foundation/foundation-mda/src/main/resources/templates/data-delivery-pyspark/pipeline.pom.xml.vm @@ -76,7 +76,7 @@ org.apache.commons commons-math3 - 3.6.1 + ${version.commons.math} com.boozallen.aissemble diff --git a/foundation/foundation-mda/src/main/resources/templates/data-delivery-spark/pipeline.pom.xml.vm b/foundation/foundation-mda/src/main/resources/templates/data-delivery-spark/pipeline.pom.xml.vm index 84cd2c4c0..42a4f6f67 100644 --- a/foundation/foundation-mda/src/main/resources/templates/data-delivery-spark/pipeline.pom.xml.vm +++ b/foundation/foundation-mda/src/main/resources/templates/data-delivery-spark/pipeline.pom.xml.vm @@ -149,7 +149,7 @@ javax.servlet javax.servlet-api - 3.1.0 + ${version.javax.servlet} #if ($pipeline.isAlertingSupportNeeded()) diff --git a/foundation/foundation-mda/src/main/resources/templates/deployment/lineage-custom-consumer/v2/lineage.custom.consumer.chart.yaml.vm b/foundation/foundation-mda/src/main/resources/templates/deployment/lineage-custom-consumer/v2/lineage.custom.consumer.chart.yaml.vm index 6fcbe1261..5ee741018 100644 --- a/foundation/foundation-mda/src/main/resources/templates/deployment/lineage-custom-consumer/v2/lineage.custom.consumer.chart.yaml.vm +++ b/foundation/foundation-mda/src/main/resources/templates/deployment/lineage-custom-consumer/v2/lineage.custom.consumer.chart.yaml.vm @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: ${verion} +version: ${version} # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/AbstractPomMigration.java b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/AbstractPomMigration.java index b07f5f0d4..df3e6366c 100644 --- a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/AbstractPomMigration.java +++ b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/AbstractPomMigration.java @@ -9,15 +9,28 @@ * #L% */ import org.apache.commons.lang3.StringUtils; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.InputLocation; +import org.apache.maven.model.InputLocationTracker; +import org.apache.maven.model.Model; +import org.apache.maven.model.ModelBase; +import org.apache.maven.model.Profile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.technologybrewery.baton.BatonException; +import org.technologybrewery.baton.util.pom.PomModifications; import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; import java.util.stream.Stream; +import static org.technologybrewery.baton.util.pom.LocationAwareMavenReader.END; + public abstract class AbstractPomMigration extends AbstractAissembleMigration { protected static final Logger logger = LoggerFactory.getLogger(AbstractPomMigration.class); @@ -40,4 +53,54 @@ protected void detectAndSetIndent(File file) { throw new BatonException("Failed to get indent from POM:" + file, e); } } + + /** + * Checks if a given pom model contains any dependencies with a provided group ID and artifact ID + */ + protected boolean hasDependency(Model model, String groupId, String artifactId) { + return model.getDependencies() + .stream() + .anyMatch(dependency -> + dependency.getGroupId().equals(groupId) && + dependency.getArtifactId().contains(artifactId) + ); + } + + /** + * Checks the dependency and dependency management section of a given pom model and all profiles for any matches + */ + protected List getMatchingDependenciesForProject(Model model, Predicate filter) { + List matchingDependencies = this.getMatchingDependencies(model, filter); + for (Profile profile : model.getProfiles()) { + matchingDependencies.addAll(this.getMatchingDependencies(profile, filter)); + } + return matchingDependencies; + } + + /** + * Checks the dependency and dependency management section of a given pom model for any matches + */ + private List getMatchingDependencies(ModelBase model, Predicate filter) { + List matchingDependencies = new ArrayList<>(); + + Stream.concat( + model.getDependencies() + .stream() + .filter(filter), + Optional.ofNullable(model.getDependencyManagement()).map(dependencyManagement -> dependencyManagement.getDependencies() + .stream() + .filter(filter)) + .orElse(Stream.empty()) + ) + .forEach(matchingDependencies::add); + + return matchingDependencies; + } + + protected static PomModifications.Replacement replaceInTag(InputLocationTracker container, String tag, String contents) { + InputLocation start = container.getLocation(tag); + InputLocation end = container.getLocation(tag + END); + end = new InputLocation(end.getLineNumber(), end.getColumnNumber() - tag.length() - "".length(), end.getSource()); + return new PomModifications.Replacement(start, end, contents); + } } \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/DeltaSparkPomMigration.java b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/DeltaSparkPomMigration.java index 2822c3bc1..cfde7f0c8 100644 --- a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/DeltaSparkPomMigration.java +++ b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/DeltaSparkPomMigration.java @@ -10,15 +10,10 @@ * #L% */ -import com.boozallen.aissemble.upgrade.migration.AbstractAissembleMigration; +import com.boozallen.aissemble.upgrade.migration.AbstractPomMigration; import org.apache.commons.lang3.StringUtils; import org.apache.maven.model.Dependency; -import org.apache.maven.model.DependencyManagement; -import org.apache.maven.model.InputLocation; -import org.apache.maven.model.InputLocationTracker; import org.apache.maven.model.Model; -import org.apache.maven.model.ModelBase; -import org.apache.maven.model.Profile; import org.technologybrewery.baton.BatonException; import org.technologybrewery.baton.util.FileUtils; import org.technologybrewery.baton.util.pom.PomHelper; @@ -26,7 +21,6 @@ import java.io.File; import java.io.IOException; -import java.util.ArrayList; import java.util.List; import static org.technologybrewery.baton.util.pom.LocationAwareMavenReader.END; @@ -38,7 +32,7 @@ * to 3.x also involves a rename of the delta-core_[SCALA-VER] dependency to delta-spark_[SCALA_VER]. This migration * renames this dependency, and ensures that the version is being pulled from build-parent. */ -public class DeltaSparkPomMigration extends AbstractAissembleMigration { +public class DeltaSparkPomMigration extends AbstractPomMigration { public static final String ARTIFACT_ID = "artifactId"; public static final String DELTA_VERSION = "${version.delta}"; @@ -55,7 +49,7 @@ protected boolean shouldExecuteOnFile(File file) { @Override protected boolean performMigration(File file) { Model model = PomHelper.getLocationAnnotatedModel(file); - List deltaCoreDependencies = getDeltaCoreDependenciesForProject(model); + List deltaCoreDependencies = this.getMatchingDependenciesForProject(model, DeltaSparkPomMigration::isDeltaCore); PomModifications modifications = new PomModifications(); for (Dependency dependency : deltaCoreDependencies) { String artifactId = dependency.getArtifactId(); @@ -77,38 +71,7 @@ protected boolean performMigration(File file) { return true; } - private List getDeltaCoreDependenciesForProject(Model model) { - List deltaCoreDependencies = getDeltaCoreDependencies(model); - for (Profile profile : model.getProfiles()) { - deltaCoreDependencies.addAll(getDeltaCoreDependencies(profile)); - } - return deltaCoreDependencies; - } - - private List getDeltaCoreDependencies(ModelBase model) { - List deltaCoreDependencies = new ArrayList<>(); - DependencyManagement dependencyManagement = model.getDependencyManagement(); - if (dependencyManagement != null) { - dependencyManagement.getDependencies() - .stream() - .filter(DeltaSparkPomMigration::isDeltaCore) - .forEach(deltaCoreDependencies::add); - } - model.getDependencies() - .stream() - .filter(DeltaSparkPomMigration::isDeltaCore) - .forEach(deltaCoreDependencies::add); - return deltaCoreDependencies; - } - private static boolean isDeltaCore(Dependency dep) { return dep.getGroupId().equals("io.delta") && dep.getArtifactId().startsWith("delta-core_"); } - - private static PomModifications.Replacement replaceInTag(InputLocationTracker container, String tag, String contents) { - InputLocation start = container.getLocation(tag); - InputLocation end = container.getLocation(tag + END); - end = new InputLocation(end.getLineNumber(), end.getColumnNumber() - tag.length() - "".length(), end.getSource()); - return new PomModifications.Replacement(start, end, contents); - } } diff --git a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/JavaPackageMigration.java b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/JavaPackageMigration.java new file mode 100644 index 000000000..fba25dcb1 --- /dev/null +++ b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/JavaPackageMigration.java @@ -0,0 +1,89 @@ +package com.boozallen.aissemble.upgrade.migration.v1_10_0; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Arrays; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.technologybrewery.baton.BatonException; + +import com.boozallen.aissemble.upgrade.migration.AbstractAissembleMigration; + +import static java.util.Map.entry; + +/** + * Updates the affected java classes from their old package name to their new package name + * to ensure compatibility with the updated Java 17 dependencies + */ +public class JavaPackageMigration extends AbstractAissembleMigration { + private static final Logger logger = LoggerFactory.getLogger(JavaPackageMigration.class); + private static final Map JAVA_PACKAGES = Map.ofEntries( + entry("javax.activation", "jakarta.activation"), + entry("javax.annotation", "jakarta.annotation"), + entry("javax.batch", "jakarta.batch"), + entry("javax.data", "jakarta.data"), + entry("javax.decorator", "jakarta.decorator"), + entry("javax.ejb", "jakarta.ejb"), + entry("javax.el", "jakarta.el"), + entry("javax.enterprise", "jakarta.enterprise"), + entry("javax.faces", "jakarta.faces"), + entry("javax.inject", "jakarta.inject"), + entry("javax.interceptor", "jakarta.interceptor"), + entry("javax.jms", "jakarta.jms"), + entry("javax.json", "jakarta.json"), + entry("javax.mail", "jakarta.mail"), + entry("javax.persistence", "jakarta.persistence"), + entry("javax.resource", "jakarta.resource"), + entry("javax.security", "jakarta.security"), + entry("javax.servlet", "jakarta.servlet"), + entry("javax.transaction", "jakarta.transaction"), + entry("javax.validation", "jakarta.validation"), + entry("javax.websocket", "jakarta.websocket"), + entry("javax.ws", "jakarta.ws"), + entry("io.smallrye.reactive.messaging.providers.connectors.InMemoryConnector", "io.smallrye.reactive.messaging.memory.InMemoryConnector"), + entry("io.smallrye.reactive.messaging.providers.connectors.InMemorySink", "io.smallrye.reactive.messaging.memory.InMemorySink") + ); + + @Override + protected boolean shouldExecuteOnFile(File file) { + try { + String fileContent = Files.readString(file.toPath()); + + return JAVA_PACKAGES.keySet().stream() + .anyMatch(packageName -> fileContent.contains(packageName)); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + protected boolean performMigration(File file) { + logger.info("Migrating file to update java class packages: {}", file.getAbsolutePath()); + try { + String fileContent = Files.readString(file.toPath()); + + for (Map.Entry packageEntry : JAVA_PACKAGES.entrySet()) { + fileContent = fileContent.replace(packageEntry.getKey(), packageEntry.getValue()); + } + + Files.writeString(file.toPath(), fileContent); + return true; + } catch (IOException e) { + throw new BatonException("Failed to update Java file with new class package", e); + } + } + +} diff --git a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/PomDependencyVersionMigration.java b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/PomDependencyVersionMigration.java new file mode 100644 index 000000000..f7bf55e57 --- /dev/null +++ b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/PomDependencyVersionMigration.java @@ -0,0 +1,139 @@ +package com.boozallen.aissemble.upgrade.migration.v1_10_0; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import com.boozallen.aissemble.upgrade.migration.AbstractPomMigration; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Model; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.technologybrewery.baton.util.pom.PomHelper; +import org.technologybrewery.baton.util.pom.PomModifications; + +import static org.technologybrewery.baton.util.pom.LocationAwareMavenReader.END; +import static org.technologybrewery.baton.util.pom.LocationAwareMavenReader.START; + +/** + * Updates the pom dependencies previously managed by the aiSSEMBLE bom-component to include their necessary versions + */ +public class PomDependencyVersionMigration extends AbstractPomMigration { + private static final Logger logger = LoggerFactory.getLogger(PomDependencyVersionMigration.class); + private static final List DEPENDENCIES_TO_UPDATE = Arrays.asList( + dependency("org.scala-lang", "scala-reflect", "${version.scala}"), + dependency("org.apache.commons", "commons-math3", "${version.commons.math}"), + dependency("io.smallrye.reactive", "smallrye-reactive-messaging-kafka", "${version.smallrye.reactive.messaging}"), + dependency("io.smallrye.reactive", "smallrye-reactive-messaging-in-memory", "${version.smallrye.reactive.messaging}"), + dependency("junit", "junit", "${version.junit}"), + dependency("org.jboss.resteasy", "resteasy-client", "${version.resteasy}"), + dependency("org.jboss.resteasy", "resteasy-jackson2-provider", "${version.resteasy}"), + dependency("org.awaitility", "awaitility", "${version.awaitility}"), + dependency("io.vertx", "vertx-core", "${version.vertx}"), + dependency("io.smallrye.config", "smallrye-config", "${version.smallrye.config}"), + dependency("org.slf4j", "slf4j-api", "${version.slf4j}"), + dependency("org.slf4j", "slf4j-simple", "${version.slf4j}") + ); + + @Override + protected boolean shouldExecuteOnFile(File pomFile) { + Model model = PomHelper.getLocationAnnotatedModel(pomFile); + return !this.getMatchingDependenciesWithDifferentVersionsForProject(model).isEmpty(); + } + + @Override + protected boolean performMigration(File pomFile) { + logger.info("Migrating file to latest aiSSEMBLE dependency versions: {}", pomFile.getAbsolutePath()); + Model model = PomHelper.getLocationAnnotatedModel(pomFile); + List matchingDependencies = getMatchingDependenciesWithDifferentVersionsForProject(model); + PomModifications modifications = new PomModifications(); + + for (Dependency matchingDependency: matchingDependencies) { + String updatedVersion = getUpdatedDependencyVersion(matchingDependency); + + // Replace the version in place + if (matchingDependency.getVersion() != null) { + modifications.add(replaceInTag(matchingDependency, "version", updatedVersion)); + } + // Add a new version tag + else { + int indentSize = matchingDependency.getLocation("artifactId" + START).getColumnNumber() - 1; + // assumes spaces instead of tabs, but accounting for tabs would be more trouble than it's worth IMO + String indent = StringUtils.repeat(' ', indentSize); + modifications.add(new PomModifications.Insertion(matchingDependency.getLocation(END), 0, + ignore -> indent + "" + updatedVersion + "\n")); + } + } + + if (!modifications.isEmpty()) { + PomHelper.writeModifications(pomFile, modifications.finalizeMods()); + } + return true; + } + + private static Dependency dependency(String groupId, String artifactId, String version) { + Dependency dependency = new Dependency(); + dependency.setGroupId(groupId); + dependency.setArtifactId(artifactId); + dependency.setVersion(version); + return dependency; + } + + /** + * Returns a list of any dependencies that need to be updated with a new version + */ + private List getMatchingDependenciesWithDifferentVersionsForProject(Model model) { + List matchingDependencies = new ArrayList<>(); + + // Get all dependencies in the project + this.getMatchingDependenciesForProject(model, dependency -> true).stream() + .filter(this::dependencyRequiresUpdate) + .forEach(matchingDependencies::add); + + return matchingDependencies; + } + + /** + * Checks if given dependency matches group id and artifact id but not version of the updated dependency + */ + private boolean dependencyRequiresUpdate(Dependency dependency) { + return DEPENDENCIES_TO_UPDATE.stream() + .filter(updatedDependency -> this.isMatchingDependency(dependency, updatedDependency)) + // Return true if the version is not specified (null) or the version is specified but different + .anyMatch(updatedDependency -> + (dependency.getVersion() == null || !dependency.getVersion().equals(updatedDependency.getVersion()) + )); + } + + /** + * Checks if two given dependencies match group id and artifact id + */ + private boolean isMatchingDependency(Dependency dependency1, Dependency dependency2) { + return dependency1.getGroupId().equals(dependency2.getGroupId()) && + dependency1.getArtifactId().contains(dependency2.getArtifactId()); + } + + /** + * Returns the updated version for the matching dependency + */ + private String getUpdatedDependencyVersion(Dependency dependency) { + return DEPENDENCIES_TO_UPDATE.stream() + .filter(updatedDependency -> this.isMatchingDependency(updatedDependency, dependency)) + .map(Dependency::getVersion) + .findFirst() + .orElseThrow(); + } +} \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/QuarkusBomMigration.java b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/QuarkusBomMigration.java new file mode 100644 index 000000000..3638589b9 --- /dev/null +++ b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/QuarkusBomMigration.java @@ -0,0 +1,83 @@ +package com.boozallen.aissemble.upgrade.migration.v1_10_0; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import java.io.File; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Model; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.technologybrewery.baton.util.pom.PomHelper; +import org.technologybrewery.baton.util.pom.PomModifications; + +import com.boozallen.aissemble.upgrade.migration.AbstractPomMigration; + +import static org.technologybrewery.baton.util.pom.LocationAwareMavenReader.END; +import static org.technologybrewery.baton.util.pom.LocationAwareMavenReader.START; + +/** + * Updates all references to the quarkus-bom and quarkus-universe-bom to use the new + * aissemble-quarkus-bom for managing Quarkus dependencies + */ +public class QuarkusBomMigration extends AbstractPomMigration { + private static final Logger logger = LoggerFactory.getLogger(QuarkusBomMigration.class); + private static final String AISSEMBLE_GROUP_ID = "com.boozallen.aissemble"; + private static final String AISSEMBLE_QUARKUS_BOM_ARTIFACT_ID = "aissemble-quarkus-bom"; + private static final String AISSEMBLE_VERSION = "${version.aissemble}"; + + @Override + protected boolean shouldExecuteOnFile(File pomFile) { + Model model = PomHelper.getLocationAnnotatedModel(pomFile); + return !this.getMatchingDependenciesForProject(model, QuarkusBomMigration::isQuarkusBom).isEmpty(); + } + + @Override + protected boolean performMigration(File pomFile) { + logger.info("Migrating file to aiSSEMBLE Quarkus BOM: {}", pomFile.getAbsolutePath()); + Model model = PomHelper.getLocationAnnotatedModel(pomFile); + List quarkusBomDependencies = this.getMatchingDependenciesForProject(model, QuarkusBomMigration::isQuarkusBom); + PomModifications modifications = new PomModifications(); + + for (Dependency dependency : quarkusBomDependencies) { + + // Update the group and artifact ID + modifications.add(replaceInTag(dependency, "groupId", AISSEMBLE_GROUP_ID)); + modifications.add(replaceInTag(dependency, "artifactId", AISSEMBLE_QUARKUS_BOM_ARTIFACT_ID)); + + // Update/add the version + if (dependency.getLocation("version") != null) { + modifications.add(replaceInTag(dependency, "version", AISSEMBLE_VERSION)); + } else { + int indentSize = dependency.getLocation("artifactId" + START).getColumnNumber() - 1; + // assumes spaces instead of tabs, but accounting for tabs would be more trouble than it's worth IMO + String indent = StringUtils.repeat(' ', indentSize); + modifications.add(new PomModifications.Insertion(dependency.getLocation(END), 0, + ignore -> indent + "" + AISSEMBLE_VERSION + "\n")); + } + } + if (!modifications.isEmpty()) { + PomHelper.writeModifications(pomFile, modifications.finalizeMods()); + } + return true; + } + + /** + * Determines whether the given dependency is of type quarkus-bom or quarkus-universe-bom + */ + private static boolean isQuarkusBom(Dependency dependency) { + return dependency.getGroupId().equals("io.quarkus") && + (dependency.getArtifactId().equals("quarkus-bom") || dependency.getArtifactId().equals("quarkus-universe-bom")); + } + +} diff --git a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineMessagingCdiFactoryMigration.java b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineMessagingCdiFactoryMigration.java index ab07118b6..b0277d96c 100644 --- a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineMessagingCdiFactoryMigration.java +++ b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineMessagingCdiFactoryMigration.java @@ -135,17 +135,4 @@ private boolean migrateCdiContainerFactoryFile(File file, boolean addKafkaCdiCon throw new BatonException("Failed to update the file with the new CDI context object(s): " + file.getAbsolutePath(), e); } } - - - /** - * Checks if a given pom model contains any dependencies with a provided group ID and artifact ID - */ - private boolean hasDependency(Model model, String groupId, String artifactId) { - return model.getDependencies() - .stream() - .anyMatch(dependency -> - dependency.getGroupId().equals(groupId) && - dependency.getArtifactId().contains(artifactId) - ); - } } diff --git a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineMessagingPomMigration.java b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineMessagingPomMigration.java index 2113c1cc1..d690b1916 100644 --- a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineMessagingPomMigration.java +++ b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineMessagingPomMigration.java @@ -31,7 +31,6 @@ public class SparkPipelineMessagingPomMigration extends AbstractPomMigration { private static final Logger logger = LoggerFactory.getLogger(SparkPipelineMessagingPomMigration.class); private static final String SMALLRYE_REACTIVE_MESSAGING_GROUP_ID = "io.smallrye.reactive"; - private static final String SMALLRYE_REACTIVE_MESSAGING_ARTIFACT_ID = "smallrye-reactive-messaging"; private static final String SMALLRYE_REACTIVE_MESSAGING_KAFKA_ARTIFACT_ID = "smallrye-reactive-messaging-kafka"; private static final String AISSEMBLE_GROUP_ID = "com.boozallen.aissemble"; @@ -66,18 +65,6 @@ protected boolean performMigration(File pomFile) { return PomHelper.writeModifications(pomFile, modifications.finalizeMods()); } - /** - * Checks if a given pom model contains any dependencies with a provided group ID and artifact ID - */ - private boolean hasDependency(Model model, String groupId, String artifactId) { - return model.getDependencies() - .stream() - .anyMatch(dependency -> - dependency.getGroupId().equals(groupId) && - dependency.getArtifactId().contains(artifactId) - ); - } - private String getDependencyContent(String ignore) { return repeat(indent, 2) + "\n" + repeat(indent, 3) + "" + AISSEMBLE_GROUP_ID + "\n" + diff --git a/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineServletApiMigration.java b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineServletApiMigration.java new file mode 100644 index 000000000..9de17b204 --- /dev/null +++ b/foundation/foundation-upgrade/src/main/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineServletApiMigration.java @@ -0,0 +1,65 @@ +package com.boozallen.aissemble.upgrade.migration.v1_10_0; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import java.io.File; + +import org.apache.maven.model.Model; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.technologybrewery.baton.util.pom.PomHelper; +import org.technologybrewery.baton.util.pom.PomModifications; +import org.technologybrewery.baton.util.pom.PomModifications.Insertion; + +import com.boozallen.aissemble.upgrade.migration.AbstractPomMigration; + +import static org.technologybrewery.baton.util.pom.LocationAwareMavenReader.END; +import static org.apache.commons.lang3.StringUtils.repeat; + +/** + * Updates a Spark pipeline module pom.xml with the javax.servlet-api dependency to ensure compatibility + * with Apache Spark 3.5 which has not migrated to Jakarta packages yet + */ +public class SparkPipelineServletApiMigration extends AbstractPomMigration { + private static final Logger logger = LoggerFactory.getLogger(SparkPipelineServletApiMigration.class); + private static final String JAVAX_SERVLET_GROUP_ID = "javax.servlet"; + private static final String JAVAX_SERVLET_ARTIFACT_ID = "javax.servlet-api"; + + @Override + protected boolean shouldExecuteOnFile(File pomFile) { + Model model = PomHelper.getLocationAnnotatedModel(pomFile); + + // Check if the pipeline pom is type jar and doesn't have the javax servlet dependency + return model.getPackaging().equals("jar") && !this.hasDependency(model, JAVAX_SERVLET_GROUP_ID, JAVAX_SERVLET_ARTIFACT_ID); + } + + @Override + protected boolean performMigration(File pomFile) { + logger.info("Migrating file to include the Javax Servlet API dependency: {}", pomFile.getAbsolutePath()); + Model model = PomHelper.getLocationAnnotatedModel(pomFile); + + this.detectAndSetIndent(pomFile); + PomModifications modifications = new PomModifications(); + modifications.add(new Insertion(model.getLocation("dependencies" + END), 1, this::getDependencyContent)); + + return PomHelper.writeModifications(pomFile, modifications.finalizeMods()); + } + + private String getDependencyContent(String ignore) { + return repeat(indent, 2) + "\n" + + repeat(indent, 3) + "\n" + "" + + repeat(indent, 3) + "\n" + + repeat(indent, 3) + "" + JAVAX_SERVLET_GROUP_ID + "\n" + + repeat(indent, 3) + "" + JAVAX_SERVLET_ARTIFACT_ID + "\n" + + repeat(indent, 3) + "${version.javax.servlet}\n" + + repeat(indent, 2) + "\n"; + } +} diff --git a/foundation/foundation-upgrade/src/main/resources/migrations.json b/foundation/foundation-upgrade/src/main/resources/migrations.json index 4dce7ca84..6f3fbb054 100644 --- a/foundation/foundation-upgrade/src/main/resources/migrations.json +++ b/foundation/foundation-upgrade/src/main/resources/migrations.json @@ -37,6 +37,17 @@ } ] }, + { + "name": "spark-pipeline-servlet-api-migration", + "implementation": "com.boozallen.aissemble.upgrade.migration.v1_10_0.SparkPipelineServletApiMigration", + "fileSets": [ + { + "includes": [ + "*-pipelines/*/pom.xml" + ] + } + ] + }, { "name": "it-infrastructure-java-upgrade-migration", "implementation": "com.boozallen.aissemble.upgrade.migration.v1_10_0.ItInfrastructureJavaUpgradeMigration", @@ -77,6 +88,34 @@ "excludes": ["**/target/**", "**/templates/**"] } ] + }, + { + "name": "pom-dependency-version-migration", + "implementation": "com.boozallen.aissemble.upgrade.migration.v1_10_0.PomDependencyVersionMigration", + "fileSets": [ + { + "includes": ["pom.xml"] + } + ] + }, + { + "name": "java-package-migration", + "implementation": "com.boozallen.aissemble.upgrade.migration.v1_10_0.JavaPackageMigration", + "fileSets": [ + { + "includes": ["src/**/*.java"], + "excludes": ["**/target/**"] + } + ] + }, + { + "name": "quarkus-bom-migration", + "implementation": "com.boozallen.aissemble.upgrade.migration.v1_10_0.QuarkusBomMigration", + "fileSets": [ + { + "includes": ["pom.xml"] + } + ] } ] }, diff --git a/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/JavaPackageMigrationSteps.java b/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/JavaPackageMigrationSteps.java new file mode 100644 index 000000000..d75b74d81 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/JavaPackageMigrationSteps.java @@ -0,0 +1,46 @@ +package com.boozallen.aissemble.upgrade.migration.v1_10_0; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import com.boozallen.aissemble.upgrade.migration.AbstractMigrationTest; + +import io.cucumber.java.en.Given; +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; + +public class JavaPackageMigrationSteps extends AbstractMigrationTest { + @Given("a Java file with the outdated Java package names") + public void a_java_file_with_the_outdated_java_package_names() { + testFile = getTestFile("v1_10_0/JavaPackageMigration/migration/allClasses.java"); + } + + @Given("a Java file with the new Java package names") + public void a_java_file_with_the_mew_java_package_names() { + testFile = getTestFile("v1_10_0/JavaPackageMigration/validation/allClasses.java"); + } + + @When("the Java Package Migration executes") + public void the_java_package_migration_executes() { + performMigration(new JavaPackageMigration()); + } + + @Then("the Java file is updated to use the new Java package names") + public void the_java_file_is_updated_to_use_the_new_java_package_names() { + assertMigrationSuccess(); + assertTestFileMatchesExpectedFile("Java file was not updated to use the new class packages"); + } + + @Then("the Java Package Migration is skipped") + public void the_java_package_migration_is_skipped() { + assertMigrationSkipped(); + } + +} diff --git a/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/PomDependencyVersionMigrationSteps.java b/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/PomDependencyVersionMigrationSteps.java new file mode 100644 index 000000000..107e8782a --- /dev/null +++ b/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/PomDependencyVersionMigrationSteps.java @@ -0,0 +1,56 @@ +package com.boozallen.aissemble.upgrade.migration.v1_10_0; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + + import com.boozallen.aissemble.upgrade.migration.AbstractMigrationTest; + + import io.cucumber.java.en.Given; + import io.cucumber.java.en.Then; + import io.cucumber.java.en.When; + + +public class PomDependencyVersionMigrationSteps extends AbstractMigrationTest { + @Given("a POM that references dependencies previously managed by the aiSSEMBLE BOM") + public void a_pom_that_references_dependencies_previously_managed_by_the_aissemble_bom() { + testFile = getTestFile("v1_10_0/PomDependencyVersionMigration/migration/all-dependencies-pom.xml"); + } + + @Given("the POM has the dependencies in profiles and dependency management") + public void the_pom_has_the_dependencies_in_profiles_and_dependency_management() { + testFile = getTestFile("v1_10_0/PomDependencyVersionMigration/migration/dependency-management-profile-pom.xml"); + } + + @Given("the dependencies are all using the updated version") + public void the_dependencies_are_all_using_the_updated_version() { + testFile = getTestFile("v1_10_0/PomDependencyVersionMigration/validation/all-dependencies-pom.xml"); + } + + @Given("a POM that does not contain any dependencies previously managed by the aiSSEMBLE BOM") + public void a_pom_that_does_not_contain_any_dependencies_previously_managed_by_the_aissemble_bom() { + testFile = getTestFile("v1_10_0/PomDependencyVersionMigration/migration/skip-pom.xml"); + } + + @When("the POM Dependency Version migration executes") + public void the_pom_dependency_version_migration_executes() { + performMigration(new PomDependencyVersionMigration()); + } + + @Then("the dependencies are updated to use the necessary version") + public void the_dependencies_are_updated_to_use_the_necessary_version() { + assertMigrationSuccess(); + assertTestFileMatchesExpectedFile("Dependency versions were not updated correctly following the migration"); + } + + @Then("the POM Dependency Version migration is skipped") + public void the_pom_dependency_version_migration_is_skipped() { + assertMigrationSkipped(); + } +} diff --git a/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/QuarkusBomMigrationSteps.java b/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/QuarkusBomMigrationSteps.java new file mode 100644 index 000000000..7712bd146 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/QuarkusBomMigrationSteps.java @@ -0,0 +1,45 @@ +package com.boozallen.aissemble.upgrade.migration.v1_10_0; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import com.boozallen.aissemble.upgrade.migration.AbstractMigrationTest; + +import io.cucumber.java.en.Given; +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; + +public class QuarkusBomMigrationSteps extends AbstractMigrationTest { + @Given("a POM that references the {string} Quarkus BOM") + public void a_pom_that_references_the_quarkus_bom(String quarkusBomType) { + testFile = getTestFile("v1_10_0/QuarkusBomMigration/migration/" + quarkusBomType + "-pom.xml"); + } + + @Given("a POM that does not contain a Quarkus BOM") + public void a_pom_that_does_not_contain_a_quarkus_bom() { + testFile = getTestFile("v1_10_0/QuarkusBomMigration/validation/quarkus-bom-pom.xml"); + } + + @When("the Quarkus Bom Migration executes") + public void the_quarkus_bom_migration_executes() { + performMigration(new QuarkusBomMigration()); + } + + @Then("the Quarkus BOM is updated to the aiSSEMBLE Quarkus BOM") + public void the_quarkus_bom_is_updated_to_the_aissemble_quarkus_bom() { + assertMigrationSuccess(); + assertTestFileMatchesExpectedFile("Quarkus BOM was not updated correctly to aiSSEMBLE Quarkus BOM"); + } + + @Then("the Quarkus Bom Migration is skipped") + public void the_quarkus_bom_migration_is_skipped() { + assertMigrationSkipped(); + } +} diff --git a/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineServletApiMigrationSteps.java b/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineServletApiMigrationSteps.java new file mode 100644 index 000000000..fb39dd9dc --- /dev/null +++ b/foundation/foundation-upgrade/src/test/java/com/boozallen/aissemble/upgrade/migration/v1_10_0/SparkPipelineServletApiMigrationSteps.java @@ -0,0 +1,52 @@ +package com.boozallen.aissemble.upgrade.migration.v1_10_0; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import com.boozallen.aissemble.upgrade.migration.AbstractMigrationTest; + +import io.cucumber.java.en.Given; +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; + +public class SparkPipelineServletApiMigrationSteps extends AbstractMigrationTest { + @Given("a POM with {string} packaging type") + public void a_pom_with_packaging_type(String packaging) { + if (!packaging.equals("jar")) { + testFile = getTestFile("v1_10_0/SparkPipelineServletApiMigration/skip/pom.xml"); + } + } + + @Given("the POM does not contain the javax servlet-api dependency") + public void the_pom_does_not_contain_the_javax_servlet_api_dependency() { + testFile = getTestFile("v1_10_0/SparkPipelineServletApiMigration/migration/pom.xml"); + } + + @Given("the POM already contains the javax servlet-api dependency") + public void the_pom_already_contains_the_javax_servlet_api_dependency() { + testFile = getTestFile("v1_10_0/SparkPipelineServletApiMigration/validation/pom.xml"); + } + + @When("the Spark Pipeline Servlet API migration executes") + public void the_spark_pipeline_servlet_api_migration_executes() { + performMigration(new SparkPipelineServletApiMigration()); + } + + @Then("the javax servlet-api dependency is added to the POM") + public void the_javax_servlet_api_dependency_is_added_to_the_pom() { + assertMigrationSuccess(); + assertTestFileMatchesExpectedFile("javax servlet-api dependency was not added to the POM"); + } + + @Then("the Spark Pipeline Servlet API migration is skipped") + public void the_spark_pipeline_servlet_api_migration_is_skipped() { + assertMigrationSkipped(); + } +} diff --git a/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/java-package-migration.feature b/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/java-package-migration.feature new file mode 100644 index 000000000..79639ce13 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/java-package-migration.feature @@ -0,0 +1,11 @@ +Feature: Updates the affected java classes from their old package name to their new package name + + Scenario: Migrate Java classes to use updated package + Given a Java file with the outdated Java package names + When the Java Package Migration executes + Then the Java file is updated to use the new Java package names + + Scenario: Skip migration when all Java packages are already migrated + Given a Java file with the new Java package names + When the Java Package Migration executes + Then the Java Package Migration is skipped \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/pom-dependency-version-migration.feature b/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/pom-dependency-version-migration.feature new file mode 100644 index 000000000..20f8b24f4 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/pom-dependency-version-migration.feature @@ -0,0 +1,25 @@ +Feature: Update the pom dependencies previously managed by the aiSSEMBLE BOM to include the necessary version + + Scenario: Migrate all pom dependencies to the new version + Given a POM that references dependencies previously managed by the aiSSEMBLE BOM + When the POM Dependency Version migration executes + Then the dependencies are updated to use the necessary version + + + Scenario: Migrate pom dependencies in profiles and dependency management + Given a POM that references dependencies previously managed by the aiSSEMBLE BOM + And the POM has the dependencies in profiles and dependency management + When the POM Dependency Version migration executes + Then the dependencies are updated to use the necessary version + + + Scenario: Skip migration when all the dependencies are using the updated version + Given a POM that references dependencies previously managed by the aiSSEMBLE BOM + And the dependencies are all using the updated version + When the POM Dependency Version migration executes + Then the POM Dependency Version migration is skipped + + Scenario: Skip migration when the pom does not contain any dependencies that need updating + Given a POM that does not contain any dependencies previously managed by the aiSSEMBLE BOM + When the POM Dependency Version migration executes + Then the POM Dependency Version migration is skipped \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/quarkus-bom-migration.feature b/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/quarkus-bom-migration.feature new file mode 100644 index 000000000..9d275e99d --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/quarkus-bom-migration.feature @@ -0,0 +1,16 @@ +Feature: Updates all references to the quarkus-bom and quarkus-universe-bom to use the new aissemble-quarkus-bom for managing Quarkus dependencies + + Scenario Outline: Migrate Quarkus BOMs to aiSSEMBLE Quarkus BOM + Given a POM that references the "" Quarkus BOM + When the Quarkus Bom Migration executes + Then the Quarkus BOM is updated to the aiSSEMBLE Quarkus BOM + + Examples: + | bom-artifact-id | + | quarkus-bom | + | quarkus-universe-bom | + + Scenario: Skip migration when the Quarkus BOMs are not present + Given a POM that does not contain a Quarkus BOM + When the Quarkus Bom Migration executes + Then the Quarkus Bom Migration is skipped \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/spark-pipeline-servlet-api-migration.feature b/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/spark-pipeline-servlet-api-migration.feature new file mode 100644 index 000000000..6fc4ce8bd --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/specifications/v1_10_0/spark-pipeline-servlet-api-migration.feature @@ -0,0 +1,18 @@ +Feature: Migrate a Spark pipeline module pom.xml with the javax servlet-api dependency + + Scenario: Add javax servlet-api dependency spark pipeline pom + Given a POM with "jar" packaging type + And the POM does not contain the javax servlet-api dependency + When the Spark Pipeline Servlet API migration executes + Then the javax servlet-api dependency is added to the POM + + Scenario: Skip spark pipeline pom that already has the javax servlet-api dependency + Given a POM with "jar" packaging type + And the POM already contains the javax servlet-api dependency + When the Spark Pipeline Servlet API migration executes + Then the Spark Pipeline Servlet API migration is skipped + + Scenario: Skip pom that does not have jar packaging + Given a POM with "habushu" packaging type + When the Spark Pipeline Servlet API migration executes + Then the Spark Pipeline Servlet API migration is skipped \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/JavaPackageMigration/migration/allClasses.java b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/JavaPackageMigration/migration/allClasses.java new file mode 100644 index 000000000..4951a3fc7 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/JavaPackageMigration/migration/allClasses.java @@ -0,0 +1,65 @@ +package test; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import javax.activation.DataHandler; +import javax.annotation.PostConstruct; +import javax.batch.operations.JobOperator; +import javax.data.DataSource; +import javax.decorator.Decorator; +import javax.ejb.EJB; +import javax.el.ExpressionFactory; +import javax.enterprise.inject.spi.CDI; +import javax.faces.application.Application; +import javax.inject.Inject; +import javax.interceptor.Interceptor; +import javax.jms.ConnectionFactory; +import javax.json.Json; +import javax.mail.Session; +import javax.persistence.EntityManager; +import javax.resource.ResourceException; +import javax.security.auth.login.LoginContext; +import javax.servlet.Servlet; +import javax.transaction.TransactionManager; +import javax.validation.Validation; +import javax.websocket.server.ServerEndpoint; +import javax.ws.rs.GET; +import io.smallrye.reactive.messaging.providers.connectors.InMemoryConnector; +import io.smallrye.reactive.messaging.providers.connectors.InMemorySink; + +public class allClasses { + public static void main(String[] args) { + javax.activation.DataHandler dataHandler = new javax.activation.DataHandler(); + javax.annotation.PostConstruct postConstruct = new javax.annotation.PostConstruct() {}; + javax.batch.operations.JobOperator jobOperator = javax.batch.operations.JobOperator.instance(); + javax.data.DataSource dataSource = new javax.data.DataSource() {}; + javax.decorator.Decorator decorator = new javax.decorator.Decorator() {}; + javax.ejb.EJB ejb = new javax.ejb.EJB() {}; + javax.el.ExpressionFactory expressionFactory = javax.el.ExpressionFactory.newInstance(); + javax.enterprise.inject.spi.CDI cdi = javax.enterprise.inject.spi.CDI.current(); + javax.faces.application.Application application = new javax.faces.application.Application() {}; + javax.inject.Inject inject = new javax.inject.Inject() {}; + javax.interceptor.Interceptor interceptor = new javax.interceptor.Interceptor() {}; + javax.jms.ConnectionFactory connectionFactory = new javax.jms.ConnectionFactory() {}; + javax.json.Json json = javax.json.Json.createObjectBuilder().build(); + javax.mail.Session mailSession = javax.mail.Session.getInstance(System.getProperties()); + javax.persistence.EntityManager entityManager = new javax.persistence.EntityManager() {}; + javax.resource.ResourceException resourceException = new javax.resource.ResourceException(); + javax.security.auth.login.LoginContext loginContext = new javax.security.auth.login.LoginContext("someLoginContext"); + javax.servlet.Servlet servlet = new javax.servlet.Servlet() {}; + javax.transaction.TransactionManager transactionManager = new javax.transaction.TransactionManager() {}; + javax.validation.Validation validation = javax.validation.Validation.buildDefaultValidatorFactory().getValidator(); + javax.websocket.server.ServerEndpoint serverEndpoint = new javax.websocket.server.ServerEndpoint() {}; + javax.ws.rs.GET get = new javax.ws.rs.GET() {}; + io.smallrye.reactive.messaging.providers.connectors.InMemorySink inMemorySink = new io.smallrye.reactive.messaging.providers.connectors.InMemorySink(); + io.smallrye.reactive.messaging.providers.connectors.InMemoryConnector inMemoryConnector = new io.smallrye.reactive.messaging.providers.connectors.InMemoryConnector(); + } +} diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/JavaPackageMigration/validation/allClasses.java b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/JavaPackageMigration/validation/allClasses.java new file mode 100644 index 000000000..8d7d531c3 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/JavaPackageMigration/validation/allClasses.java @@ -0,0 +1,65 @@ +package test; + +/*- + * #%L + * aiSSEMBLE::Foundation::Upgrade + * %% + * Copyright (C) 2021 Booz Allen + * %% + * This software package is licensed under the Booz Allen Public License. All Rights Reserved. + * #L% + */ + +import jakarta.activation.DataHandler; +import jakarta.annotation.PostConstruct; +import jakarta.batch.operations.JobOperator; +import jakarta.data.DataSource; +import jakarta.decorator.Decorator; +import jakarta.ejb.EJB; +import jakarta.el.ExpressionFactory; +import jakarta.enterprise.inject.spi.CDI; +import jakarta.faces.application.Application; +import jakarta.inject.Inject; +import jakarta.interceptor.Interceptor; +import jakarta.jms.ConnectionFactory; +import jakarta.json.Json; +import jakarta.mail.Session; +import jakarta.persistence.EntityManager; +import jakarta.resource.ResourceException; +import jakarta.security.auth.login.LoginContext; +import jakarta.servlet.Servlet; +import jakarta.transaction.TransactionManager; +import jakarta.validation.Validation; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.ws.rs.GET; +import io.smallrye.reactive.messaging.memory.InMemoryConnector; +import io.smallrye.reactive.messaging.memory.InMemorySink; + +public class allClasses { + public static void main(String[] args) { + jakarta.activation.DataHandler dataHandler = new jakarta.activation.DataHandler(); + jakarta.annotation.PostConstruct postConstruct = new jakarta.annotation.PostConstruct() {}; + jakarta.batch.operations.JobOperator jobOperator = jakarta.batch.operations.JobOperator.instance(); + jakarta.data.DataSource dataSource = new jakarta.data.DataSource() {}; + jakarta.decorator.Decorator decorator = new jakarta.decorator.Decorator() {}; + jakarta.ejb.EJB ejb = new jakarta.ejb.EJB() {}; + jakarta.el.ExpressionFactory expressionFactory = jakarta.el.ExpressionFactory.newInstance(); + jakarta.enterprise.inject.spi.CDI cdi = jakarta.enterprise.inject.spi.CDI.current(); + jakarta.faces.application.Application application = new jakarta.faces.application.Application() {}; + jakarta.inject.Inject inject = new jakarta.inject.Inject() {}; + jakarta.interceptor.Interceptor interceptor = new jakarta.interceptor.Interceptor() {}; + jakarta.jms.ConnectionFactory connectionFactory = new jakarta.jms.ConnectionFactory() {}; + jakarta.json.Json json = jakarta.json.Json.createObjectBuilder().build(); + jakarta.mail.Session mailSession = jakarta.mail.Session.getInstance(System.getProperties()); + jakarta.persistence.EntityManager entityManager = new jakarta.persistence.EntityManager() {}; + jakarta.resource.ResourceException resourceException = new jakarta.resource.ResourceException(); + jakarta.security.auth.login.LoginContext loginContext = new jakarta.security.auth.login.LoginContext("someLoginContext"); + jakarta.servlet.Servlet servlet = new jakarta.servlet.Servlet() {}; + jakarta.transaction.TransactionManager transactionManager = new jakarta.transaction.TransactionManager() {}; + jakarta.validation.Validation validation = jakarta.validation.Validation.buildDefaultValidatorFactory().getValidator(); + jakarta.websocket.server.ServerEndpoint serverEndpoint = new jakarta.websocket.server.ServerEndpoint() {}; + jakarta.ws.rs.GET get = new jakarta.ws.rs.GET() {}; + io.smallrye.reactive.messaging.memory.InMemorySink inMemorySink = new io.smallrye.reactive.messaging.memory.InMemorySink(); + io.smallrye.reactive.messaging.memory.InMemoryConnector inMemoryConnector = new io.smallrye.reactive.messaging.memory.InMemoryConnector(); + } +} diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/all-dependencies-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/all-dependencies-pom.xml new file mode 100644 index 000000000..fc3353e7d --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/all-dependencies-pom.xml @@ -0,0 +1,91 @@ + + + + + 4.0.0 + + test-pom + + + + org.technologybrewery.krausening + krausening + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + + + org.jboss.resteasy + resteasy-jackson2-provider + compile + + + org.awaitility + awaitility + compile + + + junit + junit + 4.13.2 + compile + + + io.vertx + vertx-core + + + io.smallrye.config + smallrye-config + 2.10.0 + + + org.slf4j + slf4j-api + 2.0.7 + + + org.slf4j + slf4j-simple + 1.6.4 + + + org.scala-lang + scala-reflect + 2.12.1 + + + org.apache.commons + commons-math3 + 3.2 + + + io.smallrye.reactive + smallrye-reactive-messaging-kafka + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + + + + diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/dependency-management-profile-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/dependency-management-profile-pom.xml new file mode 100644 index 000000000..587ba7cd0 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/dependency-management-profile-pom.xml @@ -0,0 +1,180 @@ + + + + + 4.0.0 + + test-pom + + + + org.technologybrewery.krausening + krausening + + + io.vertx + vertx-core + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + + + io.smallrye.config + smallrye-config + 2.10.0 + + + junit + junit + 4.13.2 + compile + + + + + + + org.technologybrewery.krausening + krausening + + + io.vertx + vertx-core + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + + + io.smallrye.config + smallrye-config + 2.10.0 + + + junit + junit + 4.13.2 + compile + + + + + + + test + + + + org.technologybrewery.krausening + krausening + + + io.vertx + vertx-core + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + + + io.smallrye.config + smallrye-config + 2.10.0 + + + junit + junit + 4.13.2 + compile + + + + + + + org.technologybrewery.krausening + krausening + + + io.vertx + vertx-core + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + + + io.smallrye.config + smallrye-config + 2.10.0 + + + junit + junit + 4.13.2 + compile + + + + + + \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/skip-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/skip-pom.xml new file mode 100644 index 000000000..38f94f1e3 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/migration/skip-pom.xml @@ -0,0 +1,58 @@ + + + + + 4.0.0 + + test-pom + + + + org.technologybrewery.krausening + krausening + + + com.boozallen.aissemble + foundation-core-java + + + com.boozallen.aissemble + foundation-metadata-producer + + + com.boozallen.aissemble + extensions-data-delivery-spark + + + com.boozallen.aissemble + foundation-pdp-client-java + + + com.boozallen.aissemble + extensions-authzforce + + + com.boozallen.aissemble + foundation-encryption-policy-java + + + com.boozallen.aissemble + extensions-encryption-vault-java + + + com.boozallen.aissemble + foundation-data-lineage-java + + + + diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/validation/all-dependencies-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/validation/all-dependencies-pom.xml new file mode 100644 index 000000000..de5d5ca8b --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/validation/all-dependencies-pom.xml @@ -0,0 +1,97 @@ + + + + + 4.0.0 + + test-pom + + + + org.technologybrewery.krausening + krausening + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + ${version.resteasy} + + + org.jboss.resteasy + resteasy-jackson2-provider + compile + ${version.resteasy} + + + org.awaitility + awaitility + compile + ${version.awaitility} + + + junit + junit + ${version.junit} + compile + + + io.vertx + vertx-core + ${version.vertx} + + + io.smallrye.config + smallrye-config + ${version.smallrye.config} + + + org.slf4j + slf4j-api + ${version.slf4j} + + + org.slf4j + slf4j-simple + ${version.slf4j} + + + org.scala-lang + scala-reflect + ${version.scala} + + + org.apache.commons + commons-math3 + ${version.commons.math} + + + io.smallrye.reactive + smallrye-reactive-messaging-kafka + ${version.smallrye.reactive.messaging} + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + ${version.smallrye.reactive.messaging} + + + + diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/validation/dependency-management-profile-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/validation/dependency-management-profile-pom.xml new file mode 100644 index 000000000..d7d8bc1ef --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/PomDependencyVersionMigration/validation/dependency-management-profile-pom.xml @@ -0,0 +1,192 @@ + + + + + 4.0.0 + + test-pom + + + + org.technologybrewery.krausening + krausening + + + io.vertx + vertx-core + ${version.vertx} + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + ${version.smallrye.reactive.messaging} + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + ${version.resteasy} + + + io.smallrye.config + smallrye-config + ${version.smallrye.config} + + + junit + junit + ${version.junit} + compile + + + + + + + org.technologybrewery.krausening + krausening + + + io.vertx + vertx-core + ${version.vertx} + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + ${version.smallrye.reactive.messaging} + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + ${version.resteasy} + + + io.smallrye.config + smallrye-config + ${version.smallrye.config} + + + junit + junit + ${version.junit} + compile + + + + + + + test + + + + org.technologybrewery.krausening + krausening + + + io.vertx + vertx-core + ${version.vertx} + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + ${version.smallrye.reactive.messaging} + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + ${version.resteasy} + + + io.smallrye.config + smallrye-config + ${version.smallrye.config} + + + junit + junit + ${version.junit} + compile + + + + + + + org.technologybrewery.krausening + krausening + + + io.vertx + vertx-core + ${version.vertx} + + + io.smallrye.reactive + smallrye-reactive-messaging-in-memory + test + ${version.smallrye.reactive.messaging} + + + org.jboss.resteasy + resteasy-client + compile + + + io.smallrye.config + smallrye-config + + + ${version.resteasy} + + + io.smallrye.config + smallrye-config + ${version.smallrye.config} + + + junit + junit + ${version.junit} + compile + + + + + + \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/migration/quarkus-bom-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/migration/quarkus-bom-pom.xml new file mode 100644 index 000000000..d2902d23f --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/migration/quarkus-bom-pom.xml @@ -0,0 +1,66 @@ + + + + + 4.0.0 + + test-pom + + + + io.quarkus + quarkus-bom + pom + import + + + + + + + io.quarkus + quarkus-bom + ${version.quarkus} + pom + import + + + + + + + test + + + + io.quarkus + quarkus-bom + ${version.quarkus} + pom + import + + + + + + + io.quarkus + quarkus-bom + pom + import + + + + + + \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/migration/quarkus-universe-bom-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/migration/quarkus-universe-bom-pom.xml new file mode 100644 index 000000000..c14d46c1a --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/migration/quarkus-universe-bom-pom.xml @@ -0,0 +1,66 @@ + + + + + 4.0.0 + + test-pom + + + + io.quarkus + quarkus-universe-bom + pom + import + + + + + + + io.quarkus + quarkus-universe-bom + ${version.quarkus.plugin} + pom + import + + + + + + + test + + + + io.quarkus + quarkus-universe-bom + ${version.quarkus.plugin} + pom + import + + + + + + + io.quarkus + quarkus-universe-bom + pom + import + + + + + + \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/validation/quarkus-bom-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/validation/quarkus-bom-pom.xml new file mode 100644 index 000000000..e2492836c --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/validation/quarkus-bom-pom.xml @@ -0,0 +1,68 @@ + + + + + 4.0.0 + + test-pom + + + + com.boozallen.aissemble + aissemble-quarkus-bom + pom + import + ${version.aissemble} + + + + + + + com.boozallen.aissemble + aissemble-quarkus-bom + ${version.aissemble} + pom + import + + + + + + + test + + + + com.boozallen.aissemble + aissemble-quarkus-bom + ${version.aissemble} + pom + import + + + + + + + com.boozallen.aissemble + aissemble-quarkus-bom + pom + import + ${version.aissemble} + + + + + + \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/validation/quarkus-universe-bom-pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/validation/quarkus-universe-bom-pom.xml new file mode 100644 index 000000000..e2492836c --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/QuarkusBomMigration/validation/quarkus-universe-bom-pom.xml @@ -0,0 +1,68 @@ + + + + + 4.0.0 + + test-pom + + + + com.boozallen.aissemble + aissemble-quarkus-bom + pom + import + ${version.aissemble} + + + + + + + com.boozallen.aissemble + aissemble-quarkus-bom + ${version.aissemble} + pom + import + + + + + + + test + + + + com.boozallen.aissemble + aissemble-quarkus-bom + ${version.aissemble} + pom + import + + + + + + + com.boozallen.aissemble + aissemble-quarkus-bom + pom + import + ${version.aissemble} + + + + + + \ No newline at end of file diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/migration/pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/migration/pom.xml new file mode 100644 index 000000000..34217d1ec --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/migration/pom.xml @@ -0,0 +1,70 @@ + + + + + 4.0.0 + + + com.test + test-pipelines + 1.0.0-SNAPSHOT + + + spark-pipeline + jar + + test::Pipelines::Spark Pipeline + ${pipeline.description} + + + + + net.masterthought + maven-cucumber-reporting + + + + + + + org.technologybrewery.krausening + krausening + + + com.boozallen.aissemble + foundation-core-java + + + com.boozallen.aissemble + foundation-metadata-producer + + + com.boozallen.aissemble + extensions-data-delivery-spark + + + com.boozallen.aissemble + extensions-data-delivery-spark + tests + test-jar + test + ${version.aissemble} + + + io.smallrye.reactive + smallrye-reactive-messaging-kafka + ${version.smallrye.reactive.messaging} + + + + diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/skip/pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/skip/pom.xml new file mode 100644 index 000000000..df7baf786 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/skip/pom.xml @@ -0,0 +1,70 @@ + + + + + 4.0.0 + + + com.test + test-pipelines + 1.0.0-SNAPSHOT + + + pyspark-pipeline + habushu + + test::Pipelines::Pyspark Pipeline + ${pipeline.description} + + + + + net.masterthought + maven-cucumber-reporting + + + + + + + org.technologybrewery.krausening + krausening + + + com.boozallen.aissemble + foundation-core-java + + + com.boozallen.aissemble + foundation-metadata-producer + + + com.boozallen.aissemble + extensions-data-delivery-spark + + + com.boozallen.aissemble + extensions-data-delivery-spark + tests + test-jar + test + ${version.aissemble} + + + io.smallrye.reactive + smallrye-reactive-messaging-kafka + ${version.smallrye.reactive.messaging} + + + + diff --git a/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/validation/pom.xml b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/validation/pom.xml new file mode 100644 index 000000000..8eebd0ad2 --- /dev/null +++ b/foundation/foundation-upgrade/src/test/resources/test-files/v1_10_0/SparkPipelineServletApiMigration/validation/pom.xml @@ -0,0 +1,77 @@ + + + + + 4.0.0 + + + com.test + test-pipelines + 1.0.0-SNAPSHOT + + + spark-pipeline + jar + + test::Pipelines::Spark Pipeline + ${pipeline.description} + + + + + net.masterthought + maven-cucumber-reporting + + + + + + + org.technologybrewery.krausening + krausening + + + com.boozallen.aissemble + foundation-core-java + + + com.boozallen.aissemble + foundation-metadata-producer + + + com.boozallen.aissemble + extensions-data-delivery-spark + + + com.boozallen.aissemble + extensions-data-delivery-spark + tests + test-jar + test + ${version.aissemble} + + + io.smallrye.reactive + smallrye-reactive-messaging-kafka + ${version.smallrye.reactive.messaging} + + + + + javax.servlet + javax.servlet-api + ${version.javax.servlet} + + + + diff --git a/pom.xml b/pom.xml index 98f375cbd..d8fba7b6e 100644 --- a/pom.xml +++ b/pom.xml @@ -73,6 +73,7 @@ 5.8.1 1 5.5.0 + 3.6.1 @@ -88,6 +89,11 @@ + + org.apache.commons + commons-math3 + ${version.commons.math} + org.apache.commons commons-collections4 diff --git a/test/test-mda-models/aissemble-test-data-delivery-pyspark-model-basic/pom.xml b/test/test-mda-models/aissemble-test-data-delivery-pyspark-model-basic/pom.xml index f40f70dc8..e4fc40482 100644 --- a/test/test-mda-models/aissemble-test-data-delivery-pyspark-model-basic/pom.xml +++ b/test/test-mda-models/aissemble-test-data-delivery-pyspark-model-basic/pom.xml @@ -167,7 +167,7 @@ org.apache.commons commons-math3 - 3.2 + ${version.commons.math} ${project.groupId} diff --git a/test/test-mda-models/aissemble-test-data-delivery-pyspark-model/pom.xml b/test/test-mda-models/aissemble-test-data-delivery-pyspark-model/pom.xml index 167b00521..a29ad6ddb 100644 --- a/test/test-mda-models/aissemble-test-data-delivery-pyspark-model/pom.xml +++ b/test/test-mda-models/aissemble-test-data-delivery-pyspark-model/pom.xml @@ -172,7 +172,7 @@ org.apache.commons commons-math3 - 3.2 + ${version.commons.math} ${project.groupId}