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

Exploded loose app format doesn't include separate 'target/classes' entry; doesn't update app using mvn compile outside of all-in-one goals #1572

Closed
scottkurz opened this issue Aug 5, 2022 · 0 comments · Fixed by #1714

Comments

@scottkurz
Copy link
Member

scottkurz commented Aug 5, 2022

The "exploded" loose app format added for #1104 in v3.5.2 was done a bit incorrectly, without a separate entry mapping "target/classes" to "WEB-INF/classes".

It's clear if you compare the generated loose app format to the one in the UFO design linked from #1104, however it's a bit of a subtle use case that's broken which might be forgotten somewhat if you think of loose apps mainly being run together with dev mode and/or the all-in-one goals in general (dev + run both). So let me elaborate on a recreate to show what has been missed:

Good case

  1. git clone git@github.com:OpenLiberty/guide-getting-started.git; cd guide-getting-started/finish
  2. upgrade liberty-maven-plugin to latest v3.6.1
  3. mvn liberty:run (This provides a shortcut to getting everything installed and deployed)
  4. Add a println in SystemResource#getProperties()
  5. mvn compile (from a separate terminal... or use an IDE)
  6. curl http://localhost:9080/dev/system/properties
  7. In liberty:run window, or via cat target/liberty/wlp/usr/servers/defaultServer/logs/messages.log (and observe new println value in output)
  8. Ctrl+C (back in liberty:run window)
  9. cat target/liberty/wlp/usr/servers/defaultServer/apps/guide-getting-started.war.xml (observe "..../target/classes" entry in loose app XML mapping to /WEB-INF/classes, e.g:
<dir sourceOnDisk="C:\aaa\Work\tmp\aasdfadsf\guide-getting-started\finish\target\classes" targetInArchive="/WEB-INF/classes"/>

Bad case

  1. Add this config to maven-war-plugin in pom.xml (forcing use of the newer "exploded" format)
                <configuration>
                    <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                </configuration>
  1. mvn liberty:run (shortcut to redeploy)
  2. Change the println value in SystemResource#getProperties()
  3. mvn compile
  4. curl http://localhost:9080/dev/system/properties
  5. In liberty:run window, or via cat target/liberty/wlp/usr/servers/defaultServer/logs/messages.log (and observe OLD println value in output, NOT the NEW)
  6. Ctrl+C
  7. cat target/liberty/wlp/usr/servers/defaultServer/apps/guide-getting-started.war.xml (observe NO "target/classes" entry in loose app XML)

This should be an easy enough fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant