support multiple webservice project
Description
Environment
Activity
Carlos Ruiz December 30, 2023 at 10:54 AM
Thanks - tested and merged

Hiep Lq December 30, 2023 at 5:11 AM
cxf-core do Export-Package: META-INF.cxf
so spring can read bean define inside
cxf-rt-frontend-jaxws
has cxf-servlet.xml
but not export.
org.idempiere.webservices.xml/rest-context.xml use cxf-servlet.xml
, so org.idempiere.webservices.resources need to export META-INF.cxf
i try to add META-INF.cxf
to excludes but it complain “invalid package name“ maybe by upper case
so i move cxf-servlet.xml
to org.idempiere.webservices.resources/cxf
Carlos Ruiz December 29, 2023 at 2:55 PM
Hi - I pushed the pull request 2167.
Leaving this here open for your review, in case the package needs to be renamed in other way, or the Export-Package needs to be moved elsewhere.
Carlos Ruiz December 28, 2023 at 7:40 PM
Hi
Could you please review the pull request 2167 ?
With this ticket you added a like Export-Package: META-INF.cxf
to the MANIFEST.MF
on org.idempiere.webservices.resources package, and that’s stopping the javadoc from working correctly, please check my comments here:
As I don’t use this feature you added, I don’t know the impact of removing that line from the MANIFEST.MF
When I remove that line (in the pull request) then the javadoc completes successfully, but it maybe can impact what you are trying to achieve with this ticket.
Regards,
Carlos Ruiz
overview
When create new webservice with rest (spring + cxf) project, there are some aspect that we can improve:
There is an endpoint already running on /rest
duplicate resource and code
in new project, need to deploy offline file in IDEMPIERE-4183: Web services is loading spring schema resources from spring web site
duplicate class ContextLoaderListener
duplicate file in META-INF/cxf (META-INF/cxf/cxf-servlet.xml)
solution
issue 1: already has solution on link. that parameter should be added by default to core
issue 2: reuse resources with following improvements:
add new plugin org.idempiere.webservices.helper.resoucelookup
move xsd file to the new plugin and export it
move META-INF/cxf to the new plugin and export it
move ContextLoaderListener to the new plugin and modify contextInitialized code to set classloader of webservice project as ContextClassLoader of current thread
web service project will import the new plugin to gain access to resources and ContextLoaderListener class