You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/06/02 05:29:00 UTC
[jira] [Resolved] (CAMEL-16670) Camel Component & Package Maven
Plugins fail on some JSON resource files
[ https://issues.apache.org/jira/browse/CAMEL-16670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-16670.
---------------------------------
Fix Version/s: 3.11.0
Assignee: Claus Ibsen
Resolution: Fixed
Thanks for reporting, and telling the steps to reproduce this
> Camel Component & Package Maven Plugins fail on some JSON resource files
> ------------------------------------------------------------------------
>
> Key: CAMEL-16670
> URL: https://issues.apache.org/jira/browse/CAMEL-16670
> Project: Camel
> Issue Type: Bug
> Components: tooling
> Affects Versions: 3.10.0
> Reporter: Zachary Gramana
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 3.11.0
>
>
> *Given:*
> * Create a new route project using spring-boot archetype
> * Create `src/main/resources/test.json` with contents:
> {code:java}
> [{ "fizz": "buzz" }]{code}
> * Add the following XML to the `<plugins>` node in `pom.xml`:
> {code:java}
> <plugin>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-package-maven-plugin</artifactId>
> <version>3.10.0</version>
> <executions>
> <execution>
> <id>generate</id>
> <goals>
> <goal>generate-component</goal>
> </goals>
> <phase>process-classes</phase>
> </execution>
> </executions>
> </plugin>
> {code}
> * Run `mvn package`
> *Expected:*
> {code:java}
> [INFO] BUILD SUCCESS{code}
> *Observed:*
> {code:java}
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 3.852 s
> [INFO] Finished at: 2021-05-28T12:34:00-07:00
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.camel:camel-package-maven-plugin:3.10.0:generate-component (generate) on project CommandInvocationRoute: Error generating data org.apache.maven.plugin.MojoFailureException: Unable to create mojo: class org.apache.camel.util.json.JsonArray cannot be cast to class org.apache.camel.util.json.JsonObject (org.apache.camel.util.json.JsonArray and org.apache.camel.util.json.JsonObject are in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @7d3fb0ef) -> [Help 1]{code}
> *Notes:*
> Removing the square brackets avoids the problem. For example, the following `test.json` contents enables a successful build:
> {code:java}
> { "fizz": "buzz" }
> {code}
> In addition, renaming the file to `test.txt` avoids the problem.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)