> -----Original Message-----
> From: Wendy Smoak [mailto:[EMAIL PROTECTED]
> Sent: 17 October 2005 15:01
> To: Maven Users List
> Subject: Re: Digester File DTD and Maven
> 
> 
> From: "Pilgrim, Peter" <[EMAIL PROTECTED]>
> 
> > How do I tell maven to copy the DTD file under 
> ``com\csfb\goldeneye\app''
> > in the target folder ``<project>\target\classes'' ?
> >
> > So what I need is 
> > ``<project\target\classes\com\csfb\goldeneye\app\special.dtd''
> > and then the whole thing should be jared up.
> 
>        <resource>
>             <directory>src/conf</directory>
>             <targetPath>org/apache/shale/clay/config</targetPath>
>             <includes>
>                <include>*.dtd</include>
>             </includes>
>          </resource>
> 
> Adjust as necessary. :)  (You can leave out the targetPath in 
> your case.) 
> That's from m2 but the general idea hasn't changed.
> 

Ok suppose I hafe a file like

        src/conf/com/csfb/xrocket/trading/config.dtd

I would expect this to be copied to the jar.

And the unit test classpath will pick up the DTD file.

The reason I ask is because I am trying to debug a DTD lookup failure.
The digester fails to parse a config file I have, where as pre-Maven
it did. 

Typically you do this will Digester to register DTDs. 
    final static protected String registrations[] = {
        "-//CSFB.com XRocket//DTD X Rocket TradeCapture Configuration//EN",
        "/com/csfb/xrocket/trading/config-1.0.dtd",
    };

        Digester digester = new Digester();
        digester.setValidating( isValidating() );
        digester.setValidating( isDebug() );
        digester.setNamespaceAware( isNamespaceAware() );
        
        try {
            for (int i = 0; i < registrations.length; i += 2) {
                URL url = this.getClass().getResource(registrations[i+1]);
                if (url != null) {
                    digester.register(registrations[i], url.toString());
                }
            }
        }
        catch (Exception e) {
            throw new InfrastructureException( "Boo hoo!!!", e );
        }



--
Peter Pilgrim :: J2EE Software Development
Operations/IT - Credit Suisse First Boston, 
Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497
 

==============================================================================
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.csfb.com/legal_terms/disclaimer_external_email.shtml

==============================================================================


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

Reply via email to