OpenLiberty / ci.maven

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

install-feature doesn't resolve server config variables #1549

Open jjiwooLim opened 2 years ago

jjiwooLim commented 2 years ago

https://github.com/OpenLiberty/ci.maven/issues/1530#issuecomment-1152552628 Use of variables in the server.xml like <feature>${it.feature}</feature> cannot be resolved with install-feature goal. User declared the variable using the Maven property liberty.var.{var}

scottkurz commented 2 years ago

I thought this was a limitation of the Open Liberty runtime. Does the runtime support this?

jjiwooLim commented 2 years ago

@scottkurz It looks like the install-feature goal gets the list of server.xml features from ServerFeatureUtil. getServerFeatures() and send the list to the OL runtime.

scottkurz commented 2 years ago

@scottkurz It looks like the install-feature goal gets the list of server.xml features from ServerFeatureUtil. getServerFeatures() and send the list to the OL runtime.

I didn't realize the variable in this place was substituted by plugin code. Still, though, even if we were to fix the plugin here, the OL runtime still wouldn't be able to handle this server.xml, IIUC. So is it worth fixing then?

cherylking commented 1 year ago

@jjiwooLim I don't think the liberty runtime supports variables in the server.xml <feature> element. This seems like a very odd use case. Can we close this issue?

scottkurz commented 1 year ago

Hmm...I wonder if there's anything more to say here.

From the runtime perspective, I think I made a mistake in testing to claim the substitution couldn't be done via bootstrap.properties. It seems to even work when substituting with a variable in the configDropins overrides.

However when I tried running through LMP it didn't work. Need to investigate more.