What is the best way to share common code (such as domain classes) between two or more projects?

后端 未结 7 1861
野的像风
野的像风 2021-02-02 11:33

We are developing a Web application consisting of two Eclipse projects. One project is an HTTP-based RESTful Web service; the other project is a Web site. Both

7条回答
  •  面向向阳花
    2021-02-02 12:08

    How do you use third party jars? Think about your common code to be third party jar and apply the same rule to your projects. You can use dependency management tool like maven in order to keep versioning in order.

    If you want to upgrade to an Application Server where you can deploy EARs you can put the common code in a jar which is a dependency of your EAR... so other WAR projects in your EARs can use the common code.

    You can also give a try to OSGI.

提交回复
热议问题