Grokbase Groups Maven users May 2003
FAQ
Ack!
I've just switched my project over to maven and have broken it up into
several subprojects (ejb, common, war, etc). now, I know this is not a
"maven" problem, but as this is a common layout for a maven project I hope
someone will be able to help. i've been able to create my subprojects
within eclipse, but I cannot get the files from my project root (ie:
project.xml, maven.xml, etc) to be included. I've tried creating a new
project for the root module, but eclipse throws an error saying that
"project root and project root/common overlap." Is there some other way to
get these files included into eclipse? I need to have these files tracked
by cvs, and eclipse is my main cvs tool. Any help would be greatly
appreciated!

Here's my project layout:
+--project root
--+common module
--project.xml
--maven.xml
--+ejb module
--project.xml
--maven.xml
--project.xml
--maven.xml

I hope someone can answer this one!
Ryan

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

Search Discussions

  • Colin Sampaleanu at May 30, 2003 at 3:09 pm
    This is a problem, because while Eclipse can handle nested sources via
    exclusion filters, it can't actually handle nested projects where you
    need to have the eclipse project metadata somewhere at a root level, and
    below that have eclipse project metadata for other projects.

    Now what will work is putting the root project metadata somewhere else.
    So it can live parallel to the subprojects for example, and then you can
    use links to bring in the source it needs...

    Sonnek, Ryan wrote:
    Ack!
    I've just switched my project over to maven and have broken it up into
    several subprojects (ejb, common, war, etc). now, I know this is not a
    "maven" problem, but as this is a common layout for a maven project I hope
    someone will be able to help. i've been able to create my subprojects
    within eclipse, but I cannot get the files from my project root (ie:
    project.xml, maven.xml, etc) to be included. I've tried creating a new
    project for the root module, but eclipse throws an error saying that
    "project root and project root/common overlap." Is there some other way to
    get these files included into eclipse? I need to have these files tracked
    by cvs, and eclipse is my main cvs tool. Any help would be greatly
    appreciated!

    Here's my project layout:
    +--project root
    --+common module
    --project.xml
    --maven.xml
    --+ejb module
    --project.xml
    --maven.xml
    --project.xml
    --maven.xml

    I hope someone can answer this one!
    Ryan

    ---------------------------------------------------------------------
    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
  • Gilles Dodinet at May 30, 2003 at 3:11 pm
    your layout makes me think you need to have one and only one eclipse
    project (say root), with several source directories (common/src/java,
    ejb/src/java, etc..). maven-new module illustrates that. The drawback of
    such an approach is that .classpath isnot easily generated since
    maven-eclipse-plugin doesnt yet take such layout into consideration.
    another approch would be to have different eclipse projects (so common
    module should not be under root) but then the problem is that you break
    the semantical relationships that exist between the various subprojects.


    -- gd

    Sonnek, Ryan wrote:
    Ack!
    I've just switched my project over to maven and have broken it up into
    several subprojects (ejb, common, war, etc). now, I know this is not a
    "maven" problem, but as this is a common layout for a maven project I hope
    someone will be able to help. i've been able to create my subprojects
    within eclipse, but I cannot get the files from my project root (ie:
    project.xml, maven.xml, etc) to be included. I've tried creating a new
    project for the root module, but eclipse throws an error saying that
    "project root and project root/common overlap." Is there some other way to
    get these files included into eclipse? I need to have these files tracked
    by cvs, and eclipse is my main cvs tool. Any help would be greatly
    appreciated!

    Here's my project layout:
    +--project root
    --+common module
    --project.xml
    --maven.xml
    --+ejb module
    --project.xml
    --maven.xml
    --project.xml
    --maven.xml

    I hope someone can answer this one!
    Ryan

    ---------------------------------------------------------------------
    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
  • Sonnek, Ryan at May 30, 2003 at 3:36 pm
    Thank you both for your replies.
    So, I'm basically hearing two different approaches, one to create a
    subproject of the root project (something like subroot), and place the
    project.xml, maven.xml, etc there. The other option would be to map all
    subprojects into one eclipse project.

    I personally think that mapping all the source directories into one project
    defeats the purpose of having the subprojects in the first place. My
    current project is relatively small, but having 10-20 subprojects does not
    seem uncommon. Having projects broken apart so that developers can focus on
    their own modules and not have to see all other java and test files is a
    major development bonus. I can imagine having this master project easily
    having 20 different src directories, and now THAT would be a maintenance
    nightmare.

    Placing the root files in a subproject seems to be a pretty good idea. Will
    the Reactor still perform as it should? This is the project layout that
    you're suggesting right?

    +MyProject
    --+common subproject
    --project.xml (extends ../root subproject/project.xml)
    --maven.xml
    --+ejb subproject
    --project.xml (extends ../root subproject/project.xml)
    --maven.xml
    --+root subproject
    --project.xml (main project.xml defining dependencies, etc)
    --maven.xml
    so, no files exist outside of a subproject? Does this seem like a good
    solution or more of a hack?

    Ryan

    -----Original Message-----
    From: Gilles Dodinet
    Sent: Friday, May 30, 2003 10:14 AM
    To: Maven Users List
    Subject: Re: eclipse subprojects

    your layout makes me think you need to have one and only one eclipse
    project (say root), with several source directories (common/src/java,
    ejb/src/java, etc..). maven-new module illustrates that. The drawback of
    such an approach is that .classpath isnot easily generated since
    maven-eclipse-plugin doesnt yet take such layout into consideration.
    another approch would be to have different eclipse projects (so common
    module should not be under root) but then the problem is that you break
    the semantical relationships that exist between the various subprojects.


    -- gd

    Sonnek, Ryan wrote:
    Ack!
    I've just switched my project over to maven and have broken it up into
    several subprojects (ejb, common, war, etc). now, I know this is not a
    "maven" problem, but as this is a common layout for a maven project I hope
    someone will be able to help. i've been able to create my subprojects
    within eclipse, but I cannot get the files from my project root (ie:
    project.xml, maven.xml, etc) to be included. I've tried creating a new
    project for the root module, but eclipse throws an error saying that
    "project root and project root/common overlap." Is there some other way to
    get these files included into eclipse? I need to have these files tracked
    by cvs, and eclipse is my main cvs tool. Any help would be greatly
    appreciated!

    Here's my project layout:
    +--project root
    --+common module
    --project.xml
    --maven.xml
    --+ejb module
    --project.xml
    --maven.xml
    --project.xml
    --maven.xml

    I hope someone can answer this one!
    Ryan

    ---------------------------------------------------------------------
    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
  • Colin Sampaleanu at May 30, 2003 at 3:52 pm
    It's a bit of a hack in that ideally you would nest the projects, but it
    should work fine, although you might have to work on the reactor setup a
    bit so you don't include your root.

    The main issue with using Eclipse in similr scenarios is when you get
    handed a maven or ant based nested structure (root with subs
    underneath), and you can't rearrange stuff like this. Then you have to
    go to something like putting the eclipse metadata for the root somewhere
    else, then linking back to any source in the root project.

    Sonnek, Ryan wrote:
    Thank you both for your replies.
    So, I'm basically hearing two different approaches, one to create a
    subproject of the root project (something like subroot), and place the
    project.xml, maven.xml, etc there. The other option would be to map all
    subprojects into one eclipse project.

    I personally think that mapping all the source directories into one project
    defeats the purpose of having the subprojects in the first place. My
    current project is relatively small, but having 10-20 subprojects does not
    seem uncommon. Having projects broken apart so that developers can focus on
    their own modules and not have to see all other java and test files is a
    major development bonus. I can imagine having this master project easily
    having 20 different src directories, and now THAT would be a maintenance
    nightmare.

    Placing the root files in a subproject seems to be a pretty good idea. Will
    the Reactor still perform as it should? This is the project layout that
    you're suggesting right?

    +MyProject
    --+common subproject
    --project.xml (extends ../root subproject/project.xml)
    --maven.xml
    --+ejb subproject
    --project.xml (extends ../root subproject/project.xml)
    --maven.xml
    --+root subproject
    --project.xml (main project.xml defining dependencies, etc)
    --maven.xml
    so, no files exist outside of a subproject? Does this seem like a good
    solution or more of a hack?

    Ryan

    -----Original Message-----
    From: Gilles Dodinet
    Sent: Friday, May 30, 2003 10:14 AM
    To: Maven Users List
    Subject: Re: eclipse subprojects

    your layout makes me think you need to have one and only one eclipse
    project (say root), with several source directories (common/src/java,
    ejb/src/java, etc..). maven-new module illustrates that. The drawback of
    such an approach is that .classpath isnot easily generated since
    maven-eclipse-plugin doesnt yet take such layout into consideration.
    another approch would be to have different eclipse projects (so common
    module should not be under root) but then the problem is that you break
    the semantical relationships that exist between the various subprojects.


    -- gd

    Sonnek, Ryan wrote:


    Ack!
    I've just switched my project over to maven and have broken it up into
    several subprojects (ejb, common, war, etc). now, I know this is not a
    "maven" problem, but as this is a common layout for a maven project I hope
    someone will be able to help. i've been able to create my subprojects
    within eclipse, but I cannot get the files from my project root (ie:
    project.xml, maven.xml, etc) to be included. I've tried creating a new
    project for the root module, but eclipse throws an error saying that
    "project root and project root/common overlap." Is there some other way to
    get these files included into eclipse? I need to have these files tracked
    by cvs, and eclipse is my main cvs tool. Any help would be greatly
    appreciated!

    Here's my project layout:
    +--project root
    --+common module
    --project.xml
    --maven.xml
    --+ejb module
    --project.xml
    --maven.xml
    --project.xml
    --maven.xml

    I hope someone can answer this one!
    Ryan

    ---------------------------------------------------------------------
    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
  • Mark H. Wilkinson at May 30, 2003 at 4:06 pm

    On Fri, 2003-05-30 at 16:35, Sonnek, Ryan wrote:

    Placing the root files in a subproject seems to be a pretty good idea. Will
    the Reactor still perform as it should? This is the project layout that
    you're suggesting right?

    +MyProject
    --+common subproject
    --project.xml (extends ../root subproject/project.xml)
    --maven.xml
    --+ejb subproject
    --project.xml (extends ../root subproject/project.xml)
    --maven.xml
    --+root subproject
    --project.xml (main project.xml defining dependencies, etc)
    --maven.xml
    so, no files exist outside of a subproject? Does this seem like a good
    solution or more of a hack?
    I think it's a good solution, but I've been using it myself for quite a
    while so I'm probably biased :-)

    I've worked on projects that had a strictly hierarchical
    project/sub-project layout, but found that eventually the hierarchy
    would become inflexible. The usual rationale for a hierarchical project
    layout is that the top-level project definition specifies some sort of
    grouping of sub-projects from which a distribution can be built. This
    kind of assumes that a single project (and its sub-projects) has a
    single artifact that can be produced as the result of a build.

    Instead I've adopted an approach where you have some projects that build
    common artifacts (like jar files, for example) and other projects that
    simply aggregate these artifacts with appropriate configuration files
    for a particular distribution. By doing this you can easily accommodate
    different target environments, such as the
    development/test/qa/production distinctions that many shops use, or
    client and server parts of a system.

    Generally speaking, this works pretty well with maven - the reactor is
    just as happy when you invoke it like this:

    <maven:reactor
    basedir="${basedir}/.."
    includes="*/project.xml"
    excludes="root/project.xml"
    goals="site:deploy"
    ignoreFailures="false"
    />

    -Mark.


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmaven
postedMay 30, '03 at 3:04p
activeMay 30, '03 at 4:06p
posts6
users4
websitemaven.apache.org
irc#maven

People

Translate

site design / logo © 2019 Grokbase