HavenNo7
HavenNo7

Reputation: 107

Core JSF2 Project reusable for other projects [JAR]

I created a project with many Abstract and Generic classes to work with and some composite components. I changed the packing to JAR and used it as a maven dependency for another projects.

So, everything on server side is working. Spring injects my classes and stuff.. But the composite components isn´t found. I search around stackoverflow, and saw some errors referencing the JARs dirs. But I don´t know if I put the composite component on the core project at the correct dir. This is the path I added it (normally, as if it was a client-project):

  - br
       - main
              - webapp
                     - resources
                              - myCompositeFolder

Is it correct? How do I change maven packing to make it work?

I also want to ask another thing... I have to costumize composite component 'injecting' some extra code from the client-project. To do that, I did something like this on the component:

<ui:include src="/filters/extraFilters.xhtml" />

and that file (extraFilters) will be located on the client-project webapp folder. I tested on the same project, it worked. Just don´t know if it will work loading from a JAR!

Upvotes: 1

Views: 621

Answers (1)

HavenNo7
HavenNo7

Reputation: 107

I made it work without the WAR.

Thanks to Visola (http://bearprogrammer.com/). The solution was: but the composite folder inside the parent (core) project:

 src\resources\META-INF\resources

And , done! All in one JAR!

Thanks BalusC, Visola and Jin!

Upvotes: 1

Related Questions