OpenLiberty / liberty-language-server

The Liberty Config Language Server provides language server features for Liberty server configuration files through any of the supported client IDEs.
Eclipse Public License 2.0
5 stars 11 forks source link

Handle external installation directory correctly #191

Closed cherylking closed 1 year ago

cherylking commented 1 year ago

If the Liberty installation is located outside of the target/build directory, some functionality is lacking. For example, the schema cannot be generated to validate the server.xml causing the default server schema to be used. This is because the code looks for the ws-schemagen.jar in the target/build directory and does not find it.

This scenario occurs when the installDirectory parameter is specified for the Liberty Maven plugin, or the installDir property is specified for the Liberty Gradle plugin. Once Liberty is installed, the location of the installation can be determined from the installDirectory element in the liberty-plugin-config.xml file which is in the target/build directory.

    <installDirectory>/path/to/liberty/wlp</installDirectory>

So if that installDirectory path does not start with the Liberty workspace path in the IDE, we should look for the ws-schemagen.jar at that path instead.

This would also affect feature list generation, which uses the ws-featurelist.jar from Liberty.

Finally, the basic determination of which runtime (OpenLiberty vs WebSphere Liberty) and version are installed (getRuntimeInfo() and getVersion() in LibertyUtils.java) does not work correctly in this scenario.

Need to determine if there is any other functionality lacking when the Liberty installation is not in the Liberty workspace for the IDE.

cherylking commented 1 year ago

Noting here that I opened this issue due to a comment in #188.