You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Konstantin Priblouda <kp...@yahoo.com> on 2003/04/01 09:32:51 UTC

Re: Newbie questions - from ant to maven

--- Jose Gonzalez Gomez <jg...@opentechnet.com>
wrote:
> 
>     Is this the recommended approach for j2ee
> applications? I mean, I 
> was thinking about switching to maven because of all
> the added 
> functionalities over ant (source code metrics, cross
> reference source, 
> documentation and site generation using xdocs,...)
> but if I have to 
> create a maven project for each artifact in my
> application, I think that 
> this could become cumbersome for large j2ee
> applications, so maybe I 
> would delay adopting maven as my main build tool.

It depends what tiers your application has. 
If it's only web tier, without EJB ( and produces
single .war file ) then one maven project will be
sufficient. 
With java code for your servlet/MVC framework, test
cases and web sources.

Though I would separate EJB tier into separate
project,
and build them together using reactor. 

I'm working on project which is a big portal with
really different parts.

So I move all stuff which can be used elsewhere
( like portlet management, persistence/business logic 
for applications which could be used from separate web
context ) into separatreprojects, which produce
deployment units ( like ejb-jar ) and client
libraries.


This wa I can distribute work on the project parts 
between my code velopers ( and sometimes our partner
companies )

Then all tested versions of subsystem are integrated
into portal project itself.

Currently I got following projects: 
- validation framework
- portlet management
- persistence layer and business logic for application
- integration project

In future I plan to add some other projects and
setup common reactor for integration builds.
( and come OS projects I'm using will be also
integrated there. And if they do not have maven build
system yet, I write it myself and try to lobby them to
adopt it :) )

> any convention in order to be used by maven? What is
> the relation 
> between maven.xml, build.xml, project.xml,
> project.properties?

maven xml defines your build goals ( and is mostly not
necessary - not for standart cases )
build.xml is POABS ( plain old ant build script ),
possibly generated by maven.
project.xml defines projects tructure and dependencies
project.properties allows fine tuning of goals defined
by maven and your goals 

There is also build.properties which will override 
propject.properties and is used for user local
settings ( do not check it in into CVS )

regards,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://platinum.yahoo.com

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


Re: Newbie questions - from ant to maven

Posted by Konstantin Priblouda <kp...@yahoo.com>.
--- Jose Gonzalez Gomez <jg...@opentechnet.com>
wrote:
> 
>    So do you have this projects in different
> locations, or could you 
> just create several project.properties (or whatever)
> to specify the 
> information for this projects and keep all the
> source under a common 
> location and/or repository?

There could be different approaches. But yes, you can 
override source positions with project.properties
and sources you specify in project.xml do not have to
be under the same directory. 

For example I created maven build environment for
hibernate (
http://www.pribluda.de/hibernate-maven.tar.gz )
which uses the same source structure as for ant build
( tests do not work, but they do not work with ant
either :) )


>    Currently I'm developing a J2EE application that
> has a war and two 
> ejb jars, that's why I'm so interested in this
> issue. Could you please 
> outline you file hierarchy?

Well, I would suggest to keep code for different
ejb-jars in seperate trees, use xdoclet and produce
ejb-jar as well jar of client classes. 
(and install them into local repository )

Then web tier could state dependency on those client
jars ( and will get them fresh and smelly if you use
reactor )


Then integration project could jar ewerything together
to produce deployable .ear


>    I understand that you could override some of the
> standard goals and 
> finally call your custom build script if those
> standard goals doesn't 
> match your interests, couldn't you? Or create new
> goals... By the way, 
> what are the standard cases? I've seen goals in
> maven for j2ee:ejb, 
> j2ee:war, etc, but they seem to be oriented for a
> J2EE application with 
> a single war and a single jar file, am I wrong? I
> have the feeling that 
> maven is rather inmatture in this sense, I mean,
> working with a fairly 
> complex J2EE application requires some hacking or
> workaround to get 
> maven working (or using reactor, as you point out in
> your last mail). 
> Maybe I just don't know how to use it...

Well, maven is still in beta but really usefull. 
Just look into plugin.jelly to see what happens behind
the scenes. As with most opensource projects
documentation is lightyears behind...
( or lacking completely )

>    Thank you very much for your kind help. By the
> way, where are you 
> from? I'm from Spain, and I'm right now trying to
> stablish as a 
> freelance developer, what about your experience?

I'm from germany, and used to be freelance deleoper
last years. Now it's really diffucult - banks do not 
spend money, contract rates are low and all the remain
of internet hype are pulling rates down even further. 

Now I'm permanently employed project manager with 3
( soon 4? ) developers and solide project which has
nothing to do with banks - it's sewer systems :)
( even if all the banks go down the drain, 
they will still pass sewage pipes :) )

In my current position I feel comfortable - 
I can get really good developers easily :)

regards,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

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


Re: Newbie questions - from ant to maven

Posted by di...@multitask.com.au.
Jose Gonzalez Gomez <jg...@opentechnet.com> wrote on 02/04/2003 
09:23:23 PM:

> 
>    So do you have this projects in different locations, or could you 
> just create several project.properties (or whatever) to specify the 
> information for this projects and keep all the source under a common 
> location and/or repository?

Usually several projects with a common parent directory where I work.

>    Currently I'm developing a J2EE application that has a war and two 
> ejb jars, that's why I'm so interested in this issue. Could you please 
> outline you file hierarchy?

basedir
  /war-project
  /ejb-jar1-project
  /ejb-jar2-project
  /ear-project

>    I understand that you could override some of the standard goals and 
> finally call your custom build script if those standard goals doesn't 
> match your interests, couldn't you? Or create new goals... By the way, 
> what are the standard cases? I've seen goals in maven for j2ee:ejb, 
> j2ee:war, etc, but they seem to be oriented for a J2EE application with 
> a single war and a single jar file, am I wrong? I have the feeling that 

You're wrong. ears can depend on wars and jars and bundle them into the 
resulting ear file.

Wars can depend on jars and bundle them into the resulting war file

> maven is rather inmatture in this sense, I mean, working with a fairly 
> complex J2EE application requires some hacking or workaround to get 
> maven working (or using reactor, as you point out in your last mail). 
> Maybe I just don't know how to use it...

Or there are bugs in Maven.

It should be able to handle complex j2ee apps.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au




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


Re: Newbie questions - from ant to maven

Posted by Jose Gonzalez Gomez <jg...@opentechnet.com>.
   So do you have this projects in different locations, or could you 
just create several project.properties (or whatever) to specify the 
information for this projects and keep all the source under a common 
location and/or repository?

   Currently I'm developing a J2EE application that has a war and two 
ejb jars, that's why I'm so interested in this issue. Could you please 
outline you file hierarchy?

   I understand that you could override some of the standard goals and 
finally call your custom build script if those standard goals doesn't 
match your interests, couldn't you? Or create new goals... By the way, 
what are the standard cases? I've seen goals in maven for j2ee:ejb, 
j2ee:war, etc, but they seem to be oriented for a J2EE application with 
a single war and a single jar file, am I wrong? I have the feeling that 
maven is rather inmatture in this sense, I mean, working with a fairly 
complex J2EE application requires some hacking or workaround to get 
maven working (or using reactor, as you point out in your last mail). 
Maybe I just don't know how to use it...

   Thank you very much for your kind help. By the way, where are you 
from? I'm from Spain, and I'm right now trying to stablish as a 
freelance developer, what about your experience?

   Regards
   Jose

Konstantin Priblouda wrote:

>--- Jose Gonzalez Gomez <jg...@opentechnet.com>
>wrote:
>  
>
>>    I still don't see the diference or relation
>>between maven.xml and 
>>build.xml. From what I read and your answers I
>>understand that maven is 
>>thought for the development of a "monolithic"
>>application or library, 
>>the one that tipically is bundled in one jar, am I
>>right?
>>    
>>
>
>Yep. Maven is really powerfull for such task. 
>Of course you can produce several artifacts from
>single project, but easier way would be to structure
>your code
>and use reactor to pull the things together. 
>
>Maven is really nice when it comes to active
>development of several dependent  projects at the
>same time. Right now, we have 4 projects and 4
>developers, without clear separation. 
>
>Dependency management ( and artifact distribution )
>would be plain unmanageable without maven... )
>
>
>  
>
>>    So if you need a custom build, you still may use
>>ant... but can you 
>>call this build from maven, or must you call ant
>>directly?
>>    
>>
>
>You can call any ant task from maven.xml - 
>because maven uses ant behind the scenes ( but not
>only ant )
>
>Think of goals defined in plugins as pre-cooked 
>ant tasks. 
>
>regards,
>
>=====
>Konstantin Priblouda ( ko5tik )    Freelance Software developer
>< http://www.pribluda.de > < play java games -> http://www.yook.de >
>< render charts online -> http://www.pribluda.de/povray/ >
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Tax Center - File online, calculators, forms, and more
>http://tax.yahoo.com
>
>---------------------------------------------------------------------
>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


Re: Newbie questions - from ant to maven

Posted by Konstantin Priblouda <kp...@yahoo.com>.
--- Jose Gonzalez Gomez <jg...@opentechnet.com>
wrote:
> 
>     I still don't see the diference or relation
> between maven.xml and 
> build.xml. From what I read and your answers I
> understand that maven is 
> thought for the development of a "monolithic"
> application or library, 
> the one that tipically is bundled in one jar, am I
> right?

Yep. Maven is really powerfull for such task. 
Of course you can produce several artifacts from
single project, but easier way would be to structure
your code
and use reactor to pull the things together. 

Maven is really nice when it comes to active
development of several dependent  projects at the
same time. Right now, we have 4 projects and 4
developers, without clear separation. 

Dependency management ( and artifact distribution )
would be plain unmanageable without maven... )


>     So if you need a custom build, you still may use
> ant... but can you 
> call this build from maven, or must you call ant
> directly?

You can call any ant task from maven.xml - 
because maven uses ant behind the scenes ( but not
only ant )

Think of goals defined in plugins as pre-cooked 
ant tasks. 

regards,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

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


Re: Newbie questions - from ant to maven

Posted by Jose Gonzalez Gomez <jg...@opentechnet.com>.
    I still don't see the diference or relation between maven.xml and 
build.xml. From what I read and your answers I understand that maven is 
thought for the development of a "monolithic" application or library, 
the one that tipically is bundled in one jar, am I right?

    So if you need a custom build, you still may use ant... but can you 
call this build from maven, or must you call ant directly?

    Please, see inline for more questions...

Konstantin Priblouda wrote:

>--- Jose Gonzalez Gomez <jg...@opentechnet.com>
>wrote:
>  
>
>>    Is this the recommended approach for j2ee
>>applications? I mean, I 
>>was thinking about switching to maven because of all
>>the added 
>>functionalities over ant (source code metrics, cross
>>reference source, 
>>documentation and site generation using xdocs,...)
>>but if I have to 
>>create a maven project for each artifact in my
>>application, I think that 
>>this could become cumbersome for large j2ee
>>applications, so maybe I 
>>would delay adopting maven as my main build tool.
>>    
>>
>
>It depends what tiers your application has. 
>If it's only web tier, without EJB ( and produces
>single .war file ) then one maven project will be
>sufficient. 
>With java code for your servlet/MVC framework, test
>cases and web sources.
>
>Though I would separate EJB tier into separate
>project,
>and build them together using reactor. 
>
>I'm working on project which is a big portal with
>really different parts.
>
>So I move all stuff which can be used elsewhere
>( like portlet management, persistence/business logic 
>for applications which could be used from separate web
>context ) into separatreprojects, which produce
>deployment units ( like ejb-jar ) and client
>libraries.
>
>
>This wa I can distribute work on the project parts 
>between my code velopers ( and sometimes our partner
>companies )
>
>Then all tested versions of subsystem are integrated
>into portal project itself.
>
>Currently I got following projects: 
>- validation framework
>- portlet management
>- persistence layer and business logic for application
>- integration project
>
>In future I plan to add some other projects and
>setup common reactor for integration builds.
>( and come OS projects I'm using will be also
>integrated there. And if they do not have maven build
>system yet, I write it myself and try to lobby them to
>adopt it :) )
>
    So do you have this projects in different locations, or could you 
just create several project.properties (or whatever) to specify the 
information for this projects and keep all the source under a common 
location?

    Currently I'm developing a J2EE application that has a war and two 
ejb jars, that's why I'm so interested in this issue. Could you please 
outline you file hierarchy?

>
>  
>
>>any convention in order to be used by maven? What is
>>the relation 
>>between maven.xml, build.xml, project.xml,
>>project.properties?
>>    
>>
>
>maven xml defines your build goals ( and is mostly not
>necessary - not for standart cases )
>
    Ok, so you could override some of the standard goals and finally 
call your custom build script if those standard goals doesn't match your 
interests, couldn't you? Or create new goals... By the way, what are the 
standard cases? I've seen goals in maven for j2ee:ejb, j2ee:war, etc, 
but they seem to be oriented for a J2EE application with a single war 
and a single jar file, am I wrong? I have the feeling that maven is 
rather inmatture in this sense, I mean, working with a fairly complex 
J2EE application requires some hacking or workaround to get maven working.

>build.xml is POABS ( plain old ant build script ),
>possibly generated by maven.
>project.xml defines projects tructure and dependencies
>project.properties allows fine tuning of goals defined
>by maven and your goals 
>
>There is also build.properties which will override 
>propject.properties and is used for user local
>settings ( do not check it in into CVS )
>
>regards,
>
>=====
>Konstantin Priblouda ( ko5tik )    Freelance Software developer
>< http://www.pribluda.de > < play java games -> http://www.yook.de >
>< render charts online -> http://www.pribluda.de/povray/ >
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Tax Center - File online, calculators, forms, and more
>http://platinum.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>  
>
    And of course, thank you very much for your kind help. By the way, 
where are you from? I'm from Spain, and I'm right now trying to stablish 
as a freelance developer, what about your experience?

    Regards
    Jose


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