You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by uday shankar <ad...@gmail.com> on 2011/05/19 12:05:27 UTC

Maven folder structure

Hi,
Using maven if we want to create a sample project, we do so by running a
command like this : 
mvn archetype:generate 
	-DarchetypeGroupId=org.apache.maven.archetypes 
    -DarchetypeArtifactId=maven-archetype-webapp
    -DarchetypeVersion=1.0 -DgroupId=org.demo 
    -DartifactId=DemoApp -Dversion=1.0-SNAPSHOT

On running this, a default folder structure is created. 
I want to create a sample project with my own folder structure. Can anybody
help in creating a sample application with my own folder structure.



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-folder-structure-tp4409276p4409276.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven folder structure

Posted by Benson Margulies <bi...@gmail.com>.
You use the pom elements that tell Maven that you have a different
structure. You don't use an archetype. You create a pom from scratch.

http://maven.apache.org/pom.html is the reference.

You need resources, testResources, sourceDirectory and testSourceDirectory.



On Thu, May 19, 2011 at 10:14 AM, uday shankar <ad...@gmail.com> wrote:
> Hi Karl,
> I understand that you are asking me to stick to the default folder structure
> created by maven.
> This(sticking to the default folder structure) works fine when we are using
> maven right from the beginning of the project.But what if say,
> Scenario 1: we have started the project in eclipse, and in the middle of the
> development process I want to use maven. And maven commands seem to be using
> the default folder structure. How can we use maven with a different folder
> structure(because a simple web application created using maven commands have
> different structure when compared to a web application created in eclipse)??
>
> Scenario 2: If say initially we were using Ant as the building tool for a
> project. Now we want to use Maven as the tool , how do we implement that?
> What is the process of migration from ant to maven?
>
> If there is ambiguity anywhere, I will try explaining again.
> Thanks,
> Uday
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-folder-structure-tp4409276p4409835.html
> Sent from the Maven - Users mailing list archive at Nabble.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: Maven folder structure

Posted by uday shankar <ad...@gmail.com>.
Hi todd,
what about the scenario 1??

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-folder-structure-tp4409276p4410203.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


RE: Maven folder structure

Posted by "Thiessen, Todd (Todd)" <tt...@avaya.com>.
> 
> Scenario 2: If say initially we were using Ant as the building tool for
> a
> project. Now we want to use Maven as the tool , how do we implement
> that?
> What is the process of migration from ant to maven?
> 

Let me try and answer this a little more directly.

The first thing is to have a good understanding of the ant build. If you already have this, you are way ahead. I have helped out teams which had little to no understanding of their ant build as it was put in place years before and now works and no one wants to touch it. Hopefully, you are better off.

Next, you need to have a decent understanding of Maven. Maven isn't just a build tool. It is much more than that. You may have to do some reading here.

Then you can decide on two basic approaches:

1. Perform an ant build and look at the final artifact(s) that your build produces.  Then work backwards and change your build such that maven produces virtually the exact same artifact(s).

2. Start with the source and figure out how to build it using Maven.  I view this as a forwards approach.

I personally like to focus on the former rather than the latter, however realistically you will want to a mix of both.

Here are some of the big obstacles I have seen cause teams the most grief:

1. The final artifact built with Maven may not look EXACTLY like the one you build with ant. This is because you can do some pretty funky things with ant that are very difficult to do with Maven (and greatly frowned upon). For example, I have seen a number of ant builds copy .class files from one location to another and package those same .class files in separate jars.  This is very much frowned upon when using Maven. The approach with Maven is to take the .java files from which those .class files are compiled and move them to their own maven project and build those .java files in their own jar.  .class files should not be duplicated between jars. Trying to do this with Maven will be very very awkward.

2. Your final artifacts built with Maven will likely be MUCH bigger than the ones built with ant. At least at first. This is because Maven handles transitive dependencies automatically and will pull in these jars for you. In ant, you have to reference these dependencies explicitly.  You can of course take control of what dependencies you include using maven, but it will take some effort on your part to understand what artifacts you don't need and why.

3. With ant, you can introduce circular dependencies between jars. For example, jar A can depend on jar B, and jar B can depend on jar A. Again, greatly frowned upon and you will likely get a circular dependency build error converting this kind of structure to Maven.

If you are intimately familiar with your current ant build you may be able to identify some these obstacles up front.


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


Re: Maven folder structure

Posted by Wayne Fay <wa...@gmail.com>.
> Maven is relentless and determined to bend you to its will.

I like that line. ;-)

Wayne

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


RE: Maven folder structure

Posted by "Yanko, Curtis" <cu...@uhc.com>.
Todd,

You are of course correct. Sometimes it takes a more incremental
approach. We start with Build Best Practices:

Establish Release Authority 
Establish Reproducibility 
Automate Processes 
Abstract Process and Metadata from the physical resource 
Optimize Process and supporting architecture 
Apply build acceleration techniques 
Centralize access and collaboration for all stakeholders 
Continuous Integration 
Link build process to deployment process 
Measure!

And under *Automate the Process* we further require

Scripted
*Portable* (which is also abstract process and metadata from physical
resource)
Modular
Positively ID Artifacts
Versioning
Fast (<10 Minutes)

And in my experience a focus on portability yields the most benefit.
Removing hard coded reference and such, using one directory for all
output.

Once we are oat that point, and we generally have to get here to support
the Ant build in a CI system, then just about the only thing we run into
is that test files are co-mingled with code and other little items like
that.

________________________________

Curt Yanko | Continuous Integration Services | UnitedHealth Group IT 
Making IT Happen, one build at a time, 600 times a day
 

> -----Original Message-----
> From: Thiessen, Todd (Todd) [mailto:tthiessen@avaya.com] 
> Sent: Thursday, May 19, 2011 2:49 PM
> To: Maven Users List
> Subject: RE: Maven folder structure
> 
> You may still indeed have problems. That depends on your 
> current ant structure. As Curtis mentioned, if your ant 
> folder structure is "reasonable" then instructing maven to 
> use this directory structure is doable.  But how does one 
> define reasonable?
> 
> For example, does your ant build copy .class files between 
> jars?  Does your ant build generate more than one artifact?  
> If the answer is yes to either of these questions then you 
> will likely have to do some restructuring. And in that case, 
> you are better off using the default Maven structure to keep 
> things simple. In my experience, ant builds usually have 
> these kind of complexities which make reusing the ant 
> directory structure problematic.
> 
> But if your ant build doesn't have these complexities, then 
> you should be fine.
> 
> > -----Original Message-----
> > From: uday shankar [mailto:adonis.uday@gmail.com]
> > Sent: Thursday, May 19, 2011 2:10 PM
> > To: users@maven.apache.org
> > Subject: RE: Maven folder structure
> > 
> > After we override the default folder structure by making 
> the changes 
> > in the build tag of the pom.xml file. when we run any 
> command say mvn 
> > package doesn't it consider the folder structure mentioned in the 
> > <build> tag.
> > If
> > this is the case we should not have anyproblem even if we 
> are changing 
> > the folder structure because in that case the plugins like package 
> > will be considering the altered structure
> > 
> > --
> > View this message in context: 
> http://maven.40175.n5.nabble.com/Maven-
> > folder-structure-tp4409276p4410472.html
> > Sent from the Maven - Users mailing list archive at Nabble.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
> 
> 

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.


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


RE: Maven folder structure

Posted by "Thiessen, Todd (Todd)" <tt...@avaya.com>.
You may still indeed have problems. That depends on your current ant structure. As Curtis mentioned, if your ant folder structure is "reasonable" then instructing maven to use this directory structure is doable.  But how does one define reasonable?

For example, does your ant build copy .class files between jars?  Does your ant build generate more than one artifact?  If the answer is yes to either of these questions then you will likely have to do some restructuring. And in that case, you are better off using the default Maven structure to keep things simple. In my experience, ant builds usually have these kind of complexities which make reusing the ant directory structure problematic.

But if your ant build doesn't have these complexities, then you should be fine.

> -----Original Message-----
> From: uday shankar [mailto:adonis.uday@gmail.com]
> Sent: Thursday, May 19, 2011 2:10 PM
> To: users@maven.apache.org
> Subject: RE: Maven folder structure
> 
> After we override the default folder structure by making the changes in
> the
> build tag of the pom.xml file. when we run any command say mvn package
> doesn't it consider the folder structure mentioned in the <build> tag.
> If
> this is the case we should not have anyproblem even if we are changing
> the
> folder structure because in that case the plugins like package will be
> considering the altered structure
> 
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-
> folder-structure-tp4409276p4410472.html
> Sent from the Maven - Users mailing list archive at Nabble.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: Maven folder structure

Posted by uday shankar <ad...@gmail.com>.
After we override the default folder structure by making the changes in the
build tag of the pom.xml file. when we run any command say mvn package
doesn't it consider the folder structure mentioned in the <build> tag. If
this is the case we should not have anyproblem even if we are changing the
folder structure because in that case the plugins like package will be
considering the altered structure

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-folder-structure-tp4409276p4410472.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


RE: Maven folder structure

Posted by "Yanko, Curtis" <cu...@uhc.com>.
Folder structure is one Maven battle we haven't had to fight very much and we do a lot of Ant conversions. If the original structure is reasonable overriding the Maven defaults usually is enough.

________________________________

Curt Yanko | Continuous Integration Services | UnitedHealth Group IT 
Making IT Happen, one build at a time, 600 times a day
 

> -----Original Message-----
> From: Thiessen, Todd (Todd) [mailto:tthiessen@avaya.com] 
> Sent: Thursday, May 19, 2011 12:57 PM
> To: Maven Users List
> Subject: RE: Maven folder structure
> 
> Ant Trooper: "How long have you had that ant build?"
> Maven Skywalker: "About 3 or 4 releases."
> Ant Trooper: "I'd like to move to Maven but keep the ant 
> folder structure."
> Maven Kenobi: "You don't need to keep the ant folder structure."
> Ant Trooper: "... I don't need to keep the ant folder structure ..."
> Maven Kenobi: "It's not the folder structure you're looking for."
> Ant Trooper: "... It's not the folder structure I'm looking for ..."
> Maven Kenobi: "We can go about our Maven business."
> Ant Trooper: "... you can go about your Maven business ..."
> Maven Kenobi: "Move along."
> 
> Ant Trooper: "Move along! Move along!"
> 
> 
> Not sure how much of the list is Star Wars savvy, buy hey. I 
> didn't start it ;-).
> 
> Anyway, getting off topic.
> 
> > -----Original Message-----
> > From: Michael Haefele [mailto:michael.haefele@parityenergy.com]
> > Sent: Thursday, May 19, 2011 12:42 PM
> > To: Maven Users List
> > Subject: Re: Maven folder structure
> > 
> > "Let the Wookie win."
> > 
> > On Thu, May 19, 2011 at 12:33 PM, Ron Wheeler 
> > <rw...@artifact-software.com> wrote:
> > > +1
> > > If you don't do things the Maven way, you will be in a 
> battle until
> > Maven
> > > defeats you.
> > > You might as well give in early, you have no chance of wining.
> > > Maven is relentless and determined to bend you to its will.
> > >
> > > Ron
> > >
> > > On 19/05/2011 10:28 AM, Thiessen, Todd (Todd) wrote:
> > >>
> > >> Your scenario is not uncommon. I have seems many teams go through
> > it.
> > >>
> > >> The advice I always give is to NOT give in to the 
> temptation to try
> > and
> > >> keep your existing structure when you move to maven.  Your build
> > will be a
> > >> large mess.
> > >>
> > >> Converting to maven means more than simply adopting a folder
> > convention.
> > >>  It is also about a build philosophy. For example, Maven strongly
> > encourages
> > >> one artifact per project.  You will run into this when converting
> > your build
> > >> to use maven. If you deviate from using the default folder
> > conventions, in
> > >> my experience, only leads to greater confusion and more 
> time to get
> > the
> > >> conversion done.
> > >>
> > >>> -----Original Message-----
> > >>> From: uday shankar [mailto:adonis.uday@gmail.com]
> > >>> Sent: Thursday, May 19, 2011 10:15 AM
> > >>> To: users@maven.apache.org
> > >>> Subject: Re: Maven folder structure
> > >>>
> > >>> Hi Karl,
> > >>> I understand that you are asking me to stick to the 
> default folder 
> > >>> structure created by maven.
> > >>> This(sticking to the default folder structure) works 
> fine when we
> > are
> > >>> using
> > >>> maven right from the beginning of the project.But what if say, 
> > >>> Scenario 1: we have started the project in eclipse, and in the
> > middle
> > >>> of the
> > >>> development process I want to use maven. And maven 
> commands seem 
> > >>> to
> > be
> > >>> using
> > >>> the default folder structure. How can we use maven with a 
> > >>> different folder structure(because a simple web application 
> > >>> created using maven
> > commands
> > >>> have
> > >>> different structure when compared to a web application 
> created in 
> > >>> eclipse)??
> > >>>
> > >>> Scenario 2: If say initially we were using Ant as the building 
> > >>> tool
> > for
> > >>> a
> > >>> project. Now we want to use Maven as the tool , how do we 
> > >>> implement that?
> > >>> What is the process of migration from ant to maven?
> > >>>
> > >>> If there is ambiguity anywhere, I will try explaining again.
> > >>> Thanks,
> > >>> Uday
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> View this message in context:
> > http://maven.40175.n5.nabble.com/Maven-
> > >>> folder-structure-tp4409276p4409835.html
> > >>> Sent from the Maven - Users mailing list archive at Nabble.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
> > >>
> > >>
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > - 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.


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


RE: Maven folder structure

Posted by "Thiessen, Todd (Todd)" <tt...@avaya.com>.
Ant Trooper: "How long have you had that ant build?"
Maven Skywalker: "About 3 or 4 releases."
Ant Trooper: "I'd like to move to Maven but keep the ant folder structure."
Maven Kenobi: "You don't need to keep the ant folder structure."
Ant Trooper: "... I don't need to keep the ant folder structure ..."
Maven Kenobi: "It's not the folder structure you're looking for."
Ant Trooper: "... It's not the folder structure I'm looking for ..."
Maven Kenobi: "We can go about our Maven business."
Ant Trooper: "... you can go about your Maven business ..."
Maven Kenobi: "Move along."

Ant Trooper: "Move along! Move along!"


Not sure how much of the list is Star Wars savvy, buy hey. I didn't start it ;-).

Anyway, getting off topic.

> -----Original Message-----
> From: Michael Haefele [mailto:michael.haefele@parityenergy.com]
> Sent: Thursday, May 19, 2011 12:42 PM
> To: Maven Users List
> Subject: Re: Maven folder structure
> 
> "Let the Wookie win."
> 
> On Thu, May 19, 2011 at 12:33 PM, Ron Wheeler
> <rw...@artifact-software.com> wrote:
> > +1
> > If you don't do things the Maven way, you will be in a battle until
> Maven
> > defeats you.
> > You might as well give in early, you have no chance of wining.
> > Maven is relentless and determined to bend you to its will.
> >
> > Ron
> >
> > On 19/05/2011 10:28 AM, Thiessen, Todd (Todd) wrote:
> >>
> >> Your scenario is not uncommon. I have seems many teams go through
> it.
> >>
> >> The advice I always give is to NOT give in to the temptation to try
> and
> >> keep your existing structure when you move to maven.  Your build
> will be a
> >> large mess.
> >>
> >> Converting to maven means more than simply adopting a folder
> convention.
> >>  It is also about a build philosophy. For example, Maven strongly
> encourages
> >> one artifact per project.  You will run into this when converting
> your build
> >> to use maven. If you deviate from using the default folder
> conventions, in
> >> my experience, only leads to greater confusion and more time to get
> the
> >> conversion done.
> >>
> >>> -----Original Message-----
> >>> From: uday shankar [mailto:adonis.uday@gmail.com]
> >>> Sent: Thursday, May 19, 2011 10:15 AM
> >>> To: users@maven.apache.org
> >>> Subject: Re: Maven folder structure
> >>>
> >>> Hi Karl,
> >>> I understand that you are asking me to stick to the default folder
> >>> structure
> >>> created by maven.
> >>> This(sticking to the default folder structure) works fine when we
> are
> >>> using
> >>> maven right from the beginning of the project.But what if say,
> >>> Scenario 1: we have started the project in eclipse, and in the
> middle
> >>> of the
> >>> development process I want to use maven. And maven commands seem to
> be
> >>> using
> >>> the default folder structure. How can we use maven with a different
> >>> folder
> >>> structure(because a simple web application created using maven
> commands
> >>> have
> >>> different structure when compared to a web application created in
> >>> eclipse)??
> >>>
> >>> Scenario 2: If say initially we were using Ant as the building tool
> for
> >>> a
> >>> project. Now we want to use Maven as the tool , how do we implement
> >>> that?
> >>> What is the process of migration from ant to maven?
> >>>
> >>> If there is ambiguity anywhere, I will try explaining again.
> >>> Thanks,
> >>> Uday
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> http://maven.40175.n5.nabble.com/Maven-
> >>> folder-structure-tp4409276p4409835.html
> >>> Sent from the Maven - Users mailing list archive at Nabble.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
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > 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


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


Re: Maven folder structure

Posted by Michael Haefele <mi...@parityenergy.com>.
"Let the Wookie win."

On Thu, May 19, 2011 at 12:33 PM, Ron Wheeler
<rw...@artifact-software.com> wrote:
> +1
> If you don't do things the Maven way, you will be in a battle until Maven
> defeats you.
> You might as well give in early, you have no chance of wining.
> Maven is relentless and determined to bend you to its will.
>
> Ron
>
> On 19/05/2011 10:28 AM, Thiessen, Todd (Todd) wrote:
>>
>> Your scenario is not uncommon. I have seems many teams go through it.
>>
>> The advice I always give is to NOT give in to the temptation to try and
>> keep your existing structure when you move to maven.  Your build will be a
>> large mess.
>>
>> Converting to maven means more than simply adopting a folder convention.
>>  It is also about a build philosophy. For example, Maven strongly encourages
>> one artifact per project.  You will run into this when converting your build
>> to use maven. If you deviate from using the default folder conventions, in
>> my experience, only leads to greater confusion and more time to get the
>> conversion done.
>>
>>> -----Original Message-----
>>> From: uday shankar [mailto:adonis.uday@gmail.com]
>>> Sent: Thursday, May 19, 2011 10:15 AM
>>> To: users@maven.apache.org
>>> Subject: Re: Maven folder structure
>>>
>>> Hi Karl,
>>> I understand that you are asking me to stick to the default folder
>>> structure
>>> created by maven.
>>> This(sticking to the default folder structure) works fine when we are
>>> using
>>> maven right from the beginning of the project.But what if say,
>>> Scenario 1: we have started the project in eclipse, and in the middle
>>> of the
>>> development process I want to use maven. And maven commands seem to be
>>> using
>>> the default folder structure. How can we use maven with a different
>>> folder
>>> structure(because a simple web application created using maven commands
>>> have
>>> different structure when compared to a web application created in
>>> eclipse)??
>>>
>>> Scenario 2: If say initially we were using Ant as the building tool for
>>> a
>>> project. Now we want to use Maven as the tool , how do we implement
>>> that?
>>> What is the process of migration from ant to maven?
>>>
>>> If there is ambiguity anywhere, I will try explaining again.
>>> Thanks,
>>> Uday
>>>
>>>
>>>
>>> --
>>> View this message in context: http://maven.40175.n5.nabble.com/Maven-
>>> folder-structure-tp4409276p4409835.html
>>> Sent from the Maven - Users mailing list archive at Nabble.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
>>
>>
>
>
> ---------------------------------------------------------------------
> 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: Maven folder structure

Posted by Ron Wheeler <rw...@artifact-software.com>.
+1
If you don't do things the Maven way, you will be in a battle until 
Maven defeats you.
You might as well give in early, you have no chance of wining.
Maven is relentless and determined to bend you to its will.

Ron

On 19/05/2011 10:28 AM, Thiessen, Todd (Todd) wrote:
> Your scenario is not uncommon. I have seems many teams go through it.
>
> The advice I always give is to NOT give in to the temptation to try and keep your existing structure when you move to maven.  Your build will be a large mess.
>
> Converting to maven means more than simply adopting a folder convention.  It is also about a build philosophy. For example, Maven strongly encourages one artifact per project.  You will run into this when converting your build to use maven. If you deviate from using the default folder conventions, in my experience, only leads to greater confusion and more time to get the conversion done.
>
>> -----Original Message-----
>> From: uday shankar [mailto:adonis.uday@gmail.com]
>> Sent: Thursday, May 19, 2011 10:15 AM
>> To: users@maven.apache.org
>> Subject: Re: Maven folder structure
>>
>> Hi Karl,
>> I understand that you are asking me to stick to the default folder
>> structure
>> created by maven.
>> This(sticking to the default folder structure) works fine when we are
>> using
>> maven right from the beginning of the project.But what if say,
>> Scenario 1: we have started the project in eclipse, and in the middle
>> of the
>> development process I want to use maven. And maven commands seem to be
>> using
>> the default folder structure. How can we use maven with a different
>> folder
>> structure(because a simple web application created using maven commands
>> have
>> different structure when compared to a web application created in
>> eclipse)??
>>
>> Scenario 2: If say initially we were using Ant as the building tool for
>> a
>> project. Now we want to use Maven as the tool , how do we implement
>> that?
>> What is the process of migration from ant to maven?
>>
>> If there is ambiguity anywhere, I will try explaining again.
>> Thanks,
>> Uday
>>
>>
>>
>> --
>> View this message in context: http://maven.40175.n5.nabble.com/Maven-
>> folder-structure-tp4409276p4409835.html
>> Sent from the Maven - Users mailing list archive at Nabble.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
>
>


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


RE: Maven folder structure

Posted by "Thiessen, Todd (Todd)" <tt...@avaya.com>.
Your scenario is not uncommon. I have seems many teams go through it.

The advice I always give is to NOT give in to the temptation to try and keep your existing structure when you move to maven.  Your build will be a large mess.

Converting to maven means more than simply adopting a folder convention.  It is also about a build philosophy. For example, Maven strongly encourages one artifact per project.  You will run into this when converting your build to use maven. If you deviate from using the default folder conventions, in my experience, only leads to greater confusion and more time to get the conversion done.

> -----Original Message-----
> From: uday shankar [mailto:adonis.uday@gmail.com]
> Sent: Thursday, May 19, 2011 10:15 AM
> To: users@maven.apache.org
> Subject: Re: Maven folder structure
> 
> Hi Karl,
> I understand that you are asking me to stick to the default folder
> structure
> created by maven.
> This(sticking to the default folder structure) works fine when we are
> using
> maven right from the beginning of the project.But what if say,
> Scenario 1: we have started the project in eclipse, and in the middle
> of the
> development process I want to use maven. And maven commands seem to be
> using
> the default folder structure. How can we use maven with a different
> folder
> structure(because a simple web application created using maven commands
> have
> different structure when compared to a web application created in
> eclipse)??
> 
> Scenario 2: If say initially we were using Ant as the building tool for
> a
> project. Now we want to use Maven as the tool , how do we implement
> that?
> What is the process of migration from ant to maven?
> 
> If there is ambiguity anywhere, I will try explaining again.
> Thanks,
> Uday
> 
> 
> 
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-
> folder-structure-tp4409276p4409835.html
> Sent from the Maven - Users mailing list archive at Nabble.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: Maven folder structure

Posted by uday shankar <ad...@gmail.com>.
Hi Karl,
I understand that you are asking me to stick to the default folder structure
created by maven.
This(sticking to the default folder structure) works fine when we are using
maven right from the beginning of the project.But what if say,
Scenario 1: we have started the project in eclipse, and in the middle of the
development process I want to use maven. And maven commands seem to be using
the default folder structure. How can we use maven with a different folder
structure(because a simple web application created using maven commands have
different structure when compared to a web application created in eclipse)??

Scenario 2: If say initially we were using Ant as the building tool for a
project. Now we want to use Maven as the tool , how do we implement that?
What is the process of migration from ant to maven?

If there is ambiguity anywhere, I will try explaining again.
Thanks,
Uday 



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-folder-structure-tp4409276p4409835.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven folder structure

Posted by Karl Heinz Marbaise <ka...@soebes.de>.
Hi,

you can use the following configurations to get your requirments to work
with maven:

Here is just an excerpt of that:

  <directory>${project.basedir}/target</directory>
    <outputDirectory>${project.build.directory}/classes</outputDirectory>
    <finalName>${project.artifactId}-${project.version}</finalName>
   
<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
    <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
   
<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>${project.basedir}/src/test/resources</directory>
      </testResource>
    </testResources>

The reference can be found here: 
http://maven.apache.org/pom.html#The_Super_POM

But i recommend that you change your requirements....

-----
Kind regards
Karl Heinz Marbaise
----
http://www.soebes.de
http://www.skmwiki.de
http://supose.org/wiki/supose
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-folder-structure-tp4409276p4409763.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven folder structure

Posted by uday shankar <ad...@gmail.com>.
Hi,
I understand that conventional method is better but here the requirement is
that we have to create a webapp or any sample app with our own
structure(defined by us). Can you please tell me a way to do this??

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-folder-structure-tp4409276p4409454.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven folder structure

Posted by Karl Heinz Marbaise <ka...@soebes.de>.
Hi,

the first thing you need to accept is the "convention over configuration"
paradigm in Maven....you can change the configuration to accept your folder
locations but it's better to use the defaults...

http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

Kind regards
Karl Heinz Marbaise

-----
Kind regards
Karl Heinz Marbaise
----
http://www.soebes.de
http://www.skmwiki.de
http://supose.org/wiki/supose
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-folder-structure-tp4409276p4409348.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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