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

Generated project from Helidon cli fails to build #9409

Open
klustria opened this issue Oct 17, 2024 · 0 comments
Open

Generated project from Helidon cli fails to build #9409

klustria opened this issue Oct 17, 2024 · 0 comments
Assignees
Labels
4.x Version 4.x archetypes bug Something isn't working P2

Comments

@klustria
Copy link
Member

klustria commented Oct 17, 2024

Environment Details

  • Helidon Version: 4.0.11
  • Helidon SE or Helidon MP
  • JDK version:
  • OS:
  • Docker version (if applicable):

Problem Description

A generated MP project using the helidon cli fails to build with this error:

src/main/java/module-info.java:[12,25] duplicate requires: jakarta.xml.bind

When the above error is resolved manually, it results to another build failure:

Errors: FileServiceTest » IllegalArgument WELD-001408: Unsatisfied dependencies for type Tracer with qualifiers @Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject io.helidon.microprofile.telemetry.HelidonTelemetryContainerFilter(Tracer, Config)
at io.helidon.microprofile.telemetry.HelidonTelemetryContainerFilter.<init>(HelidonTelemetryContainerFilter.java:0)

Steps to reproduce

Run the helidon cli like below:

Helidon version: 4.0.11
Updating metadata for Helidon version 4.0.11

| Helidon Flavor

Select a Flavor
  (1) se | Helidon SE
  (2) mp | Helidon MP
Enter selection (default: 1): 2

| Application Type

Select an Application Type
  (1) quickstart | Quickstart
  (2) database   | Database
  (3) custom     | Custom
  (4) oci        | OCI
Enter selection (default: 1): 3

| Media Support

Select Media Support
  (1) json      | JSON
  (2) multipart | MultiPart
Enter selection (numbers separated by spaces or 'none') (default: 1): 1 2
Select a JSON library
  (1) jackson | Jackson
  (2) jsonb   | JSON-B
Enter selection (default: 2): 1

| Security

Secure Application (yes/no) (default: no): no

| Database

Database Support (yes/no) (default: no): yes
Select a JPA Implementation
  (1) hibernate   | Hibernate
  (2) eclipselink | EclipseLink
Enter selection (default: 1): 1
Select a Connection Pool
  (1) hikaricp | HikariCP
  (2) ucp      | UCP
Enter selection (default: 1): 2
Select a Database Server
  (1) h2       | H2
  (2) mysql    | MySQL
  (3) oracledb | Oracle DB
Enter selection (default: 1): 1
Auto DDL (yes/no) (default: no): yes
Persistence Unit Name (default: pu1):
Datasource Name (default: ds1):

| Extra

Select Additional Components
  (1) fault-tolerance | Fault Tolerance
  (2) cors            | CORS
Enter selection (numbers separated by spaces or 'none') (default: none): 1

| Observability

Metrics (yes/no) (default: no): yes
Select a Metrics Provider
  (1) microprofile | MicroProfile
  (2) micrometer   | Micrometer
Enter selection (default: 1): 1
Built-in Metrics (yes/no) (default: yes): yes
Health Checks (yes/no) (default: no): yes
Built-in Health Checks (yes/no) (default: yes): yes
Tracing (yes/no) (default: no): yes
Select a Tracing Provider
  (1) jaeger | Jaeger
  (2) zipkin | Zipkin
Enter selection (default: 1): 1

| Packaging and Deployment

Docker support (yes/no) (default: no): yes
GraalVM Native Image Support (yes/no) (default: no): no
JLink Support (yes/no) (default: no): no
Kubernetes Support (yes/no) (default: no): yes
Verrazzano Support (yes/no) (default: no): no
Module support (JPMS) (yes/no) (default: no): yes

| Customize Project

Project groupId (default: me.alexandp-helidon): oracle.mypopescu.spectra.helidon
Project artifactId (default: custom-mp): mp
Project version (default: 1.0-SNAPSHOT):
Java package name (default: me.alexandp.mp.custom): oracle.mypopescu.spectra.helidon.mp

Workaround

  1. 1st issue is a duplicate problem as there are 2 instances of requires jakarta.xml.bind; within module-info.java
  2. The 2nd issue, which only manifests after manually fixing issue no. 1 , i.e. removing the duplicate, is because FileServiceTest requires telemetry cdi extension and that extension in turn needs config cdi extension. Adding these annotations in FileServiceTest will be a workaround for the issue:
@AddExtension(TelemetryCdiExtension.class)
@AddExtension(ConfigCdiExtension.class)
  1. After completing above workaround, the project will then build successfully.
@klustria klustria added archetypes 4.x Version 4.x labels Oct 17, 2024
@m0mus m0mus added bug Something isn't working P2 labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x archetypes bug Something isn't working P2
Projects
Status: Sprint Scope
Development

No branches or pull requests

3 participants