Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide better error message for prepare feature #415

Merged
merged 6 commits into from
Sep 22, 2023

Conversation

jjiwooLim
Copy link
Contributor

Addressing OpenLiberty/ci.maven#1615.

Provide better error message when prepare-feature or prepareFeature task failed to generate features.json file for user feature(s).

In most cases, errors are caused by missing artifact properties in features-bom file (ex. <type>esa</type>) or wrong coordinates infeature-A.esa.pom, if it exists. If there is a pom file for the feature esa file, then it will read the pom file first and check if the esa exists in specified cooridinate. If the pom file doesn't exist, then it will directly check the esa file specified in features-bom file.

@jjiwooLim
Copy link
Contributor Author

jjiwooLim commented Sep 21, 2023

Updated error message:
If ESA file missing:

[INFO] --- liberty-maven-plugin:3.8.3-SNAPSHOT:prepare-feature (default-cli) @ liberty-maven-plugin-demo1 ---
[WARNING] org.apache.maven.plugin.MojoExecutionException: Unable to resolve artifact: test.user.test.osgi:SimpleActivatorESA:1.0.0-SNAPSHOT
[WARNING] The features.json could not be generated due to errors encountered while resolving the feature ESA file specified in feautres-bom file at coordinates test.user.test.osgi:features-bom:0.0.1-SNAPSHOT

If there's error in features-bom file:

[WARNING] Error: [type] tag(s) not found in features-bom file /Users/jiwoolim/.m2/repository/test/user/test/osgi/features-bom/0.0.1-SNAPSHOT/features-bom-0.0.1-SNAPSHOT.pom
[WARNING] The features.json could not be generated due to errors encountered while resolving the feature ESA file specified in feautres-bom file at coordinates test.user.test.osgi:features-bom:0.0.1-SNAPSHOT

If features-bom missing:

[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.8.3-SNAPSHOT:prepare-feature (default-cli) on project liberty-maven-plugin-demo1: Error preparing features.: org.apache.maven.plugin.MojoExecutionException: Unable to resolve artifact: test.user.test.osgi:features-bom:0.0.1-SNAPSHOT: Could not find artifact test.user.test.osgi:features-bom:pom:0.0.1-SNAPSHOT -> [Help 1]

Copy link
Member

@cherylking cherylking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the suggestion I made, which is what my previous comments were about. If it is not appropriate to issue that message when generatedJson does not exist, please add a comment to the code that explains why. Thanks.

@cherylking cherylking merged commit c25644d into OpenLiberty:main Sep 22, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants