I also think that having a single directory for both "standard" and
"test" resources is pretty unusual and should be discouraged...

a common project layout is usually something like:
src/
  main
  resources
  test
  test-resources

said that, I would like to see the include resource property ON by
default also for the following considerations:

- loosing source resources will break probably more builds than having
resource folders added twice for projects with such unusual directory
layout: if resource directories are missed users will not be aware but
they will probably not be able to run unit tests at all in eclipse.

- also with your suggested fix _there is no way_ in eclipse to handle
a similar situation: you can avoid adding a resource directory twice,
but you will never be able to have files in the same resource
directory that go into two different target directory. For example you
can't have all your *.properties files in src/conf to go to
target/classes and all the test*.properties files go to
target/test-classes. Eclipse simply doesn't allow the same source
directory to be added twice, regardless of filters and target
directoryies.

I would prefer having the properties enabled by default, documenting
this "eclipse limit" in plugin site and leaving to users the choice to
setting the project property off or fixing their directory layout...


fabrizio






On Wed, 20 Oct 2004 06:48:20 +1000, Brett Porter <[EMAIL PROTECTED]> wrote:
> There is no way the test resources should be in src/conf. It should be
> discouraged (although not broken :)
> 
> That said, I think the current fix is correct.
> 
> - Brett
> 
> 
> 
> Eric Pugh wrote:
> 
> >Hi all,
> >
> >A while ago some patches where made that allowed the <resources/> elements
> >to be added to the Eclipse .classpath.  This looked good, and I committed
> >it.  However, as I have gone on with more testing, I think this needs to be
> >reworked.
> >
> >What happens is right now the resources for the regular java files and in
> >the <unitTest> section are duplicated...  This can lead to a situation where
> >you import the same path twice.  For example, in the below (trimmed)
> >section, I want to copy some resources always, and a log4j.properties when
> >running unit tests:
> >
> ><build>
> >        <unitTest>
> >            <resources>
> >                <resource>
> >                    <directory>src/conf</directory>
> >                    <targetPath>/</targetPath>
> >                    <includes>
> >                        <include>test.avalonconf.xml</include>
> >                    </includes>
> >                    <filtering>false</filtering>
> >                </resource>
> >                <resource>
> >                    <includes>
> >                        <include>log4j.properties</include>
> >                    </includes>
> >                    <filtering>false</filtering>
> >                </resource>
> >            </resources>
> >        </unitTest>
> >        <resources>
> >            <resource>
> >                <directory>src/conf</directory>
> >                <targetPath>/</targetPath>
> >                <includes>
> >                    <include>hibernate.hbm.xml</include>
> >                    <include>ehcache.xml</include>
> >                </includes>
> >                <filtering>false</filtering>
> >            </resource>
> >        </resources>
> >    </build>
> >
> >However, because they both go from src/conf to /, this causes two records to
> >be created in Eclipse.  I think, what needs to done is that a map of all the
> >possible sources needs to be made, and then we aggreagate together all the
> >changes.  However, this is a pretty big change, and I've not got the time
> >for it right now, but I'll be happy to help.
> >
> >Also, we where not properly dealing with includes and excludes either..  I
> >added that.
> >
> >Because this change can break things, I've added an extra check.  If
> >maven.eclipse.addResources=true in your project.properties, then the
> >existing logic will occur.  By default this is turned off so we don't start
> >breaking everybodies builds.
> >
> >Eric Pugh
> >
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to