From 8cc0d0a91b201da68183fe7f97350adb41bde162 Mon Sep 17 00:00:00 2001 From: Jiwoo Lim Date: Thu, 21 Nov 2024 14:50:53 -0500 Subject: [PATCH 1/3] fix featuresbom issue --- .../io/openliberty/tools/maven/InstallFeatureSupport.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/InstallFeatureSupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/InstallFeatureSupport.java index fa5c1855b..61f1c19a6 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/InstallFeatureSupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/InstallFeatureSupport.java @@ -156,15 +156,16 @@ protected List getAdditionalJsonList() { List result = new ArrayList(); org.apache.maven.model.DependencyManagement dependencyManagement = project.getDependencyManagement(); if(dependencyManagement == null) { - getLog().debug("Feature-bom is not provided by the user"); + getLog().debug("Features-bom is not provided by the user"); return null; } List dependencyManagementArtifacts = dependencyManagement.getDependencies(); for (org.apache.maven.model.Dependency dependencyArtifact: dependencyManagementArtifacts){ - if (("pom").equals(dependencyArtifact.getType())) { + if (("pom").equals(dependencyArtifact.getType()) && ("features-bom").equals(dependencyArtifact.getArtifactId())) { String coordinate = String.format("%s:%s:%s", dependencyArtifact.getGroupId(), FEATURES_JSON_ARTIFACT_ID, dependencyArtifact.getVersion()); result.add(coordinate); + getLog().debug("Features-bom is provided by the user"); getLog().info("Additional user feature json coordinate: " + coordinate); } } From 337e10f41eedd053e719a82555183f15a726cc49 Mon Sep 17 00:00:00 2001 From: Jiwoo Lim Date: Thu, 21 Nov 2024 17:00:16 -0500 Subject: [PATCH 2/3] fix featuresbom issue for prepareFeature --- .../java/io/openliberty/tools/maven/PrepareFeatureSupport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/PrepareFeatureSupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/PrepareFeatureSupport.java index a4ac003c5..5ab10fe6a 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/PrepareFeatureSupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/PrepareFeatureSupport.java @@ -110,7 +110,7 @@ protected List getDependencyBOMs() { if (dependencyManagement != null) { List dependencyManagementArtifacts = dependencyManagement.getDependencies(); for (org.apache.maven.model.Dependency dependencyArtifact: dependencyManagementArtifacts){ - if (("pom").equals(dependencyArtifact.getType())) { + if (("pom").equals(dependencyArtifact.getType()) && ("features-bom").equals(dependencyArtifact.getArtifactId()) ) { String coordinate = String.format("%s:%s:%s", dependencyArtifact.getGroupId(), dependencyArtifact.getArtifactId(), dependencyArtifact.getVersion()); result.add(coordinate); From d6c2fa2f8a2883df90e6b19727c488096e1f1673 Mon Sep 17 00:00:00 2001 From: Jiwoo Lim Date: Fri, 22 Nov 2024 14:27:01 -0500 Subject: [PATCH 3/3] update tests to use features-bom artifactID --- .../prepare-multiple-features-it/pom.xml | 45 +++++-------------- .../src/test/resources/features-bom-1.0.pom} | 13 +++++- .../src/test/resources/hello-bom-1.0.pom | 26 ----------- .../src/it/verify-user-feature-it/pom.xml | 6 +-- .../src/test/resources/features-bom-1.0.pom} | 2 +- 5 files changed, 26 insertions(+), 66 deletions(-) rename liberty-maven-plugin/src/it/{verify-user-feature-it/src/test/resources/SimpleActivator-bom-1.0.pom => kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/features-bom-1.0.pom} (64%) delete mode 100644 liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/hello-bom-1.0.pom rename liberty-maven-plugin/src/it/{kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/SimpleActivator-bom-1.0.pom => verify-user-feature-it/src/test/resources/features-bom-1.0.pom} (93%) diff --git a/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/pom.xml b/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/pom.xml index 2d50a7618..c52ee8f16 100644 --- a/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/pom.xml +++ b/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/pom.xml @@ -29,25 +29,6 @@ copy-resources - - ${user.home}/.m2/repository/test/user/test/osgi/hello-bom/1.0 - - - src/test/resources - - hello-bom-1.0.pom - - - - - - - copy-resource-two - process-test-resources - - copy-resources - - ${user.home}/.m2/repository/test/user/test/osgi/hello-esa-plugin/1.0 @@ -61,26 +42,26 @@ - copy-resource-three + copy-resource-two process-test-resources copy-resources - ${user.home}/.m2/repository/test/user/test/osgi/SimpleActivator-bom/1.0 + ${user.home}/.m2/repository/test/user/test/osgi/features-bom/1.0 src/test/resources - SimpleActivator-bom-1.0.pom + features-bom-1.0.pom - copy-resource-four + copy-resource-three process-test-resources copy-resources @@ -156,18 +137,12 @@ - - ${bom.group.id} - hello-bom - 1.0 - pom - - - test.user.test.osgi - SimpleActivator-bom - 1.0 - pom - + + test.user.test.osgi + features-bom + 1.0 + pom + diff --git a/liberty-maven-plugin/src/it/verify-user-feature-it/src/test/resources/SimpleActivator-bom-1.0.pom b/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/features-bom-1.0.pom similarity index 64% rename from liberty-maven-plugin/src/it/verify-user-feature-it/src/test/resources/SimpleActivator-bom-1.0.pom rename to liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/features-bom-1.0.pom index fa36c3706..576fd24b0 100644 --- a/liberty-maven-plugin/src/it/verify-user-feature-it/src/test/resources/SimpleActivator-bom-1.0.pom +++ b/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/features-bom-1.0.pom @@ -2,7 +2,7 @@ 4.0.0 test.user.test.osgi - SimpleActivator-bom + features-bom 1.0 pom @@ -15,5 +15,16 @@ esa + + + + test.user.test.osgi + + ${esa.artifact.id} + 1.0 + esa + runtime + + diff --git a/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/hello-bom-1.0.pom b/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/hello-bom-1.0.pom deleted file mode 100644 index 52996e7d8..000000000 --- a/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/hello-bom-1.0.pom +++ /dev/null @@ -1,26 +0,0 @@ - - - 4.0.0 - - test.user.test.osgi - hello-bom - 1.0 - pom - user features bill of materials - user features bill of materials - https://openliberty.io/ - - - - - test.user.test.osgi - - ${esa.artifact.id} - 1.0 - esa - runtime - - - - diff --git a/liberty-maven-plugin/src/it/verify-user-feature-it/pom.xml b/liberty-maven-plugin/src/it/verify-user-feature-it/pom.xml index d8d04bf4a..383190459 100644 --- a/liberty-maven-plugin/src/it/verify-user-feature-it/pom.xml +++ b/liberty-maven-plugin/src/it/verify-user-feature-it/pom.xml @@ -41,12 +41,12 @@ - ${user.home}/.m2/repository/test/user/test/osgi/SimpleActivator-bom/1.0 + ${user.home}/.m2/repository/test/user/test/osgi/features-bom/1.0 src/test/resources - SimpleActivator-bom-1.0.pom + features-bom-1.0.pom @@ -159,7 +159,7 @@ test.user.test.osgi - SimpleActivator-bom + features-bom 1.0 pom diff --git a/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/SimpleActivator-bom-1.0.pom b/liberty-maven-plugin/src/it/verify-user-feature-it/src/test/resources/features-bom-1.0.pom similarity index 93% rename from liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/SimpleActivator-bom-1.0.pom rename to liberty-maven-plugin/src/it/verify-user-feature-it/src/test/resources/features-bom-1.0.pom index fa36c3706..5b3078179 100644 --- a/liberty-maven-plugin/src/it/kernel-install-feature-test/prepare-multiple-features-it/src/test/resources/SimpleActivator-bom-1.0.pom +++ b/liberty-maven-plugin/src/it/verify-user-feature-it/src/test/resources/features-bom-1.0.pom @@ -2,7 +2,7 @@ 4.0.0 test.user.test.osgi - SimpleActivator-bom + features-bom 1.0 pom