1
votes

Within WebSphere Application Server Liberty Profile Guide for Developers pdf in section 1.4 (Frictionless application development), it mentions:

By default, the Liberty profile will monitor deployed applications for changes. Updates to static files (HTML, CSS, or JavaScript) or JSP files are detected and served immediately. Changes to servlet classes cause an automatic restart of the application.

I am not deploying via dropins folder. I have a configured server.xml file within Eclipse

<application location="/Users/path/my_application.ear" type="ear"></application>

I am not able to make any changes to my source UI files and see updates on WebSphere. I am also not able to find a particular js file deployed anywhere, so it seems the *.ear file is not expanded, so I could edit the file directly on the server.

The only way I can see changes to my UI files is to make the changes to the source files and rebuild the ear file.

I feel like I am not creating a proper mapping to my source files and/or perhaps the Liberty profile on Mac doesn't explode the ear files so that I can edit the deployed UI files.

Thoughts?

2

2 Answers

3
votes

If you want to have automatic updates of your files on the server, the best way is to use Eclipse to deploy the project to the server using "Add Remove" option on the server. This configures server.xml to point to your expanded app in the workspace. As result any changes to the files in the workspace are visible and detectable by the server.

If you configured your server.xml with path to the ear, it will monitor only for ear changes. And since your UI files are in totally different place, changes are not detected unless you rebuild your ear.

For deployment options to Liberty see the following links:

1
votes

It is possible to indicate path to an already deployed application, in my case it's a web application:

<webApplication location="\programs\wlp\app1_war" name="app1" contextRoot="app1">       
        <classloader delegation="parentLast"/> 
</webApplication>

Changes in some scripts will be loaded automatically, but java classes are loaded by class loader when server starts or when app is redeployed.

See classLoader and classloaderContext, maybe there is a way to make class loader to reload classes at change: https://www.ibm.com/support/knowledgecenter/SSD28V_8.5.5/com.ibm.websphere.wlp.core.doc/autodita/rwlp_metatype_core.html?view=kc#mtFile17