You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martijn Morriën <dj...@gmail.com> on 2008/10/16 16:56:39 UTC

How to create my own packaging type and my own build life cycle?

Dear Maven users, I have 2 questions:

1) Can I query the archived mailinglists? I can browse the archives
(http://mail-archives.apache.org/mod_mbox/maven-users/), but cannot
seem to find a way to search through them.

2) I would like to create my own packaging type, with my own life
cycle. How can I achieve this? Is this documented somewhere?
I found some documentation in "Specifying a New Packaging" on
http://www.propellors.net/maven/site/guides/introduction/introduction-to-the-lifecycle.html,
but this is incomplete and it is no longer available on
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html.

Thank you,

Martijn

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


Re: How to create my own packaging type and my own build life cycle?

Posted by Martijn Morriën <dj...@gmail.com>.
Thanks, it worked!

Could someone confirm this implementation is future proof?

Martijn

On Thu, Oct 16, 2008 at 5:06 PM, sean chen(陈思淼) <ch...@gmail.com> wrote:
>    I've ask the same question befere, here is the answer from Simone, and
> that give me lots of help, I hope it can help you too:
>
>
>> Hi 陈思淼,
>>
> I'm not a Maven developer but I did a custom packaging. You have to
>>
> follow these steps :
>>
> - Create a plugin (mojo) project
>>
> - In this plugin project, define your plugins, with their goals. For
>>
> example, one of them could be jcar-compile
>>
> - In the src/main/resources of your plugin, create the folder
>>
> META-INF/plexus/
>>
> - In this folder, create a file components.xml
>>
> - In this file, you can add directives to the Plexus container. The
>>
> syntax is nearly the same used in Avalon, if you ever used Avalon or
>>
> Cocoon 2.1 you should be familiar with it.
>>
> - In our case, you can declare which phases are required for your custom
>>
> packaging type, and the binding between phases and plugins (either the
>>
> default one and your custom).
>>
> - You can find the components.xml for my custom packaging here
>>
> http://svn.apache.org/repos/asf/labs/magma/trunk/maven-
>> magma-plugin/src/main/resources/META-INF/plexus/components.xml
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> ... In my case my packaging name is
> "magma"<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> ... As you can see, i customized compilem, test-compile and test
> phases<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> - In projects packaged with you custom packages you have to
> :<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> ... Set <packaging> to your packaging
> name<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> ... Include you plugin in the plugins section of the pom,
> specifying<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> <extensions>true</extensions><http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> ... You can find an example of a package using my custom packaging
> here<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>
>
> ...... Maybe this last step could be avoidable somehow? maybe using
> some<http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>
>
> naming convention?<http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>
>>
>> <http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>
>
>
>> At this point, install your plugin, and try to install an artifact using
>>
> your custom packaging.
>>
>
>> I'm pretty sure I forgot something important, but this should at least
>>
> give you a starting point.
>>
>
>> Unfortunately I cannot remember where I found this informations, but
>>
> there is a guide somewhere on the Maven site.
>>
>
>> Hope this helps,
>>
> Simone
>>
>
> 2008/10/16 Martijn Morriën <dj...@gmail.com>
>
>> Dear Maven users, I have 2 questions:
>>
>> 1) Can I query the archived mailinglists? I can browse the archives
>> (http://mail-archives.apache.org/mod_mbox/maven-users/), but cannot
>> seem to find a way to search through them.
>>
>> 2) I would like to create my own packaging type, with my own life
>> cycle. How can I achieve this? Is this documented somewhere?
>> I found some documentation in "Specifying a New Packaging" on
>>
>> http://www.propellors.net/maven/site/guides/introduction/introduction-to-the-lifecycle.html
>> ,
>> but this is incomplete and it is no longer available on
>>
>> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
>> .
>>
>> Thank you,
>>
>> Martijn
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: How to create my own packaging type and my own build life cycle?

Posted by "sean chen(陈思淼)" <ch...@gmail.com>.
    I've ask the same question befere, here is the answer from Simone, and
that give me lots of help, I hope it can help you too:


> Hi 陈思淼,
>
I'm not a Maven developer but I did a custom packaging. You have to
>
follow these steps :
>
- Create a plugin (mojo) project
>
- In this plugin project, define your plugins, with their goals. For
>
example, one of them could be jcar-compile
>
- In the src/main/resources of your plugin, create the folder
>
META-INF/plexus/
>
- In this folder, create a file components.xml
>
- In this file, you can add directives to the Plexus container. The
>
syntax is nearly the same used in Avalon, if you ever used Avalon or
>
Cocoon 2.1 you should be familiar with it.
>
- In our case, you can declare which phases are required for your custom
>
packaging type, and the binding between phases and plugins (either the
>
default one and your custom).
>
- You can find the components.xml for my custom packaging here
>
http://svn.apache.org/repos/asf/labs/magma/trunk/maven-
> magma-plugin/src/main/resources/META-INF/plexus/components.xml
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>

... In my case my packaging name is
"magma"<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>

... As you can see, i customized compilem, test-compile and test
phases<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>

- In projects packaged with you custom packages you have to
:<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>

... Set <packaging> to your packaging
name<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>

... Include you plugin in the plugins section of the pom,
specifying<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>

<extensions>true</extensions><http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>

... You can find an example of a package using my custom packaging
here<http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/maven-magma-plugin/src/main/resources/META-INF/plexus/components.xml>

http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>

...... Maybe this last step could be avoidable somehow? maybe using
some<http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>

naming convention?<http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>
>
> <http://svn.apache.org/repos/asf/labs/magma/trunk/foundation-basics/pom.xml>


> At this point, install your plugin, and try to install an artifact using
>
your custom packaging.
>

> I'm pretty sure I forgot something important, but this should at least
>
give you a starting point.
>

> Unfortunately I cannot remember where I found this informations, but
>
there is a guide somewhere on the Maven site.
>

> Hope this helps,
>
Simone
>

2008/10/16 Martijn Morriën <dj...@gmail.com>

> Dear Maven users, I have 2 questions:
>
> 1) Can I query the archived mailinglists? I can browse the archives
> (http://mail-archives.apache.org/mod_mbox/maven-users/), but cannot
> seem to find a way to search through them.
>
> 2) I would like to create my own packaging type, with my own life
> cycle. How can I achieve this? Is this documented somewhere?
> I found some documentation in "Specifying a New Packaging" on
>
> http://www.propellors.net/maven/site/guides/introduction/introduction-to-the-lifecycle.html
> ,
> but this is incomplete and it is no longer available on
>
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
> .
>
> Thank you,
>
> Martijn
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to create my own packaging type and my own build life cycle?

Posted by Wendy Smoak <ws...@gmail.com>.
On Thu, Oct 16, 2008 at 7:56 AM, Martijn Morriën <dj...@gmail.com> wrote:
> Dear Maven users, I have 2 questions:
>
> 1) Can I query the archived mailinglists? I can browse the archives
> (http://mail-archives.apache.org/mod_mbox/maven-users/), but cannot
> seem to find a way to search through them.

http://maven.apache.org/mail-lists.html -> rightmost column has links
to archives.  My favorites are:

http://maven.markmail.org/
http://www.nabble.com/Maven---Users-f178.html

-- 
Wendy

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