0

I have several CAF applications, that are part of one SW project.

The question is: "Is there a way to share common code, to prevent copy+paste into all applications?"

Betlista
  • 10,327
  • 13
  • 69
  • 110
  • What's a SW project? – Rob Grant Jun 01 '16 at 14:03
  • SW stands for Software, I wanted to distinguish the software and java projects (modules) – Betlista Jun 01 '16 at 21:03
  • 1
    Ah okay :) You said applications, but just to check - do you mean portlets? They can be combined into one portlet project if you want to share a significant amount of code between them. However, if you just want to share common jars between your projects your ant script is a cool solution. Alternatively you could use [Apache Ivy](http://ant.apache.org/ivy/) to pull them in from a local repo. Additionally, if your lib requirements are mature you could [create a custom project facet](http://www.eclipse.org/articles/Article-BuildingProjectFacets/tutorial.html) for key jars. – Rob Grant Jun 03 '16 at 03:29

1 Answers1

1

It turned out, that (at least my opinion) CAF aplications are published strangly from designer - I expected war, but instead, in deploy folder, there is CAF application folder in which there is WEB-INF and in its lib folder there is jar created from all classes in Eclipse project :-/


The solution I used is to have shared Java project exported to jar and copied to CAF projects' lib folder.

For this I used two things:

Community
  • 1
  • 1
Betlista
  • 10,327
  • 13
  • 69
  • 110
  • You should see your project's .war file in the deploy directory, which then is unzipped into a folder in the same directory. This isn't a CAF-specific behaviour; pretty much any Java app server does exactly this for any war file deployed to it. – Rob Grant Jun 03 '16 at 03:31