OpenLiberty / ci.maven

Maven plugins for managing Liberty profile servers #devops
Apache License 2.0
126 stars 90 forks source link

Generate features, configuration directory and serverXmlFile in non-default location #1384

Open kathrynkodama opened 2 years ago

kathrynkodama commented 2 years ago

Users can specify locations for their configuration directory and serverXmlFile in the configuration block of the Liberty Maven plugin, ie.

<serverXmlFile>publish/servers/server.xml</serverXmlFile>
<configDirectory>publish/config</configDirectory>   

Looks like generate features is not currently picking up these locations:

[WARNING] The server file C:\MyData\MyWDTWorkspaces\GarageSale\GarageSaleEE7\garageSale-ee7\GarageSaleRuntimeUtil\src\main\liberty\config\server.xml does not exist. Skipping its features.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.526 s
[INFO] Finished at: 2022-01-20T12:58:19-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.5.2-SNAPSHOT:dev (default-cli) on 
project GarageSaleRuntimeUtil: Failed to generate a working set of features. Error collecting list of directories to send 
to binary scanner, list is null or empty.. To disable the automatic generation of features, start dev mode with -
DgenerateFeatures=false. 
kathrynkodama commented 2 years ago

Error message above looks related to https://github.com/OpenLiberty/ci.maven/issues/1321 But the server.xml file indicated in the console output is incorrect. Will need to debug and test this scenario more once #1321 is fixed.

kathrynkodama commented 2 years ago

As part of this item, we need to update the logic we have to write the generated features comment to the user's server.xml file after feature generation. See https://github.com/OpenLiberty/ci.gradle/pull/752#discussion_r876167289