[Yanel-dev] shared library
Cedric Staub
cedric.staub at wyona.com
Thu Oct 14 09:01:17 CEST 2010
Hi
On Wed, Oct 13, 2010 at 05:35:12PM +0100, Paul Bakker wrote:
> Can you recommend an approach for where to put utility classes that contain
> methods that could be used by several resource types?
Personally, I like to do it this way:
1. I create a new resource type, e.g. my-shared-resource.
2. I let the resource type be packaged into a jar file by creating a
pom.xml file within src/build. Here's an example from our newly released
konakart-yanel-realm's shared resource:
<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>wyona-org-yanel</groupId>
<artifactId>yanel-resource- at NAME@</artifactId>
<version>@VERSION@</version>
</project>
3. Then you'll need to add that resource to the dependencies of your
other resources by writing it into src/build/dependencies.xml:
<dependency groupId="wyona-org-yanel" artifactId="yanel-resource-konakart-shared" version="0.0.1-dev-rXXX"/>
4. And last but not least, add the resource to your realm's
resource-types.xml. But make sure to put it at the top of the list, so
it gets compiled before all the other resources.
You can look at our konakart-yanel-realm as an example:
http://svn.wyona.com/repos/public/yanel/contributions/realms/konakart-yanel-realm/
The shared resource there is simply called "shared".
Greetings,
Cedric
More information about the Yanel-development
mailing list