Grokbase Groups Maven users May 2003
FAQ
I have been reading around the maven site and looking at the plugins.
Although maven supports the ant tasks, is is the intention that we write
maven plugins now, where we would have written ant tasks and used taskdef
elements before?

Neil

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

Search Discussions

  • Jason van Zyl at May 20, 2003 at 2:12 pm

    On Tue, 2003-05-20 at 09:56, Neil Blue wrote:
    I have been reading around the maven site and looking at the plugins.
    Although maven supports the ant tasks, is is the intention that we write
    maven plugins now, where we would have written ant tasks and used taskdef
    elements before?
    Write beans that can be used from anywhere. There is a very popular
    misconception that plugins need to be written entirely in Jelly. This is
    wrong. Write a simple bean to do what you want and if written correctly
    you can use this bean from Jelly or anywhere else like an IDE.

    Jelly makes it dead simple to use normal beans inside Jelly script and
    having the code in Java makes testing easier and more reliable IMO.

    For example I have rewritten the Plexus plugin to be a Java bean so I
    can hook this into Jelly easily if I choose, but I can also use it from
    an IDE. If you go the route of a bean (or some scripting alternative
    that truly allows inheritance like beanshell or jython) then you can use
    your code in more places than simply Jelly. Avoid writing JellyTags or
    Ant Tasks because each is bound to the particular environment. Ant can
    be a particular problem wrt ClassLoaders. Make a bean, and then adapt
    it, wrap it, decorate it or whatever else you have to do to make it work
    in a particular environment.
    Neil

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

    Jason van Zyl
    jason@zenplex.com
    http://tambora.zenplex.org

    In short, man creates for himself a new religion of a rational
    and technical order to justify his work and to be justified in it.

    -- Jacques Ellul, The Technological Society


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
    For additional commands, e-mail: users-help@maven.apache.org
  • Mark R. Diggory at May 20, 2003 at 2:29 pm
    Jason,

    Wow, a good and often overlooked detail about extending Jelly
    capabilities. I wrote my own entire set of Jelly Tags to extend another
    package into Jelly, mostly because it was not very JavaBean in nature
    (no default constructors, lots of non-get/set methods). So the
    taglibrary does actually just act as a wrapper around a set of basic
    java objects.

    I didn't need to do this to use the objects, I could have done it in
    more "verbose" fashion with the core taglibrary, but I wanted to control
    the markup used with my objects too, eventually attempting to validate
    it with schemas.

    Jelly could use a really good example of your outline for using normal
    beans(classes) and tags as wrappers (when even required) within its site
    Tutorial. It is a design that I think should be promoted.

    -Mark

    Jason van Zyl wrote:
    On Tue, 2003-05-20 at 09:56, Neil Blue wrote:

    I have been reading around the maven site and looking at the plugins.
    Although maven supports the ant tasks, is is the intention that we write
    maven plugins now, where we would have written ant tasks and used taskdef
    elements before?

    Write beans that can be used from anywhere. There is a very popular
    misconception that plugins need to be written entirely in Jelly. This is
    wrong. Write a simple bean to do what you want and if written correctly
    you can use this bean from Jelly or anywhere else like an IDE.

    Jelly makes it dead simple to use normal beans inside Jelly script and
    having the code in Java makes testing easier and more reliable IMO.

    For example I have rewritten the Plexus plugin to be a Java bean so I
    can hook this into Jelly easily if I choose, but I can also use it from
    an IDE. If you go the route of a bean (or some scripting alternative
    that truly allows inheritance like beanshell or jython) then you can use
    your code in more places than simply Jelly. Avoid writing JellyTags or
    Ant Tasks because each is bound to the particular environment. Ant can
    be a particular problem wrt ClassLoaders. Make a bean, and then adapt
    it, wrap it, decorate it or whatever else you have to do to make it work
    in a particular environment.

    Neil

    ---------------------------------------------------------------------
    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
  • Jason van Zyl at May 20, 2003 at 3:49 pm

    On Tue, 2003-05-20 at 10:31, Mark R. Diggory wrote:
    Jason,

    Wow, a good and often overlooked detail about extending Jelly
    capabilities. I wrote my own entire set of Jelly Tags to extend another
    package into Jelly, mostly because it was not very JavaBean in nature
    (no default constructors, lots of non-get/set methods). So the
    taglibrary does actually just act as a wrapper around a set of basic
    java objects.
    When I say bean I really mean just a plain java object. Doesn't have to
    be a bean per se, the things I write just tend to expose things with
    accessors and I just call them beans.
    I didn't need to do this to use the objects, I could have done it in
    more "verbose" fashion with the core taglibrary, but I wanted to control
    the markup used with my objects too, eventually attempting to validate
    it with schemas.

    Jelly could use a really good example of your outline for using normal
    beans(classes) and tags as wrappers (when even required) within its site
    Tutorial. It is a design that I think should be promoted.
    The changelog plugin is a good example:

    <define:taglib uri="changelog">
    <define:jellybean
    name="changelog"
    className="org.apache.maven.changelog.ChangeLog"
    method="doExecute"
    />
    </define:taglib>

    Really, it's as simple as creating a dynamic tag library that uses the
    define:jellybean notion. In essence you grab onto a normal bean by
    providing a class name and the method to execute to fire the bean into
    motion. Using accessors to set values is also generally better too as
    you knows where you might use the bean and using tools like beanutils or
    OGNL is easier with beans then trying to fart around with constructors
    and reflection.

    Really you need to focus on what you want to accomplish without getting
    distracted by where you want to run the bean. There are so many good
    tools/techniques now for wrapping plain java objects to make them work
    in various environments. I know you're familiar with BCEL and I'm sure
    someone could come up with a way to wrap a bean and turn it into an ant
    task dynamically. I tend to use AspectJ, some people use dynamic proxies
    and other forms of method interception.

    So again using my little Plexus generator as an example, the core
    generates the runtimes but I'm working on a layer that sits above the
    core with array of listeners so that the Plexus generator can work in an
    IDE. This I can definitely use as an example when it's working decently.
    Dan is actually going to try to get it to work in eclipse. I think
    people tend to make things more complicated than necessary and as soon
    as you starting binding the core of whatever you are doing to an
    execution environment you're hosed. I've speak from experience as I've
    been hosed more often than I would like to admit. Being from Canada that
    makes me a hoser eh? (Bad Canadian references are bound to occur this
    close to Victoria Day).
    -Mark

    Jason van Zyl wrote:
    On Tue, 2003-05-20 at 09:56, Neil Blue wrote:

    I have been reading around the maven site and looking at the plugins.
    Although maven supports the ant tasks, is is the intention that we write
    maven plugins now, where we would have written ant tasks and used taskdef
    elements before?

    Write beans that can be used from anywhere. There is a very popular
    misconception that plugins need to be written entirely in Jelly. This is
    wrong. Write a simple bean to do what you want and if written correctly
    you can use this bean from Jelly or anywhere else like an IDE.

    Jelly makes it dead simple to use normal beans inside Jelly script and
    having the code in Java makes testing easier and more reliable IMO.

    For example I have rewritten the Plexus plugin to be a Java bean so I
    can hook this into Jelly easily if I choose, but I can also use it from
    an IDE. If you go the route of a bean (or some scripting alternative
    that truly allows inheritance like beanshell or jython) then you can use
    your code in more places than simply Jelly. Avoid writing JellyTags or
    Ant Tasks because each is bound to the particular environment. Ant can
    be a particular problem wrt ClassLoaders. Make a bean, and then adapt
    it, wrap it, decorate it or whatever else you have to do to make it work
    in a particular environment.

    Neil

    ---------------------------------------------------------------------
    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
    --
    jvz.

    Jason van Zyl
    jason@zenplex.com
    http://tambora.zenplex.org

    In short, man creates for himself a new religion of a rational
    and technical order to justify his work and to be justified in it.

    -- Jacques Ellul, The Technological Society


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
    For additional commands, e-mail: users-help@maven.apache.org
  • Rafal Krzewski at May 21, 2003 at 11:15 am

    Jason van Zyl wrote:

    I think people tend to make things more complicated than necessary
    and as soon as you starting binding the core of whatever you are
    doing to an execution environment you're hosed. I've speak from
    experience as I've been hosed more often than I would like to admit.
    Two notes here.

    Sometimes you may find yourself putting so much effort in isolating
    your code from the execution evirionment, that it actually makes it
    more complex and fragile. Constant strife for balance is a fundamental
    feature of human life...

    As long as your logic can be encapsulated into a single "bean" everyting
    looks simple. But at the very moment the logic needs to cooperate with
    other "beans" many problems arise. At this point you need to start
    making some assumptions about the execution evironment. Because of that
    I'm really happy to see that maven-new is built upon Avalon - a
    concise yet powerful framework that provides thin integration layer
    both between "beans" themselves, and between "beans" and the execution
    environment.
    Being from Canada that makes me a hoser eh? (Bad Canadian references
    are bound to occur this close to Victoria Day).
    Suppose you know, that this souds like line noise out here in the East?
    ;-)

    R.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
    For additional commands, e-mail: users-help@maven.apache.org
  • Rafal Krzewski at May 20, 2003 at 2:14 pm

    Neil Blue wrote:
    I have been reading around the maven site and looking at the plugins.
    Although maven supports the ant tasks, is is the intention that we write
    maven plugins now, where we would have written ant tasks and used taskdef
    elements before?
    In most situations it's enough to write define custom goals in maven.xml
    file. If you notice code repetition in your goals, you can factor out
    that code into custom jelly tags (possibly parametrizable ones, which
    is way cool in my opinion). Many maven plugins declare custom tags, so
    there's a plenty examples to learn from.
    Custom plugins really come into play when you want to reuse your tags
    and goals over a number of projects you are developing -- it may be
    to deply them into maven, than include jelly source files into each
    project's maven.xml.

    R.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
    For additional commands, e-mail: users-help@maven.apache.org
  • Neil Blue at May 20, 2003 at 2:26 pm
    Thanks,

    there is a lot of information here. Are there any guides on writing maven
    plugins?

    -----Original Message-----
    From: Rafal Krzewski
    Sent: 20 May 2003 15:14
    To: Maven Users List
    Subject: Re: taskdefs and plugins?


    Neil Blue wrote:
    I have been reading around the maven site and looking at the plugins.
    Although maven supports the ant tasks, is is the intention that we write
    maven plugins now, where we would have written ant tasks and used taskdef
    elements before?
    In most situations it's enough to write define custom goals in maven.xml
    file. If you notice code repetition in your goals, you can factor out
    that code into custom jelly tags (possibly parametrizable ones, which
    is way cool in my opinion). Many maven plugins declare custom tags, so
    there's a plenty examples to learn from.
    Custom plugins really come into play when you want to reuse your tags
    and goals over a number of projects you are developing -- it may be
    to deply them into maven, than include jelly source files into each
    project's maven.xml.

    R.


    ---------------------------------------------------------------------
    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
  • Dion at May 21, 2003 at 4:04 am
    Nope, write java beans and embed them using jelly.
    --
    dIon Gillard, Multitask Consulting
    Blog: http://www.freeroller.net/page/dion/Weblog
    Work: http://www.multitask.com.au


    Neil Blue <Neil.Blue@denovopharma.com> wrote on 20/05/2003 11:56:08 PM:
    I have been reading around the maven site and looking at the plugins.
    Although maven supports the ant tasks, is is the intention that we write
    maven plugins now, where we would have written ant tasks and used taskdef
    elements before?

    Neil

    ---------------------------------------------------------------------
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmaven
postedMay 20, '03 at 1:59p
activeMay 21, '03 at 11:15a
posts8
users5
websitemaven.apache.org
irc#maven

People

Translate

site design / logo © 2019 Grokbase