Maven 1

Specifying multiple directories in project.xml

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: 1.0-rc1
  • Component/s: None
  • Labels:
    None
  • Environment:
    n/a
  • Number of attachments :
    0

Description

Eclipse allows the user to specify multiple source directories while project.xml only supports one <sourceDirectory>. That's why synchronizing eclipse .classpath file and project.xml appears problematic. Allowing maven users to specify multiple src dirs will allow to solve that issue in a rather easy way.

rhill@wanadoo.fr

Activity

Hide
Peter Donald added a comment -

Could some one assess if this is still relevent in latest Maven?

Show
Peter Donald added a comment - Could some one assess if this is still relevent in latest Maven?
Hide
Emmanuel Venisse added a comment -

-1.

The best practices is to use one src directory by project. If you want more than one, you must use more than one project.

Show
Emmanuel Venisse added a comment - -1. The best practices is to use one src directory by project. If you want more than one, you must use more than one project.
Hide
dion gillard added a comment -

This is currently not being considered for Maven 1.0

Show
dion gillard added a comment - This is currently not being considered for Maven 1.0
Hide
Steve Peterson added a comment -

What about generated source code such as xdoclet and xmlbeans (Jakarta). It would be nice if the source generated by these tools could be added to the eclipse classpath without having to hack the maven-eclipse task
everytime a new code generation tool is ported to maven.

Show
Steve Peterson added a comment - What about generated source code such as xdoclet and xmlbeans (Jakarta). It would be nice if the source generated by these tools could be added to the eclipse classpath without having to hack the maven-eclipse task everytime a new code generation tool is ported to maven.
Hide
Pål Brattberg added a comment -

I see this is marked as "Won't Fix". Is this a final decision, or just for the 1.0 release?

I for one would really like to keep 'handmade' and generated source files separated, and I think this would go for a lot of people using Torque and similar tools.

I hope this will make it into a release someday!

Show
Pål Brattberg added a comment - I see this is marked as "Won't Fix". Is this a final decision, or just for the 1.0 release? I for one would really like to keep 'handmade' and generated source files separated, and I think this would go for a lot of people using Torque and similar tools. I hope this will make it into a release someday!
Hide
Archimedes Trajano added a comment -

The eclipse plugin has support for specifying additional source directories which are useful for generated sources. An example of it is available in the genapp templates that are not default.

Show
Archimedes Trajano added a comment - The eclipse plugin has support for specifying additional source directories which are useful for generated sources. An example of it is available in the genapp templates that are not default.
Hide
analogue added a comment -

+1 on having maven support multiple source directories. Having just one src dir lacks much needed flexiblity and doesn't address instances where a project's directory structure has either already been decided, mandated by policy, or adheres to popular opinion (Eclipse support for multiple directories in 2.x was abysmal. Not only did they get it right in 3.0 because of user feedback, they outdid themselves. Its a joy to see so much inherent flexibility in the end result). Developers, users, managers, and decision makers can all generally agree...choice is a good thing. Nevertheless, as wonderful and powerful a product as Maven is, this issue in particular (in my experience) is going to end up being a big thumbs down for Maven as far as corporate adoption goes.

Show
analogue added a comment - +1 on having maven support multiple source directories. Having just one src dir lacks much needed flexiblity and doesn't address instances where a project's directory structure has either already been decided, mandated by policy, or adheres to popular opinion (Eclipse support for multiple directories in 2.x was abysmal. Not only did they get it right in 3.0 because of user feedback, they outdid themselves. Its a joy to see so much inherent flexibility in the end result). Developers, users, managers, and decision makers can all generally agree...choice is a good thing. Nevertheless, as wonderful and powerful a product as Maven is, this issue in particular (in my experience) is going to end up being a big thumbs down for Maven as far as corporate adoption goes.
Hide
Kenny MacLeod added a comment -

Add a "me too" for multiple source folders.

WHile I appreciate that multiproject is the better approach in many cases (and I organise my own projects along those lines), there are still cases where multiple source folders within a single project is preferable.

For example, I would prefer to seperate my java source files from my xml/properties files. Currently, I have to stick those config files under src/java, which is unpleasant. I'd prefer to keep them seperate, and then have them compiled into a single target folder.

In summary, i don't think that saying "you must use multi projects" is good enough. This is a tool that's meant to be flexible, and I don't believe I've seen good reason to not have this particular feature.

Show
Kenny MacLeod added a comment - Add a "me too" for multiple source folders. WHile I appreciate that multiproject is the better approach in many cases (and I organise my own projects along those lines), there are still cases where multiple source folders within a single project is preferable. For example, I would prefer to seperate my java source files from my xml/properties files. Currently, I have to stick those config files under src/java, which is unpleasant. I'd prefer to keep them seperate, and then have them compiled into a single target folder. In summary, i don't think that saying "you must use multi projects" is good enough. This is a tool that's meant to be flexible, and I don't believe I've seen good reason to not have this particular feature.
Hide
dion gillard added a comment -

"For example, I would prefer to seperate my java source files from my xml/properties files. Currently, I have to stick those config files under src/java, which is unpleasant. I'd prefer to keep them seperate, and then have them compiled into a single target folder."

Your properties and xml files don't need to be in src/java at all. Use the <build><resources> elements to specify a different directory.

Show
dion gillard added a comment - "For example, I would prefer to seperate my java source files from my xml/properties files. Currently, I have to stick those config files under src/java, which is unpleasant. I'd prefer to keep them seperate, and then have them compiled into a single target folder." Your properties and xml files don't need to be in src/java at all. Use the <build><resources> elements to specify a different directory.

People

Vote (9)
Watch (7)

Dates

  • Created:
    Updated:
    Resolved: