Re: iBATIS 3 Maven Project Layout Discussion
Hi Clinton, putting only the mapping files to the source folder is imho perfectly ok, I'm doing the same thing in some projects. I just thought you wanted to put everything (e.g. property files etc.) to the source folder. Regards Kai --- Original Nachricht --- Absender: Clinton Begin Datum: 08.08.2008 17:55 Everybody would always prefer to use the defaults. But it's important to know when not to. To clarify, for the purposes of the ibatis 3 source code, this only impacts the unit tests. When it comes time to include XML schemas (or DTDs), we'll likley put them in a separate resources folder. What I think it impacts more is you as an ibatis or hibernate developer... given a classpath like: src com domain yourapp module persistence PersonMapper.java PersonMapper.xml Would you for the sake of maven recreate that structure into source and resource directories? src com domain yourapp module persistence PersonMapper.java resource com domain yourapp module persistence PersonMapper.xml If so, why? What is the benefit to you? And has anyone ever asked "why" this is the default? And given any answer, is it "good" and/or universally applicable? Cheers, Clinton On Fri, Aug 8, 2008 at 9:24 AM, Kai Grabfelder <[EMAIL PROTECTED]> wrote: Hi, although it is possible to do this with maven I would rather like to see that the maven defaults are used - just because they are some kind of convention - and convention over configuration is one of the key features of maven. Anyway - I guess it is not a big deal to reuse the source folder for resources, so do it if feel you need it ;-) cheers Kai --- Original Nachricht --- Absender: Brandon Goodin Datum: 08.08.2008 16:35 Hey All, There was a private discussion regarding the project layout and maven default conventions. I wanted to put the discussion out in front of everyone else, purely to get feedback and thoughts. At the moment the src directory contains source *and* resources. Maven has been configured to recognize the src/main/java as the resources and java directory. The reason for this is that it can get tedious to move between the java and resources directory rather than just edit a resource in the same package as the java class. The approach of using the java directory as a dual purpose directory is a departure from Maven's default directory structure. The concern of departing from that structure is that it may cause additional difficulties as we make heavier use of maven for coverage and reporting. If we experience difficulties in the future with Maven (because we all know it can be temperamental) it may be that we start having to separate all the resource files out of the java directory in order to eliminate it as a cause. So in summary... Current reasons for dual purpose java directory: * iBATIS 3 will make use of convention configuration and the visual proximity of resources to java is more visually correct * All around less directory clutter Concerns and counterpoints to making the java directory dual purpose: * Most IDEs can merge the resource and java directories in a package view. * We run the risk of avoiding potential maven headaches with plugins that don't handle the combined java/resources approach. In the end the question would be... Is it better to have coding convenience or follow the maven default approach of separating java and resource? Any experiences and comments are welcome. Brandon
Re: iBATIS 3 Maven Project Layout Discussion
Everybody would always prefer to use the defaults. But it's important to know when not to. To clarify, for the purposes of the ibatis 3 source code, this only impacts the unit tests. When it comes time to include XML schemas (or DTDs), we'll likley put them in a separate resources folder. What I think it impacts more is you as an ibatis or hibernate developer... given a classpath like: src com domain yourapp module persistence PersonMapper.java PersonMapper.xml Would you for the sake of maven recreate that structure into source and resource directories? src com domain yourapp module persistence PersonMapper.java resource com domain yourapp module persistence PersonMapper.xml If so, why? What is the benefit to you? And has anyone ever asked "why" this is the default? And given any answer, is it "good" and/or universally applicable? Cheers, Clinton On Fri, Aug 8, 2008 at 9:24 AM, Kai Grabfelder <[EMAIL PROTECTED]> wrote: > > Hi, > > although it is possible to do this with maven I would rather like to see that > the maven defaults are used - just because they are some kind of convention - > and convention over configuration is one of the key features of maven. Anyway > - I guess it is not a big deal to reuse the source folder for resources, so > do it if feel you need it ;-) > > cheers > > Kai > > --- Original Nachricht --- > Absender: Brandon Goodin > Datum: 08.08.2008 16:35 >> >> Hey All, >> >> There was a private discussion regarding the project layout and maven >> default conventions. I wanted to put the discussion out in front of >> everyone else, purely to get feedback and thoughts. >> >> At the moment the src directory contains source *and* resources. Maven >> has been configured to recognize the src/main/java as the resources >> and java directory. The reason for this is that it can get tedious to >> move between the java and resources directory rather than just edit a >> resource in the same package as the java class. >> >> The approach of using the java directory as a dual purpose directory >> is a departure from Maven's default directory structure. The concern >> of departing from that structure is that it may cause additional >> difficulties as we make heavier use of maven for coverage and >> reporting. If we experience difficulties in the future with Maven >> (because we all know it can be temperamental) it may be that we start >> having to separate all the resource files out of the java directory in >> order to eliminate it as a cause. >> >> So in summary... >> >> Current reasons for dual purpose java directory: >> * iBATIS 3 will make use of convention configuration and the visual >> proximity of resources to java is more visually correct >> * All around less directory clutter >> >> >> Concerns and counterpoints to making the java directory dual purpose: >> * Most IDEs can merge the resource and java directories in a package view. >> * We run the risk of avoiding potential maven headaches with plugins >> that don't handle the combined java/resources approach. >> >> >> In the end the question would be... Is it better to have coding >> convenience or follow the maven default approach of separating java >> and resource? Any experiences and comments are welcome. >> >> Brandon >> >
Re: iBATIS 3 Maven Project Layout Discussion
Hi, although it is possible to do this with maven I would rather like to see that the maven defaults are used - just because they are some kind of convention - and convention over configuration is one of the key features of maven. Anyway - I guess it is not a big deal to reuse the source folder for resources, so do it if feel you need it ;-) cheers Kai --- Original Nachricht --- Absender: Brandon Goodin Datum: 08.08.2008 16:35 Hey All, There was a private discussion regarding the project layout and maven default conventions. I wanted to put the discussion out in front of everyone else, purely to get feedback and thoughts. At the moment the src directory contains source *and* resources. Maven has been configured to recognize the src/main/java as the resources and java directory. The reason for this is that it can get tedious to move between the java and resources directory rather than just edit a resource in the same package as the java class. The approach of using the java directory as a dual purpose directory is a departure from Maven's default directory structure. The concern of departing from that structure is that it may cause additional difficulties as we make heavier use of maven for coverage and reporting. If we experience difficulties in the future with Maven (because we all know it can be temperamental) it may be that we start having to separate all the resource files out of the java directory in order to eliminate it as a cause. So in summary... Current reasons for dual purpose java directory: * iBATIS 3 will make use of convention configuration and the visual proximity of resources to java is more visually correct * All around less directory clutter Concerns and counterpoints to making the java directory dual purpose: * Most IDEs can merge the resource and java directories in a package view. * We run the risk of avoiding potential maven headaches with plugins that don't handle the combined java/resources approach. In the end the question would be... Is it better to have coding convenience or follow the maven default approach of separating java and resource? Any experiences and comments are welcome. Brandon
Re: iBATIS 3 Maven Project Layout Discussion
That's good to hear. I'm too lazy to go confirm much of this :). So, thanks for doing some foot work to find examples where this is being used without problem. I know Maven provides for this feature. But, I have run across other features that were provided for and wound up causing headaches. Anyway, this is all good feedback. B On Fri, Aug 8, 2008 at 10:14 AM, Clinton Begin <[EMAIL PROTECTED]> wrote: > Great Summary Brandon. > > Given that Maven allows one to specify the resources folder (and even filter > out certain files, like we will for .java files eventually), and considering > that it does not cast a warning or error upon setting the resource directory > to the source directory, I would consider it a feature supported by Maven. > If we do encounter issues, I won't be shy about filing a bug report with > either Maven or any plug-ins that have a problem with this configuration. > > iBATIS is not the only project to use this sort of setup. Hibernate also > has classpath resources that sit directly beside the class files. While > some may choose to separate them out for a very good reason, I believe most > keep them in the exact same directory structure. So I would bet that this > is quite a common practice. > > Cheers, > Clinton > > On Fri, Aug 8, 2008 at 8:35 AM, Brandon Goodin <[EMAIL PROTECTED]> > wrote: >> >> Hey All, >> >> There was a private discussion regarding the project layout and maven >> default conventions. I wanted to put the discussion out in front of >> everyone else, purely to get feedback and thoughts. >> >> At the moment the src directory contains source *and* resources. Maven >> has been configured to recognize the src/main/java as the resources >> and java directory. The reason for this is that it can get tedious to >> move between the java and resources directory rather than just edit a >> resource in the same package as the java class. >> >> The approach of using the java directory as a dual purpose directory >> is a departure from Maven's default directory structure. The concern >> of departing from that structure is that it may cause additional >> difficulties as we make heavier use of maven for coverage and >> reporting. If we experience difficulties in the future with Maven >> (because we all know it can be temperamental) it may be that we start >> having to separate all the resource files out of the java directory in >> order to eliminate it as a cause. >> >> So in summary... >> >> Current reasons for dual purpose java directory: >> * iBATIS 3 will make use of convention configuration and the visual >> proximity of resources to java is more visually correct >> * All around less directory clutter >> >> >> Concerns and counterpoints to making the java directory dual purpose: >> * Most IDEs can merge the resource and java directories in a package view. >> * We run the risk of avoiding potential maven headaches with plugins >> that don't handle the combined java/resources approach. >> >> >> In the end the question would be... Is it better to have coding >> convenience or follow the maven default approach of separating java >> and resource? Any experiences and comments are welcome. >> >> Brandon > >
Re: iBATIS 3 Maven Project Layout Discussion
Great Summary Brandon. Given that Maven allows one to specify the resources folder (and even filter out certain files, like we will for .java files eventually), and considering that it does not cast a warning or error upon setting the resource directory to the source directory, I would consider it a feature supported by Maven. If we do encounter issues, I won't be shy about filing a bug report with either Maven or any plug-ins that have a problem with this configuration. iBATIS is not the only project to use this sort of setup. Hibernate also has classpath resources that sit directly beside the class files. While some may choose to separate them out for a very good reason, I believe most keep them in the exact same directory structure. So I would bet that this is quite a common practice. Cheers, Clinton On Fri, Aug 8, 2008 at 8:35 AM, Brandon Goodin <[EMAIL PROTECTED]>wrote: > Hey All, > > There was a private discussion regarding the project layout and maven > default conventions. I wanted to put the discussion out in front of > everyone else, purely to get feedback and thoughts. > > At the moment the src directory contains source *and* resources. Maven > has been configured to recognize the src/main/java as the resources > and java directory. The reason for this is that it can get tedious to > move between the java and resources directory rather than just edit a > resource in the same package as the java class. > > The approach of using the java directory as a dual purpose directory > is a departure from Maven's default directory structure. The concern > of departing from that structure is that it may cause additional > difficulties as we make heavier use of maven for coverage and > reporting. If we experience difficulties in the future with Maven > (because we all know it can be temperamental) it may be that we start > having to separate all the resource files out of the java directory in > order to eliminate it as a cause. > > So in summary... > > Current reasons for dual purpose java directory: > * iBATIS 3 will make use of convention configuration and the visual > proximity of resources to java is more visually correct > * All around less directory clutter > > > Concerns and counterpoints to making the java directory dual purpose: > * Most IDEs can merge the resource and java directories in a package view. > * We run the risk of avoiding potential maven headaches with plugins > that don't handle the combined java/resources approach. > > > In the end the question would be... Is it better to have coding > convenience or follow the maven default approach of separating java > and resource? Any experiences and comments are welcome. > > Brandon >