You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Delbecq <de...@oma.be> on 2008/03/04 10:39:02 UTC

upgrade from maven 1 to maven 2

Hello,

we have a few project here using maven 1. They become difficult to 
maintain when it come to using new plugins that are not available for 
maven 1. So we thought it might be time to switch to maven 2. Question 
is, considering about all projects are using preGoal/postGoal and 
personalized rules in maven.xml, what should i do with them? I read 
there is no equivalent of maven.xml, i need to use a plugin. Can I sort 
of embbed that plugin with the project that use it, or do i need to 
create a separate plugin project for each of our maven.xml, compile and 
deploy those plugin change everytime before compiling the main project 
(with maven 1, changes to maven.xml were immediate)? Also if someone can 
point me to documentation about converting that maven.xml to a plugin, 
it'll be great. Documentation here 
http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what to 
do with maven.xml" point to error page (the pages seems to have been 
removed from maven site :( )

example of such task of maven.xml here is, we have a project X that is a 
webapp. In a subdirectory of that webapp we need to copy all ressources 
of another project Y, and we need to merge the struts and web.xml 
configs (we use a xslt processor for that). Am not sure how easy that 
can be transfered to a plugin...

-- 
David Delbecq
Institut Royal Météorologique
Ext:557


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


Re: upgrade from maven 1 to maven 2

Posted by Dennis Lundberg <de...@apache.org>.
David Delbecq wrote:
> Hello,
> 
> we have a few project here using maven 1. They become difficult to 
> maintain when it come to using new plugins that are not available for 
> maven 1. So we thought it might be time to switch to maven 2. Question 
> is, considering about all projects are using preGoal/postGoal and 
> personalized rules in maven.xml, what should i do with them? I read 
> there is no equivalent of maven.xml, i need to use a plugin. Can I sort 
> of embbed that plugin with the project that use it, or do i need to 
> create a separate plugin project for each of our maven.xml, compile and 
> deploy those plugin change everytime before compiling the main project 
> (with maven 1, changes to maven.xml were immediate)? Also if someone can 
> point me to documentation about converting that maven.xml to a plugin, 
> it'll be great. Documentation here 
> http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what to 
> do with maven.xml" point to error page (the pages seems to have been 
> removed from maven site :( )

Sorry about that. A recent change messed up the links on that page. I'll 
look into fixing that. In the mean time, here's the correct link:

   http://maven.apache.org/maven1.html#m1-maven-xml

> example of such task of maven.xml here is, we have a project X that is a 
> webapp. In a subdirectory of that webapp we need to copy all ressources 
> of another project Y, and we need to merge the struts and web.xml 
> configs (we use a xslt processor for that). Am not sure how easy that 
> can be transfered to a plugin...
> 


-- 
Dennis Lundberg

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


Re: upgrade from maven 1 to maven 2

Posted by David Delbecq <de...@oma.be>.
En l'instant précis du 04/03/08 11:03, simon.kitching@chello.at 
s'exprimait en ces termes:
> David Delbecq schrieb:
>   
>> Hello,
>>
>> we have a few project here using maven 1. They become difficult to
>> maintain when it come to using new plugins that are not available for
>> maven 1. So we thought it might be time to switch to maven 2. Question
>> is, considering about all projects are using preGoal/postGoal and
>> personalized rules in maven.xml, what should i do with them? I read
>> there is no equivalent of maven.xml, i need to use a plugin. Can I
>> sort of embbed that plugin with the project that use it, or do i need
>> to create a separate plugin project for each of our maven.xml, compile
>> and deploy those plugin change everytime before compiling the main
>> project (with maven 1, changes to maven.xml were immediate)? Also if
>> someone can point me to documentation about converting that maven.xml
>> to a plugin, it'll be great. Documentation here
>> http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what
>> to do with maven.xml" point to error page (the pages seems to have
>> been removed from maven site :( )
>>
>> example of such task of maven.xml here is, we have a project X that is
>> a webapp. In a subdirectory of that webapp we need to copy all
>> ressources of another project Y, and we need to merge the struts and
>> web.xml configs (we use a xslt processor for that). Am not sure how
>> easy that can be transfered to a plugin...
>>
>>     
> Maven2 has a different approach, with the concept of "lifecycle phases";
> you need to read the available information on that first. See the
> "getting started" guides here:
>   http://maven.apache.org/guides/index.html
>
> Then in many cases the hacks that use preGoal/postGoal can be removed
> and replaced with a standard plugin. For example, to copy resources of
> another project Y you would:
>  * have Y install those resources as an artifact into the repository
>  * in project X, use the maven-dependency-plugin to pull those resources
> from the repository
>   
Y can not be modified :) We just pump files from it, so changing it so 
it uses maven 2 and publish the needed ressources is nogo.
> Where you have something that just cannot be done with an existing
> plugin, the easiest solution is usually to write an ant task to perform
> the necessary work, then bind the maven-ant-plugin to an appropriate
> *phase* of the build-cycle so that it runs at the appropriate time. See
> the documentation on maven-ant-plugin, <executions> sections and (again)
> the documentation about phases. Of course using ant tasks should be a
> last resort..there are a *lot* of standard plugins available.
>   
That could be a good solution i'll investigate, most our maven.xml codes 
are already using nearly exclusively ant tasks, thanks for suggestion. 
Does that ant taks also support jelly rules? We have foreach rules, that 
cycle on a 'toMerge' list of file that need to be processed by our xslt 
ant task. I understand it wouldn't be the best way, but we need a 
working way that need as little changes as possible to current rules so 
as to minimize risks of non working rules. As i see in docs, lifecycle 
is not that much different from pre/post goal, i suppose everything done 
in postGoal for war-resources could be attached somewhere at end of 
prepare-package lifecycle.

> Hope this helps..
>
> Regards,
> Simon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>   


-- 
David Delbecq
Institut Royal Météorologique
Ext:557


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


Re: upgrade from maven 1 to maven 2

Posted by "simon.kitching@chello.at" <si...@chello.at>.
David Delbecq schrieb:
> Hello,
>
> we have a few project here using maven 1. They become difficult to
> maintain when it come to using new plugins that are not available for
> maven 1. So we thought it might be time to switch to maven 2. Question
> is, considering about all projects are using preGoal/postGoal and
> personalized rules in maven.xml, what should i do with them? I read
> there is no equivalent of maven.xml, i need to use a plugin. Can I
> sort of embbed that plugin with the project that use it, or do i need
> to create a separate plugin project for each of our maven.xml, compile
> and deploy those plugin change everytime before compiling the main
> project (with maven 1, changes to maven.xml were immediate)? Also if
> someone can point me to documentation about converting that maven.xml
> to a plugin, it'll be great. Documentation here
> http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what
> to do with maven.xml" point to error page (the pages seems to have
> been removed from maven site :( )
>
> example of such task of maven.xml here is, we have a project X that is
> a webapp. In a subdirectory of that webapp we need to copy all
> ressources of another project Y, and we need to merge the struts and
> web.xml configs (we use a xslt processor for that). Am not sure how
> easy that can be transfered to a plugin...
>
Maven2 has a different approach, with the concept of "lifecycle phases";
you need to read the available information on that first. See the
"getting started" guides here:
  http://maven.apache.org/guides/index.html

Then in many cases the hacks that use preGoal/postGoal can be removed
and replaced with a standard plugin. For example, to copy resources of
another project Y you would:
 * have Y install those resources as an artifact into the repository
 * in project X, use the maven-dependency-plugin to pull those resources
from the repository

Where you have something that just cannot be done with an existing
plugin, the easiest solution is usually to write an ant task to perform
the necessary work, then bind the maven-ant-plugin to an appropriate
*phase* of the build-cycle so that it runs at the appropriate time. See
the documentation on maven-ant-plugin, <executions> sections and (again)
the documentation about phases. Of course using ant tasks should be a
last resort..there are a *lot* of standard plugins available.

Hope this helps..

Regards,
Simon


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


Re: upgrade from maven 1 to maven 2

Posted by Samuel Le Berrigaud <sa...@gmail.com>.
Hey David,

as you found out you have to define groupId, artifactId of your parent in
the pom. I don't believe it is a lot of maintenance though as on many
projects I've worked on groupdId and artifactId don't change much.

You also have to specify the version. This can seems like a lot of pain to
maintain especially when releasing. But the maven-release-plugin makes it as
easy as it gets: http://maven.apache.org/plugins/maven-release-plugin/

You don't need to define the path to the parent pom. Maven will look up in
.. by default. Or will get it from the repository if it can't find it there.

SaM

On Tue, Mar 4, 2008 at 10:04 PM, David Delbecq <de...@oma.be> wrote:

> I'll try to find out solution, i began with one of our simplest project,
> it's made of several subprojects (using multproject maven 1 goal), but
> they have no custom maven.xml (should be the easiest to convert). But i
> don't get how to get the equivalent of
>
> <extend>../project.xml</extend>
>
> I tried
> <parent><relativePath>../pom.xml</relativePath></parent>
>
> But with i try a mvn jar, it complains the groupId of the parent tag is
> not defined. That a problem because i need the groupId and the version
> to be inherited from the parent. How should i do it?
> The online doc is of no help. It says
>
> > Alternatively, if we want the groupId and / or the version of your
> > modules to be the same as their parents, you can remove the groupId
> > and / or the version identity of your module in its POM.
> >
> > <project>
> >   <parent>
> >     <groupId>com.mycompany.app</groupId>
> >     <artifactId>my-app</artifactId>
> >     <version>1</version>
> >   </parent>
> >   <modelVersion>4.0.0</modelVersion>
> >   <artifactId>my-module</artifactId>
> > </project>
> >
> As you see in xml fragment given, they did *not* remove the groupId and
> versionId? Is it possible to inherit groupId and versionId or will i
> have to manually maintain all those ids in each release?
>
> Sorry to bother you with basic question :)
>
>
> En l'instant précis du 04/03/08 11:32, Samuel Le Berrigaud s'exprimait
> en ces termes:
> > Hi again,
> >
> > I personally don't know any plugin that would take your maven.xml and
> insert
> > it into the maven 2 lifecycle. There is no notion of lifecycle in
> maven1,
> > just goals. I guess implementing such plugin could be possible but
> > definitely not trivial.
> >
> > Indeed the xslt plugin doesn't give much details about its support. You
> > would probably need to get some work done on the existing one or write
> your
> > own. I don't see that being a huge amount of work. But it would still be
> > some work…
> >
> > Regarding the project on which you depend, your best bet is still to
> have it
> > as a dependency for your project. Even if it is not maven2, you could
> > probably get this other project team to deploy it to an internal maven2
> > repository or do it your self manually when they release it. Some other
> > plugins will allow you to filter the files as you extract them. And as
> Simon
> > said you still have the maven-antrun-plugin:
> > http://maven.apache.org/plugins/maven-antrun-plugin/
> >
> > I am sorry I cannot be more helpful here,
> > maybe someone else has another experience with migrating maven.xmlscripts?
> >
> > SaM
> >
> > PS: I don't know what happened to the page you reference in your first
> mail
> > (http://maven.apache.org/guides/mini/guide-m1-m2.html). Maybe a maven
> > developer could help here?
> >
> > On Tue, Mar 4, 2008 at 9:11 PM, David Delbecq <de...@oma.be> wrote:
> >
> >
> >> Hello,
> >>
> >> i was hopping there was some way to take my pack of maven.xml preGoal
> >> rule and just relocate them somewhere where maven2 would use them. You
> >> suggestion will not work. For our XSLT transform, we need to pass
> >> parameters to the xslt transform engine (for that we use saxon
> >> transformer with some specific transformation parameters), i don't see
> >> such equivalent in what you pointed me to nor is there information
> about
> >> version of xslt supported (1,2? we need 2).
> >>
> >> For the dependency plugin we have to investigate, but if that mean we
> >> need to upgrade included project to maven 2 also, that's a no go. That
> >> project i have no write access to and we don't plan maven 2 for it, we
> >> just currently, in our build process, download it along our main
> >> project, and retrieve some files from it (files we patch on the fly
> >> using <ant:replace /> rules btw). We don't even build it, we only need
> >> it's webapp (jsp/pictures/html/config) files integrated in our app.
> >>
> >>
> >> So, if we could keep our current build process rules (maven.xml), and
> >> just somehow move them in a plugin that would be lot's easier. Some of
> >> the jelly rules took time to implement, we don't have the time to
> >> recreate all them. Isn't it possible to take the maven.xml and put it
> in
> >> a project.jelly or it's maven2 equivalent?
> >>
> >> I need some direction on how to easily convert from maven1 to maven2,
> >> related to maven.xml, but all link related to that in maven site seem
> >> dead (see my first mail)
> >>
> >>
> >> En l'instant précis du 04/03/08 10:57, Samuel Le Berrigaud s'exprimait
> >> en ces termes:
> >>
> >>> Hi David,
> >>>
> >>> You don't to implement your whole maven.xml into one maven2 plugin.
> >>>
> >> Instead
> >>
> >>> you should decompose what you do in your maven.xml and find out the
> >>>
> >> existing
> >>
> >>> maven 2 plugins that would enable those different tasks.
> >>>
> >>> For example, if I take your two examples below:
> >>> - copying resources of another project:
> >>> I would make that project a dependency of your web application and
> that
> >>> would be sufficient to add those on your classpath.
> >>> If you need them outside the classpath, I would probably use the maven
> >>> dependency plugin:
> >>>
> >> http://maven.apache.org/plugins/maven-dependency-plugin/
> >>
> >>> using the unpack goal, it will unpack the jar wherever you need to. I
> >>>
> >> would
> >>
> >>> attach that to the "process-resources" phase of you war module.
> >>>
> >>> - xslt transformation
> >>> that should be fairly easy using the XSLT plugin:
> >>> http://mojo.codehaus.org/xslt-maven-plugin/
> >>> attaching it to the same "process-resources" phase.
> >>>
> >>> Hope this all make sense. I strongly advise researching existing
> plugins
> >>> before writing your own. All the configuration will go in your
> pom.xmlso as
> >>> with the maven.xml you can update those rules easily.
> >>>
> >>> SaM
> >>>
> >>> On Tue, Mar 4, 2008 at 8:39 PM, David Delbecq <de...@oma.be> wrote:
> >>>
> >>>
> >>>
> >>>> Hello,
> >>>>
> >>>> we have a few project here using maven 1. They become difficult to
> >>>> maintain when it come to using new plugins that are not available for
> >>>> maven 1. So we thought it might be time to switch to maven 2.
> Question
> >>>> is, considering about all projects are using preGoal/postGoal and
> >>>> personalized rules in maven.xml, what should i do with them? I read
> >>>> there is no equivalent of maven.xml, i need to use a plugin. Can I
> sort
> >>>> of embbed that plugin with the project that use it, or do i need to
> >>>> create a separate plugin project for each of our maven.xml, compile
> and
> >>>> deploy those plugin change everytime before compiling the main
> project
> >>>> (with maven 1, changes to maven.xml were immediate)? Also if someone
> >>>>
> >> can
> >>
> >>>> point me to documentation about converting that maven.xml to a
> plugin,
> >>>> it'll be great. Documentation here
> >>>> http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what
> to
> >>>> do with maven.xml" point to error page (the pages seems to have been
> >>>> removed from maven site :( )
> >>>>
> >>>> example of such task of maven.xml here is, we have a project X that
> is
> >>>>
> >> a
> >>
> >>>> webapp. In a subdirectory of that webapp we need to copy all
> ressources
> >>>> of another project Y, and we need to merge the struts and web.xml
> >>>> configs (we use a xslt processor for that). Am not sure how easy that
> >>>> can be transfered to a plugin...
> >>>>
> >>>> --
> >>>> David Delbecq
> >>>> Institut Royal Météorologique
> >>>> Ext:557
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >> --
> >> David Delbecq
> >> Institut Royal Météorologique
> >> Ext:557
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> David Delbecq
> Institut Royal Météorologique
> Ext:557
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Samuel Le Berrigaud

Re: upgrade from maven 1 to maven 2

Posted by David Delbecq <de...@oma.be>.
I'll try to find out solution, i began with one of our simplest project, 
it's made of several subprojects (using multproject maven 1 goal), but 
they have no custom maven.xml (should be the easiest to convert). But i 
don't get how to get the equivalent of

<extend>../project.xml</extend>

I tried
<parent><relativePath>../pom.xml</relativePath></parent>

But with i try a mvn jar, it complains the groupId of the parent tag is 
not defined. That a problem because i need the groupId and the version 
to be inherited from the parent. How should i do it?
The online doc is of no help. It says

> Alternatively, if we want the groupId and / or the version of your 
> modules to be the same as their parents, you can remove the groupId 
> and / or the version identity of your module in its POM.
>
> <project>
>   <parent>
>     <groupId>com.mycompany.app</groupId>
>     <artifactId>my-app</artifactId>
>     <version>1</version>
>   </parent>
>   <modelVersion>4.0.0</modelVersion>
>   <artifactId>my-module</artifactId>
> </project>
>   
As you see in xml fragment given, they did *not* remove the groupId and 
versionId? Is it possible to inherit groupId and versionId or will i 
have to manually maintain all those ids in each release?

Sorry to bother you with basic question :)


En l'instant précis du 04/03/08 11:32, Samuel Le Berrigaud s'exprimait 
en ces termes:
> Hi again,
>
> I personally don't know any plugin that would take your maven.xml and insert
> it into the maven 2 lifecycle. There is no notion of lifecycle in maven1,
> just goals. I guess implementing such plugin could be possible but
> definitely not trivial.
>
> Indeed the xslt plugin doesn't give much details about its support. You
> would probably need to get some work done on the existing one or write your
> own. I don't see that being a huge amount of work. But it would still be
> some work…
>
> Regarding the project on which you depend, your best bet is still to have it
> as a dependency for your project. Even if it is not maven2, you could
> probably get this other project team to deploy it to an internal maven2
> repository or do it your self manually when they release it. Some other
> plugins will allow you to filter the files as you extract them. And as Simon
> said you still have the maven-antrun-plugin:
> http://maven.apache.org/plugins/maven-antrun-plugin/
>
> I am sorry I cannot be more helpful here,
> maybe someone else has another experience with migrating maven.xml scripts?
>
> SaM
>
> PS: I don't know what happened to the page you reference in your first mail
> (http://maven.apache.org/guides/mini/guide-m1-m2.html). Maybe a maven
> developer could help here?
>
> On Tue, Mar 4, 2008 at 9:11 PM, David Delbecq <de...@oma.be> wrote:
>
>   
>> Hello,
>>
>> i was hopping there was some way to take my pack of maven.xml preGoal
>> rule and just relocate them somewhere where maven2 would use them. You
>> suggestion will not work. For our XSLT transform, we need to pass
>> parameters to the xslt transform engine (for that we use saxon
>> transformer with some specific transformation parameters), i don't see
>> such equivalent in what you pointed me to nor is there information about
>> version of xslt supported (1,2? we need 2).
>>
>> For the dependency plugin we have to investigate, but if that mean we
>> need to upgrade included project to maven 2 also, that's a no go. That
>> project i have no write access to and we don't plan maven 2 for it, we
>> just currently, in our build process, download it along our main
>> project, and retrieve some files from it (files we patch on the fly
>> using <ant:replace /> rules btw). We don't even build it, we only need
>> it's webapp (jsp/pictures/html/config) files integrated in our app.
>>
>>
>> So, if we could keep our current build process rules (maven.xml), and
>> just somehow move them in a plugin that would be lot's easier. Some of
>> the jelly rules took time to implement, we don't have the time to
>> recreate all them. Isn't it possible to take the maven.xml and put it in
>> a project.jelly or it's maven2 equivalent?
>>
>> I need some direction on how to easily convert from maven1 to maven2,
>> related to maven.xml, but all link related to that in maven site seem
>> dead (see my first mail)
>>
>>
>> En l'instant précis du 04/03/08 10:57, Samuel Le Berrigaud s'exprimait
>> en ces termes:
>>     
>>> Hi David,
>>>
>>> You don't to implement your whole maven.xml into one maven2 plugin.
>>>       
>> Instead
>>     
>>> you should decompose what you do in your maven.xml and find out the
>>>       
>> existing
>>     
>>> maven 2 plugins that would enable those different tasks.
>>>
>>> For example, if I take your two examples below:
>>> - copying resources of another project:
>>> I would make that project a dependency of your web application and that
>>> would be sufficient to add those on your classpath.
>>> If you need them outside the classpath, I would probably use the maven
>>> dependency plugin:
>>>       
>> http://maven.apache.org/plugins/maven-dependency-plugin/
>>     
>>> using the unpack goal, it will unpack the jar wherever you need to. I
>>>       
>> would
>>     
>>> attach that to the "process-resources" phase of you war module.
>>>
>>> - xslt transformation
>>> that should be fairly easy using the XSLT plugin:
>>> http://mojo.codehaus.org/xslt-maven-plugin/
>>> attaching it to the same "process-resources" phase.
>>>
>>> Hope this all make sense. I strongly advise researching existing plugins
>>> before writing your own. All the configuration will go in your pom.xmlso as
>>> with the maven.xml you can update those rules easily.
>>>
>>> SaM
>>>
>>> On Tue, Mar 4, 2008 at 8:39 PM, David Delbecq <de...@oma.be> wrote:
>>>
>>>
>>>       
>>>> Hello,
>>>>
>>>> we have a few project here using maven 1. They become difficult to
>>>> maintain when it come to using new plugins that are not available for
>>>> maven 1. So we thought it might be time to switch to maven 2. Question
>>>> is, considering about all projects are using preGoal/postGoal and
>>>> personalized rules in maven.xml, what should i do with them? I read
>>>> there is no equivalent of maven.xml, i need to use a plugin. Can I sort
>>>> of embbed that plugin with the project that use it, or do i need to
>>>> create a separate plugin project for each of our maven.xml, compile and
>>>> deploy those plugin change everytime before compiling the main project
>>>> (with maven 1, changes to maven.xml were immediate)? Also if someone
>>>>         
>> can
>>     
>>>> point me to documentation about converting that maven.xml to a plugin,
>>>> it'll be great. Documentation here
>>>> http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what to
>>>> do with maven.xml" point to error page (the pages seems to have been
>>>> removed from maven site :( )
>>>>
>>>> example of such task of maven.xml here is, we have a project X that is
>>>>         
>> a
>>     
>>>> webapp. In a subdirectory of that webapp we need to copy all ressources
>>>> of another project Y, and we need to merge the struts and web.xml
>>>> configs (we use a xslt processor for that). Am not sure how easy that
>>>> can be transfered to a plugin...
>>>>
>>>> --
>>>> David Delbecq
>>>> Institut Royal Météorologique
>>>> Ext:557
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>>         
>>>
>>>       
>> --
>> David Delbecq
>> Institut Royal Météorologique
>> Ext:557
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
>
>   


-- 
David Delbecq
Institut Royal Météorologique
Ext:557


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


Re: upgrade from maven 1 to maven 2

Posted by Samuel Le Berrigaud <sa...@gmail.com>.
Hi again,

I personally don't know any plugin that would take your maven.xml and insert
it into the maven 2 lifecycle. There is no notion of lifecycle in maven1,
just goals. I guess implementing such plugin could be possible but
definitely not trivial.

Indeed the xslt plugin doesn't give much details about its support. You
would probably need to get some work done on the existing one or write your
own. I don't see that being a huge amount of work. But it would still be
some work…

Regarding the project on which you depend, your best bet is still to have it
as a dependency for your project. Even if it is not maven2, you could
probably get this other project team to deploy it to an internal maven2
repository or do it your self manually when they release it. Some other
plugins will allow you to filter the files as you extract them. And as Simon
said you still have the maven-antrun-plugin:
http://maven.apache.org/plugins/maven-antrun-plugin/

I am sorry I cannot be more helpful here,
maybe someone else has another experience with migrating maven.xml scripts?

SaM

PS: I don't know what happened to the page you reference in your first mail
(http://maven.apache.org/guides/mini/guide-m1-m2.html). Maybe a maven
developer could help here?

On Tue, Mar 4, 2008 at 9:11 PM, David Delbecq <de...@oma.be> wrote:

> Hello,
>
> i was hopping there was some way to take my pack of maven.xml preGoal
> rule and just relocate them somewhere where maven2 would use them. You
> suggestion will not work. For our XSLT transform, we need to pass
> parameters to the xslt transform engine (for that we use saxon
> transformer with some specific transformation parameters), i don't see
> such equivalent in what you pointed me to nor is there information about
> version of xslt supported (1,2? we need 2).
>
> For the dependency plugin we have to investigate, but if that mean we
> need to upgrade included project to maven 2 also, that's a no go. That
> project i have no write access to and we don't plan maven 2 for it, we
> just currently, in our build process, download it along our main
> project, and retrieve some files from it (files we patch on the fly
> using <ant:replace /> rules btw). We don't even build it, we only need
> it's webapp (jsp/pictures/html/config) files integrated in our app.
>
>
> So, if we could keep our current build process rules (maven.xml), and
> just somehow move them in a plugin that would be lot's easier. Some of
> the jelly rules took time to implement, we don't have the time to
> recreate all them. Isn't it possible to take the maven.xml and put it in
> a project.jelly or it's maven2 equivalent?
>
> I need some direction on how to easily convert from maven1 to maven2,
> related to maven.xml, but all link related to that in maven site seem
> dead (see my first mail)
>
>
> En l'instant précis du 04/03/08 10:57, Samuel Le Berrigaud s'exprimait
> en ces termes:
> > Hi David,
> >
> > You don't to implement your whole maven.xml into one maven2 plugin.
> Instead
> > you should decompose what you do in your maven.xml and find out the
> existing
> > maven 2 plugins that would enable those different tasks.
> >
> > For example, if I take your two examples below:
> > - copying resources of another project:
> > I would make that project a dependency of your web application and that
> > would be sufficient to add those on your classpath.
> > If you need them outside the classpath, I would probably use the maven
> > dependency plugin:
> http://maven.apache.org/plugins/maven-dependency-plugin/
> > using the unpack goal, it will unpack the jar wherever you need to. I
> would
> > attach that to the "process-resources" phase of you war module.
> >
> > - xslt transformation
> > that should be fairly easy using the XSLT plugin:
> > http://mojo.codehaus.org/xslt-maven-plugin/
> > attaching it to the same "process-resources" phase.
> >
> > Hope this all make sense. I strongly advise researching existing plugins
> > before writing your own. All the configuration will go in your pom.xmlso as
> > with the maven.xml you can update those rules easily.
> >
> > SaM
> >
> > On Tue, Mar 4, 2008 at 8:39 PM, David Delbecq <de...@oma.be> wrote:
> >
> >
> >> Hello,
> >>
> >> we have a few project here using maven 1. They become difficult to
> >> maintain when it come to using new plugins that are not available for
> >> maven 1. So we thought it might be time to switch to maven 2. Question
> >> is, considering about all projects are using preGoal/postGoal and
> >> personalized rules in maven.xml, what should i do with them? I read
> >> there is no equivalent of maven.xml, i need to use a plugin. Can I sort
> >> of embbed that plugin with the project that use it, or do i need to
> >> create a separate plugin project for each of our maven.xml, compile and
> >> deploy those plugin change everytime before compiling the main project
> >> (with maven 1, changes to maven.xml were immediate)? Also if someone
> can
> >> point me to documentation about converting that maven.xml to a plugin,
> >> it'll be great. Documentation here
> >> http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what to
> >> do with maven.xml" point to error page (the pages seems to have been
> >> removed from maven site :( )
> >>
> >> example of such task of maven.xml here is, we have a project X that is
> a
> >> webapp. In a subdirectory of that webapp we need to copy all ressources
> >> of another project Y, and we need to merge the struts and web.xml
> >> configs (we use a xslt processor for that). Am not sure how easy that
> >> can be transfered to a plugin...
> >>
> >> --
> >> David Delbecq
> >> Institut Royal Météorologique
> >> Ext:557
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> David Delbecq
> Institut Royal Météorologique
> Ext:557
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Samuel Le Berrigaud

Re: upgrade from maven 1 to maven 2

Posted by David Delbecq <de...@oma.be>.
Hello,

i was hopping there was some way to take my pack of maven.xml preGoal 
rule and just relocate them somewhere where maven2 would use them. You 
suggestion will not work. For our XSLT transform, we need to pass 
parameters to the xslt transform engine (for that we use saxon 
transformer with some specific transformation parameters), i don't see 
such equivalent in what you pointed me to nor is there information about 
version of xslt supported (1,2? we need 2).

For the dependency plugin we have to investigate, but if that mean we 
need to upgrade included project to maven 2 also, that's a no go. That 
project i have no write access to and we don't plan maven 2 for it, we 
just currently, in our build process, download it along our main 
project, and retrieve some files from it (files we patch on the fly 
using <ant:replace /> rules btw). We don't even build it, we only need 
it's webapp (jsp/pictures/html/config) files integrated in our app.


So, if we could keep our current build process rules (maven.xml), and 
just somehow move them in a plugin that would be lot's easier. Some of 
the jelly rules took time to implement, we don't have the time to 
recreate all them. Isn't it possible to take the maven.xml and put it in 
a project.jelly or it's maven2 equivalent?

I need some direction on how to easily convert from maven1 to maven2, 
related to maven.xml, but all link related to that in maven site seem 
dead (see my first mail)


En l'instant précis du 04/03/08 10:57, Samuel Le Berrigaud s'exprimait 
en ces termes:
> Hi David,
>
> You don't to implement your whole maven.xml into one maven2 plugin. Instead
> you should decompose what you do in your maven.xml and find out the existing
> maven 2 plugins that would enable those different tasks.
>
> For example, if I take your two examples below:
> - copying resources of another project:
> I would make that project a dependency of your web application and that
> would be sufficient to add those on your classpath.
> If you need them outside the classpath, I would probably use the maven
> dependency plugin: http://maven.apache.org/plugins/maven-dependency-plugin/
> using the unpack goal, it will unpack the jar wherever you need to. I would
> attach that to the "process-resources" phase of you war module.
>
> - xslt transformation
> that should be fairly easy using the XSLT plugin:
> http://mojo.codehaus.org/xslt-maven-plugin/
> attaching it to the same "process-resources" phase.
>
> Hope this all make sense. I strongly advise researching existing plugins
> before writing your own. All the configuration will go in your pom.xml so as
> with the maven.xml you can update those rules easily.
>
> SaM
>
> On Tue, Mar 4, 2008 at 8:39 PM, David Delbecq <de...@oma.be> wrote:
>
>   
>> Hello,
>>
>> we have a few project here using maven 1. They become difficult to
>> maintain when it come to using new plugins that are not available for
>> maven 1. So we thought it might be time to switch to maven 2. Question
>> is, considering about all projects are using preGoal/postGoal and
>> personalized rules in maven.xml, what should i do with them? I read
>> there is no equivalent of maven.xml, i need to use a plugin. Can I sort
>> of embbed that plugin with the project that use it, or do i need to
>> create a separate plugin project for each of our maven.xml, compile and
>> deploy those plugin change everytime before compiling the main project
>> (with maven 1, changes to maven.xml were immediate)? Also if someone can
>> point me to documentation about converting that maven.xml to a plugin,
>> it'll be great. Documentation here
>> http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what to
>> do with maven.xml" point to error page (the pages seems to have been
>> removed from maven site :( )
>>
>> example of such task of maven.xml here is, we have a project X that is a
>> webapp. In a subdirectory of that webapp we need to copy all ressources
>> of another project Y, and we need to merge the struts and web.xml
>> configs (we use a xslt processor for that). Am not sure how easy that
>> can be transfered to a plugin...
>>
>> --
>> David Delbecq
>> Institut Royal Météorologique
>> Ext:557
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
>
>   


-- 
David Delbecq
Institut Royal Météorologique
Ext:557


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


Re: upgrade from maven 1 to maven 2

Posted by Samuel Le Berrigaud <sa...@gmail.com>.
Hi David,

You don't to implement your whole maven.xml into one maven2 plugin. Instead
you should decompose what you do in your maven.xml and find out the existing
maven 2 plugins that would enable those different tasks.

For example, if I take your two examples below:
- copying resources of another project:
I would make that project a dependency of your web application and that
would be sufficient to add those on your classpath.
If you need them outside the classpath, I would probably use the maven
dependency plugin: http://maven.apache.org/plugins/maven-dependency-plugin/
using the unpack goal, it will unpack the jar wherever you need to. I would
attach that to the "process-resources" phase of you war module.

- xslt transformation
that should be fairly easy using the XSLT plugin:
http://mojo.codehaus.org/xslt-maven-plugin/
attaching it to the same "process-resources" phase.

Hope this all make sense. I strongly advise researching existing plugins
before writing your own. All the configuration will go in your pom.xml so as
with the maven.xml you can update those rules easily.

SaM

On Tue, Mar 4, 2008 at 8:39 PM, David Delbecq <de...@oma.be> wrote:

> Hello,
>
> we have a few project here using maven 1. They become difficult to
> maintain when it come to using new plugins that are not available for
> maven 1. So we thought it might be time to switch to maven 2. Question
> is, considering about all projects are using preGoal/postGoal and
> personalized rules in maven.xml, what should i do with them? I read
> there is no equivalent of maven.xml, i need to use a plugin. Can I sort
> of embbed that plugin with the project that use it, or do i need to
> create a separate plugin project for each of our maven.xml, compile and
> deploy those plugin change everytime before compiling the main project
> (with maven 1, changes to maven.xml were immediate)? Also if someone can
> point me to documentation about converting that maven.xml to a plugin,
> it'll be great. Documentation here
> http://maven.apache.org/guides/mini/guide-m1-m2.html , section "what to
> do with maven.xml" point to error page (the pages seems to have been
> removed from maven site :( )
>
> example of such task of maven.xml here is, we have a project X that is a
> webapp. In a subdirectory of that webapp we need to copy all ressources
> of another project Y, and we need to merge the struts and web.xml
> configs (we use a xslt processor for that). Am not sure how easy that
> can be transfered to a plugin...
>
> --
> David Delbecq
> Institut Royal Météorologique
> Ext:557
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Samuel Le Berrigaud