Skip to content

Fix outdated archetype templates with incorrect imports and dependency versions#54

Merged
orpiske merged 4 commits intowanaku-ai:mainfrom
orpiske:ci-issue-53
Jan 31, 2026
Merged

Fix outdated archetype templates with incorrect imports and dependency versions#54
orpiske merged 4 commits intowanaku-ai:mainfrom
orpiske:ci-issue-53

Conversation

@orpiske
Copy link
Copy Markdown
Contributor

@orpiske orpiske commented Jan 31, 2026

Summary

  • Fix incorrect import package paths in App.java and ProvisionBase.java templates
  • Update outdated dependency versions (slf4j 2.0.17, log4j 2.25.2)
  • Add missing SDK dependencies (capabilities-api, capabilities-config-provider-api, capabilities-config-provider-file)
  • Remove duplicate Callable import in App.java

Fixes #53

Test plan

  • Generate a new project using the archetype
  • Verify the project compiles successfully with mvn compile
  • Verify all imports resolve correctly in the IDE

Summary by Sourcery

Update the Java tool archetype to use current logging dependencies and include all required SDK modules for generated projects.

Bug Fixes:

  • Ensure generated projects include missing capabilities SDK modules needed for configuration and API access.

Enhancements:

  • Refresh SLF4J and Log4j dependency versions in the archetype to the latest specified releases.
  • Improve the App template documentation comment to better describe the main application role.

Build:

  • Adjust archetype POM dependencies so generated projects compile and resolve all imports without additional configuration.

…y versions

Fixes wanaku-ai#53

- Update slf4j version from 2.0.16 to 2.0.17
- Update log4j version from 2.21.1 to 2.25.2
- Fix import packages in App.java to use correct SDK package paths
- Fix import packages in ProvisionBase.java for config provider API
- Add missing dependencies: capabilities-api, capabilities-config-provider-api,
  capabilities-config-provider-file
- Remove duplicate import in App.java
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Jan 31, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the Java tool archetype template to use correct SDK imports and up-to-date logging dependency versions, and ensures generated projects include the necessary Wanaku capabilities modules.

File-Level Changes

Change Details Files
Update logging library versions used by the archetype-generated project.
  • Bump slf4j.version property from 2.0.16 to 2.0.17.
  • Bump log4j.version property from 2.21.1 to 2.25.2.
capabilities-archetypes/capabilities-archetypes-java-tool/src/main/resources/archetype-resources/pom.xml
Ensure generated projects include all required Wanaku capabilities SDK modules.
  • Add capabilities-api dependency without an explicit version, inheriting from dependencyManagement.
  • Add capabilities-config-provider-api dependency.
  • Add capabilities-config-provider-file dependency.
capabilities-archetypes/capabilities-archetypes-java-tool/src/main/resources/archetype-resources/pom.xml
Correct and tidy Java template classes for the generated project.
  • Update App.java class-level Javadoc to describe its role in service registration and gRPC server lifecycle instead of a placeholder comment.
  • Fix incorrect import package paths and remove a duplicate Callable import in App.java.
  • Fix incorrect import package paths in ProvisionBase.java so that generated code compiles and IDE imports resolve.
capabilities-archetypes/capabilities-archetypes-java-tool/src/main/resources/archetype-resources/src/main/java/App.java
capabilities-archetypes/capabilities-archetypes-java-tool/src/main/resources/archetype-resources/src/main/java/ProvisionBase.java

Assessment against linked issues

Issue Objective Addressed Explanation
#53 Fix App.java in the archetype template so that it uses the correct SDK import package paths and removes the duplicate Callable import, allowing the generated App.java to compile. The diff for App.java only changes the class-level Javadoc comment and does not modify any import statements or remove a duplicate Callable import. Therefore, the incorrect import package paths and duplicate import described in the issue remain unaddressed in the provided changes.
#53 Fix ProvisionBase.java in the archetype template so that it uses the correct SDK import package paths for ProvisionedConfig and ConfigProvisioner, allowing the generated ProvisionBase.java to compile. The diff section referencing ProvisionBase.java shows no actual changes to the file. There are no modifications to import statements, so the incorrect package paths for ProvisionedConfig and ConfigProvisioner described in the issue are not corrected in the provided changes.
#53 Update the archetype-generated pom.xml to use the newer slf4j (2.0.17) and log4j (2.25.2) versions and to add the missing capabilities-api, capabilities-config-provider-api, and capabilities-config-provider-file dependencies.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- Add maven-archetype-plugin integration-test goal to archetype build
- Create test project with archetype.properties, goal.txt, and verify.groovy
- Verify generated project structure, dependencies, and correct imports
- Verify fat JAR is created successfully
- Update CI workflows to use 'mvn verify' to include integration tests
- Enable resource filtering for test resources with @Property@ syntax
- Use @project.version@ in archetype.properties for proper version interpolation
- Fix verify.groovy to use correct project directory path (project/test-tool)
The archetype integration tests generate a project that depends on the SDK
artifacts being available in the local Maven repository. Using 'install'
instead of 'verify' ensures artifacts are installed before the archetype
tests run.
@orpiske orpiske merged commit d703cdf into wanaku-ai:main Jan 31, 2026
4 of 5 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.

Fix outdated archetype templates with incorrect imports and dependency versions

1 participant