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

release bug - When packaging server with app into uber jar extensions folder is not included in the final deployment #5881

Closed
doychin opened this issue Nov 29, 2018 · 11 comments

Comments

@doychin
Copy link

doychin commented Nov 29, 2018

We try to create uber jar for one war file and we use maven to do that
mvm package-server fails to include the additional extensions we add in the directory of the application where it is deployed before it is packaged into uber jar.

This is a behavior we see with open liberty 18.0.0.3

@scottkurz
Copy link
Member

@doychin it looks like you are using the liberty-maven-plugin to package your app and server, and you are having a packaging issue.

We use the WASdev/ci.maven repository to track issues with our maven plugin. You can open a new issue here. It would help to include a pom.xml sample (or snippet).

Thank you.

@hlhoots
Copy link
Member

hlhoots commented May 1, 2019

Looks like this might be in the server package command. Kernel team will investigate as soon as possible.

@hlhoots
Copy link
Member

hlhoots commented May 3, 2019

@doychin Would you be able to give us an example of the problem? Maybe a snapshot of the directory structure, and a snapshot of what is missing from the package.

@doychin
Copy link
Author

doychin commented May 3, 2019

Hi, You can check this repository
https://github.com/bgjug/microprofile-hol-1x
It contains Hands On Lab for microprofile. One of the projects (content) is based on Open Liberty.

There is an issue open for that problem in that repository.
bgjug/microprofile-hol-1x#10

@hlhoots
Copy link
Member

hlhoots commented May 8, 2019

@doychin
Thanks for that info!

Do you know what package "include" options were used in your pom file? Assuming you might have used the default of 'all' but wanted to check before digging deeper into the issue.

https://github.com/WASdev/ci.maven/blob/master/docs/package-server.md

@doychin
Copy link
Author

doychin commented May 8, 2019 via email

@hlhoots
Copy link
Member

hlhoots commented May 15, 2019

Hi @doychin --

After some troubleshooting and talking with @scottkurz it looks like it is not the OL package command that is the causing the issue but a mismatch in the pom.xml between the userDirectory and the installDirectory. The user and install directories have to be aligned so that the extension you are installing is in the directory structure where the Liberty package command occurs. So what is happening is that the zipkin feature is being installed into the /liberty folder:

<groupId>com.googlecode.maven-download-plugin</groupId> -> <outputDirectory>${project.build.directory}/liberty/wlp/usr</outputDirectory>

And the userDirectory and assemblyInstallDirectory (where the package happens) doesnt match:

<groupId>net.wasdev.wlp.maven.plugins</groupId> -> <userDirectory>${project.build.directory}</userDirectory>
and
<groupId>net.wasdev.wlp.maven.plugins</groupId> -> <assemblyInstallDirectory>${project.build.directory}</assemblyInstallDirectory>

The package command will only pickup things from the folder in which it is executed, thus with the extension in /liberty and the package happening on /wlp the /extensions folder is missing from the content.jar file.

So the package seems to work as expected with these changes - please give them a try and see if they will work properly for your project (note the values all end in /liberty):

<groupId>com.googlecode.maven-download-plugin</groupId> -> <outputDirectory>${project.build.directory}/liberty</outputDirectory> <groupId>net.wasdev.wlp.maven.plugins</groupId> -> <userDirectory>${project.build.directory}/liberty</userDirectory> <groupId>net.wasdev.wlp.maven.plugins</groupId> -> <assemblyInstallDirectory>${project.build.directory}/liberty</assemblyInstallDirectory>

By the way, the copy-resources goal should also align with the user directory(which looks like it is correct in the /liberty folder):

<artifactId>maven-resources-plugin</artifactId> -> <outputDirectory>${project.build.directory}/liberty/wlp/usr/servers/${serverName}/resources/security</outputDirectory>

@hlhoots
Copy link
Member

hlhoots commented May 17, 2019

Hi @doychin - any updates on that suggestions above for resolution?

@doychin
Copy link
Author

doychin commented May 17, 2019 via email

@hlhoots
Copy link
Member

hlhoots commented May 17, 2019

Sounds good - Thanks!

@doychin
Copy link
Author

doychin commented May 18, 2019

Hi Harry,
I treid your suggestions and it really worked.
thanks.

@doychin doychin closed this as completed May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants