-
Notifications
You must be signed in to change notification settings - Fork 535
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
k8s:build jar packaging igonoring some files (when run on Jenkins) #771
Comments
Do you have a sample reproducer project we can try out? Does it only happen on Jenkins or also on some other CI(CircleCI/Github Action etc)? |
The JKube plugins are not involved in the packaging of the jar, they however select a Jar to be added to the container image (in case you are using generators). My only guess is that your jar file is repackaged after the container image is built or that a wrong jar is selected by JKube, I can't see any other explanation for this situation. As Rohan points out, some way to reproduce this issue would be extremely helpful. |
After some deeper research, we found that the maven-frontend-plugin (used to package together React and Java apps) was not generating the artifacts soon enough to be copied in the JAR. So we bound that plugin to an earlier phase of the maven lifecycle, which fixed the problem. Thanks for your help. |
Great you could fix it, thx for sharing! |
BTW, I usually bind those tasks to the |
As we started the project from an existing example, the yarn build generation and the copy of the resources were bound to later phases ( |
Closing this issue as it seems the problem was fixed. |
Description
Info
mvn -v
) : 3.8.1N/A
We have a simple spring boot react app generated from an archetype. When running mvn k8s:build locally everything seems to be ok. We are able to deploy the image in our minikube. However, we noted that when running the integration pipeline in our Jenkins server the deployed app is faulty. After carefully analysing the differences between the two built images we found that the one produced by Jenkins is different. Long story short the .jar file in the target/docker/.../build/maven/target/ corresponding with our app misses the 'public' folder. However, that 'public' folder is present in target/docker/.../build/maven/target/classes and in the jar created by maven itself in the target folder . We are assuming that the jkube plugin is packaging differently than the default maven packaging strategy. Moreover, that also depends on the settings of our CI system because in our local machines it works as expected. We tried to locate anything on the Jenkins configuration that will cause this strange behaviour but we have no clue at the moment. We will appreciate any help in understanding the process that the plugin follows to build the jar in order to identify the cause of this problem.
Jenkins 2.289.1 with:
JDK AdoptOpenJDK-11.0.11+9
Maven 3.8.1
If it's a feature request, what is your use case :
Sample Reproducer Project : [GitHub Clone URL]
The text was updated successfully, but these errors were encountered: