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

io.fabric8:crd-generator need kubernetes-client-5.2.1 #3456

Closed
kanedafromparis opened this issue Sep 9, 2021 · 5 comments
Closed

io.fabric8:crd-generator need kubernetes-client-5.2.1 #3456

kanedafromparis opened this issue Sep 9, 2021 · 5 comments

Comments

@kanedafromparis
Copy link
Contributor

Hello,

I am sorry for the noise, and thanks you for yours great job.

I tried to use io.fabric8:crd-generator and encounter a strange issue.

if I build my project with the latest client (aka 5.7.3) i have a compilation error :

mvn clean package
...
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ foo-sample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to /...foo-sample/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.852 s
[INFO] Finished at: 2021-09-09T12:07:07+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project foo-sample: Fatal error compiling: java.lang.NoClassDefFoundError: io/fabric8/kubernetes/client/utils/Pluralize: io.fabric8.kubernetes.client.utils.Pluralize -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

after a few investigation I manage to make it works with kubernetes-client-5.2.1

I also notice (which explain the issue):

$ jar tf ${HOME}/.m2/repository/io/fabric8/kubernetes-client/5.2.1/kubernetes-client-5.2.1.jar | grep Plu
# io/fabric8/kubernetes/client/utils/Pluralize$StringReplace.class
# io/fabric8/kubernetes/client/utils/Pluralize.class
$ jar tf ${HOME}/.m2/repository/io/fabric8/kubernetes-client/5.7.3/kubernetes-client-5.7.3.jar | grep Plu
#

My guess would be that it is because they was no release of crd-generator-api after 5.1.1, while the other still evolved

@kanedafromparis
Copy link
Contributor Author

@metacosm
Copy link
Collaborator

metacosm commented Sep 9, 2021

The artifact is different: it got split into crd-generator-api, which allows you to generate the CRDs programmatically and crd-generator-apt, which is using an annotation processor to generate the CRDs. If you want a simple replacement of the old crd-generator artifact, then you need to use crd-generator-apt instead.
See https://github.com/fabric8io/kubernetes-client/releases/tag/v5.2.0. I guess that could have been made more explicit.

@kanedafromparis
Copy link
Contributor Author

OK, thanks for the feedback.

I propose a PR (master...kanedafromparis:patch-1) to match this.

@metacosm
Copy link
Collaborator

metacosm commented Sep 9, 2021

Please open a PR for that change.

@kanedafromparis
Copy link
Contributor Author

There : #3457

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

No branches or pull requests

2 participants