You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Santos Patel <sa...@tcs.com> on 2009/03/12 08:25:40 UTC

Help with unorganized Maven project

Hi,

We got hold of a project in our company that uses Maven. I have been going 
through the code and Maven. The problem is that the previous team that had 
the code was new to Maven and all the plugin usage and fixes that are in 
place were the workarounds that came to their mind first. I have noticed a 
lot many places where better code and newer plugins can be used as well as 
the build as of now seems too complicated but working. They also seem to 
have developed their own maven plugins for activities such as ssh transfer 
of the build to a server location and such stuff. 
The biggest problem is there is no documentation, neither with the code 
nor in the code. :-(
The current layout of the code is something like...

Project1
         |
         ===> pom.xml
         ===> module 1
         ===> module n
Project2
         |
         ===> pom.xml
         ===> module 1
         ===> module n
Project3
         |
         ===> pom.xml
         ===> module 1
         ===> module n

The current procedure is to include all the three in a single workspace in 
eclipse and work with it. I have the maven plugin for eclipse installed 
but no idea how am i going to use it in this scenario.
I'm thinking of proposing a complete makeover of the code but due to time 
issues this is a low priority thing. Also I was thinking if all the three 
can be clubbed under a single project with a pom.xml...
I don't have any idea about the last statement that I have written. 

Could anyone please give some directions as to what ways can I go about to 
organize the code. 

Santosh Patel
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Re: Help with unorganized Maven project

Posted by Santos Patel <sa...@tcs.com>.
Thanks a ton Nick. That was really helpful. I'll look into it keeping your 
points in mind.

Santosh
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Re: Help with unorganized Maven project

Posted by Nick Stolwijk <ni...@gmail.com>.
Don't do a big redesign, take it in small steps. [1]

> Also the projects are interdependent. Its like one project has code that
> can be looked at as an API sort of thing providing common functionalities.

Good, use modules and add dependencies to the project that use them.

> Another project has all the applications that use the previous one.

This sounds like different projects, but maybe a common parent could
come in handy. Like, defining dependencyManagement, different
reporting settings then your common modules, etc.

I suggest to create a company pom with all the plugin configuration
and let all the projects inherit it from here.

Remember, take it in little steps.
- Organize the files in each module according to the Maven way and
remove any configuration which uses the old paths.
- Create a dependencyManagement section and start removing dependency
version numbers from each module, so you have uniform dependencies.

[1] http://blog.objectmentor.com/articles/2009/01/09/the-big-redesign-in-the-sky

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Thu, Mar 12, 2009 at 11:51 AM, Santos Patel <sa...@tcs.com> wrote:
> hi,
>
> Thanks for the prompt reply. I have installed the maven plugin for
> eclipse. I'm using Eclipse Ganymede.
> The problem is the poms under these 3 projects are not structured well.
> Also the projects are interdependent. Its like one project has code that
> can be looked at as an API sort of thing providing common functionalities.
> Another project has all the applications that use the previous one. And
> the final one sort of builds plugins using the other two. By plugin I mean
> that it is going to be integrated into another big already deployed
> application.
>
> Re-designing the complete thing would be hectic but once done.....
>
> @NICK
> I'm thinking about the super-POM thing that you referred. That is indeed a
> good idea. Thanks.
> Any more thoughts please share...
>
> Santosh
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>

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


Re: Help with unorganized Maven project

Posted by Santos Patel <sa...@tcs.com>.
hi,

Thanks for the prompt reply. I have installed the maven plugin for 
eclipse. I'm using Eclipse Ganymede. 
The problem is the poms under these 3 projects are not structured well. 
Also the projects are interdependent. Its like one project has code that 
can be looked at as an API sort of thing providing common functionalities. 
Another project has all the applications that use the previous one. And 
the final one sort of builds plugins using the other two. By plugin I mean 
that it is going to be integrated into another big already deployed 
application.

Re-designing the complete thing would be hectic but once done.....

@NICK
I'm thinking about the super-POM thing that you referred. That is indeed a 
good idea. Thanks.
Any more thoughts please share...

Santosh
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Re: Help with unorganized Maven project

Posted by Nick Stolwijk <ni...@gmail.com>.
The project setup doesn't seem wrong. I would start creating a company
pom as parent for all 3 projects to start creating a uniform build
process in the company.

For the Eclipse thing, did you install an Eclipse plugin or did you
mean the Maven plugin. If you install an Eclipse (I prefer M2Eclipse
[1]) you can just import the three project trees into one or more
workspaces.

[1] http://m2eclipse.sonatype.org/update/

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Thu, Mar 12, 2009 at 8:25 AM, Santos Patel <sa...@tcs.com> wrote:
> Hi,
>
> We got hold of a project in our company that uses Maven. I have been going
> through the code and Maven. The problem is that the previous team that had
> the code was new to Maven and all the plugin usage and fixes that are in
> place were the workarounds that came to their mind first. I have noticed a
> lot many places where better code and newer plugins can be used as well as
> the build as of now seems too complicated but working. They also seem to
> have developed their own maven plugins for activities such as ssh transfer
> of the build to a server location and such stuff.
> The biggest problem is there is no documentation, neither with the code
> nor in the code. :-(
> The current layout of the code is something like...
>
> Project1
>         |
>         ===> pom.xml
>         ===> module 1
>         ===> module n
> Project2
>         |
>         ===> pom.xml
>         ===> module 1
>         ===> module n
> Project3
>         |
>         ===> pom.xml
>         ===> module 1
>         ===> module n
>
> The current procedure is to include all the three in a single workspace in
> eclipse and work with it. I have the maven plugin for eclipse installed
> but no idea how am i going to use it in this scenario.
> I'm thinking of proposing a complete makeover of the code but due to time
> issues this is a low priority thing. Also I was thinking if all the three
> can be clubbed under a single project with a pom.xml...
> I don't have any idea about the last statement that I have written.
>
> Could anyone please give some directions as to what ways can I go about to
> organize the code.
>
> Santosh Patel
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>

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