You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gwyn <gw...@gmail.com> on 2006/04/20 18:11:01 UTC

Resources from src tree

Hi,
  I understand that if I want to have resources copied from src/main/java
rather than the default /src/main/resources, then I need to add something
like the following, but what I don't know is where I should be looking if I
want to see if the <includes>...</includes> section is needed of not.  

  Put another way, what resources are copied by default and/or where do I
find this info?

  <build>
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>
    </build>

/Gwyn
--
View this message in context: http://www.nabble.com/Resources-from-src-tree-t1481490.html#a4010475
Sent from the Maven - Users forum at Nabble.com.


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


Re: Resources from src tree

Posted by Thorsten Heit <th...@xtramind.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Gwyn,

>   I understand that if I want to have resources copied from src/main/java
> rather than the default /src/main/resources, then I need to add something
> like the following, but what I don't know is where I should be looking if I
> want to see if the <includes>...</includes> section is needed of not.  

I have a similar problem:
We have a quite huge source tree that contains lots of resources (html
files, properties, XML files etc.), that I'm trying to move to Maven. It
wouldn't make much sense to use the Maven default directory layout in
that special case. Well, it WOULD make sense, but it's a lot of work,
and convince the developers... ;-)

Therefore I'm using the following snippet in my pom.xml:

<resources>
  <resource>
    <directory>src/main/java</directory>
    <filtering>false</filtering>
    <excludes>
      <exclude>**/*.java</exclude>
    </excludes>
  </resource>
</resources>

<testResources>
  <testResource>
    <directory>src/test/java</directory>
    <excludes>
      <exclude>**/*.java</exclude>
    </excludes>
  </testResource>
</testResources>

It works quite fine for me.


>   Put another way, what resources are copied by default and/or where do I
> find this info?

AFAIK everything is copied. If you omit the <excludes> entries above,
Maven copies everything it finds in the given directories, i.e. not only
resources, but also your Java sources which normally is not what you want...


Thorsten
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)

iD8DBQFER7S2QvObkgCcDe0RAi7KAKDB/hbabRsMTG6visdU8PfG+UnJigCffc4x
C+PlFYFwAskGjL9eruGhw7I=
=mKd+
-----END PGP SIGNATURE-----

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