You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jason Dillon <ja...@paybytouch.com> on 2005/06/07 03:17:21 UTC

How to expose expose a Java TagLibrary

Hi, I'm trying to figure out how to expose a Java TagLibrary from a
plugin.

Inside of my plugin, I can create a:

<define:taglib uri="myplugin">
    <define:tag name="dependency-handle">
    </define:tag>
</define:taglib>

And I can access this taglib just fine from another project.

Similarly in my plugin, I can define:

<project xmlns:local="jelly:com.whatever.jelly.MyTagLibrary">
    <local:sometag/>
</project>

And I can now access the Java TagLibrary MyTagLibrary from inside the
plugin.

But, what I am trying to do is to create a plugin which provides a set
of tags for use in other projects.

How can I expose a Java TagLibrary as if it were a <define:taglib>
inside of my plugin.jelly?

I tried using <define:jellybean>, <define:bean> with no luck.  While I
was able to get the tag to attach to the taglib, it did not allow the
tags to properly find their parent via findAncestorWithClass().

So far the only luck I have had with exposing Java TagLibraries
externally is to have the plugin nest the tags inside of a dynamic tag
created.

Is this even possible with Maven 1.0.2?  If so, could someone explain
how I can do this.

Thanks,

--jason 

===========================================================================
This email and any attachment(s) thereto, are intended for the use of
the addressee(s) name herein and may contain legally privileged and or
confidential information under applicable law. If you are not the 
intended recipient of this e-mail, you are hereby notified any 
dissemination, distribution or copying of this email, and any attachment(s)
thereto, is strictly prohibited. If you have received this communication
in error, please notify the sender at 415-281-2200 or via return e-mail at
postmaster@paybytouch.com and permanently delete the original copy and 
any copy of any e-mail, and any printout thereof. Thank you for your 
cooperation.






Re: How to expose expose a Java TagLibrary

Posted by Brett Porter <br...@gmail.com>.
There are a couple of alternatives.

Like the artifact plugin, you can wrap the java in a "jellybean", and
use the exported tag library for that. I think this is what you
describe below as unsatisfactory.

The other alternative is to put the tag library in a JAR, add that as
a dependency on the project, and reference it like this:

xmlns:foo="jelly:com.foo.tags.FooTagLibrary"

See the Xdoc plugin for an example where it references it's own
classes to do that.

HTH,
Brett

On 6/7/05, Jason Dillon <ja...@paybytouch.com> wrote:
> Hi, I'm trying to figure out how to expose a Java TagLibrary from a
> plugin.
> 
> Inside of my plugin, I can create a:
> 
> <define:taglib uri="myplugin">
>     <define:tag name="dependency-handle">
>     </define:tag>
> </define:taglib>
> 
> And I can access this taglib just fine from another project.
> 
> Similarly in my plugin, I can define:
> 
> <project xmlns:local="jelly:com.whatever.jelly.MyTagLibrary">
>     <local:sometag/>
> </project>
> 
> And I can now access the Java TagLibrary MyTagLibrary from inside the
> plugin.
> 
> But, what I am trying to do is to create a plugin which provides a set
> of tags for use in other projects.
> 
> How can I expose a Java TagLibrary as if it were a <define:taglib>
> inside of my plugin.jelly?
> 
> I tried using <define:jellybean>, <define:bean> with no luck.  While I
> was able to get the tag to attach to the taglib, it did not allow the
> tags to properly find their parent via findAncestorWithClass().
> 
> So far the only luck I have had with exposing Java TagLibraries
> externally is to have the plugin nest the tags inside of a dynamic tag
> created.
> 
> Is this even possible with Maven 1.0.2?  If so, could someone explain
> how I can do this.
> 
> Thanks,
> 
> --jason
> 
> ===========================================================================
> This email and any attachment(s) thereto, are intended for the use of
> the addressee(s) name herein and may contain legally privileged and or
> confidential information under applicable law. If you are not the
> intended recipient of this e-mail, you are hereby notified any
> dissemination, distribution or copying of this email, and any attachment(s)
> thereto, is strictly prohibited. If you have received this communication
> in error, please notify the sender at 415-281-2200 or via return e-mail at
> postmaster@paybytouch.com and permanently delete the original copy and
> any copy of any e-mail, and any printout thereof. Thank you for your
> cooperation.
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org