On Fri, 6 May 2005, Brett Porter wrote:
> On 5/6/05, Hugo Palma <[EMAIL PROTECTED]> wrote:
> > I'm trying to reference a resource like i did in Maven 1 using the
> > resource element like this:
> >
> > <resource>
> > <directory>src/test/otherResources</directory>
> > <includes>
> > <include>*.xml</include>
> > </includes>
> > </resource>
>
> nested inside <resources /> inside <build/> this should work.
>
> > But it seems that in Maven 2 the only child element <resource> accepts
> > is the <targetPath> element.
>
> Where did you get that information from... is there an error in the
> docs? targetPath is the only one not allowed in m2 :)
Not according to Resource.java in maven-model :)
In addition to Brett, here's some more information, extracted from the
sources:
Resource (<resource/>) has an optional child <targetPath/> element;
Resource extends FileSet which adds the <directory/> element;
FileSet extends PatternSet which adds <includes/> and <excludes/> tags;
The includes and excludes are both List's, and are built by nested
<include/> and <exclude/> tags respectively. Pretty much maven1 style.
so the complete set will be:
<project>
...
<build>
...
<resources>
<resource>
<directory>src/main/resources</directory>
<targetPath>whatever/</targetPath>
<includes>
<include>*.xcfg</include>
</includes>
<excludes>
<exclude>*.example</exclude>
</excludes>
</resource>
</resources>
...
</build>
...
</project>
This is not clear in
http://maven.apache.org/maven2/project-descriptor.html (could use some
indenting and '/' in the ending tags for clarity, there).
--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]