eclipse - EAR file with multiple WAR files. Sharing classes -


i using eclipse neon , maven development. there 2 main projects. project 1 contains web services including both soap , restful. has database accesses implemented. project 2 contains ui angular implementation. angular ui utilizes restful services of project 1 data access. application packaged ear file containing war files 2 projects. (this not design!!!)

there few servlet classes in ui application handles authorization issues. classes in each war file independent. need access data database tables 1 of servlet classes. since capability in project 1 should able utilize classes in project 2.

in eclipse have both projects in workspace , have added project 1 build path of project 2 can add proper objects needed project 2. however, when try build project 2 can't find classes project 1. tried adding project 1 export list of project 2 made no difference.

i can provide pom files necessary.

i don't know try.

one way share these db access features in both applications consist in packaging them common libs within ear.

see this maven documentation

just 1 remark, imo it's not pattern have multiple application accessing/modifying same data model. see this answer on question "multiple application using 1 database?" details.

so perhaps should consider keeping data model access logic in existing first war (which contain rest , soap services) , make second app backend consume new service first app example?

another option package these webapps single 1 (so single war), providing both ui , backend features (your servlets , apis together).

edit: cannot judge application design not take @ it. pointed out @david, it's not bad pattern have multiple webapps different purposes, packaged ear or not, more if these apis made different types of clients (ui, backends, etc...)


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -