You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Udaybhaskar Sarma Seetamraju <sa...@verizon.net> on 2007/02/26 19:20:25 UTC

(important) Copying files from fixed external folder into WAR's /WEB-INF/.

Hi there,

(mailing-list archive does not have a search facility.  Google failed to
show much for [site: mail-archives.apache.org struts])

With many projects already painfully migrated to maven, its a royal pain
to ---copy--- the struts TLDs and DTDs to each developer's folder, for
each of the projects.
Epecially, since we have so successfully been upgrading to newer
versions of struts using Ant's <fileSet> in such a simple, --STABLE--
and effective manner.

========================
The javaworld article on "The Maven 2 POM demystified" mentioned the use of

|<resource>
        <targetPath>/META-INF/plexus/</targetPath>|

But that didn't work. I had to use a complex workaround that *!*!* may
not work for too long *!*!*.

   <resource>
        <!-- DOES NOT WORK : targetPath>./WEB-INF/.</targetPath -->
        <!-- DOES NOT WORK : targetPath>WEB-INF</targetPath -->

        <!-- Make sure the value INSIDE targetPath below is IDENTICAL to
${build.finalName} specified above -->
       
<targetPath>../${TargetName}-${artifactId}-${version}/WEB-INF</targetPath>

why would ./Fldr  and  ../Fldr  for targetPath, behave in different ways?

I am hoping that someone will point me towards a simple and
maven-upgrade-safe way to include struts DTDs and TLDs.
This stable approach is important for us, because that approach is ALSO
DESPERATELY NEEDED for the other DTDs and XSDs that are required under
/WEB-INF by the 3rd-party JARs we use.

========================
Also, there was mention in a web site about a POM capability like :
        </dependency>
            <scope>tld</scope>
Does this exist, and if so, how to use it, and how to create/get the
appropriate JAR to support this?

Summary of Issue:
============
Copy files from a fixed external path, into specific paths rooted at
/WEB-INF inside the WAR file.
The Path within WAR starting at /WEB-INF/classes is no good.  Not in our
control.
Re: struts, we think its easy to keep the <dependency> version of struts
in pom.xml to match the FIXED read-only external folder containing the
DTDs and TLDs.

        Maven version: 2.0.4
        j2sdk1.4.2_05
        debian Testing Etch

In case, there are people like me, I like a long-lasting solution,
especially as I am getting older and cannot afford the luxury of
revisiting the same problems for each new upgrade.

[end]


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


Re: (important) Copying files from fixed external folder into WAR's /WEB-INF/.

Posted by Craig McClanahan <cr...@apache.org>.
On 2/26/07, Udaybhaskar Sarma Seetamraju <sa...@verizon.net> wrote:
> Hi there,
>
> (mailing-list archive does not have a search facility.  Google failed to
> show much for [site: mail-archives.apache.org struts])
>
> With many projects already painfully migrated to maven, its a royal pain
> to ---copy--- the struts TLDs and DTDs to each developer's folder, for
> each of the projects.
> Epecially, since we have so successfully been upgrading to newer
> versions of struts using Ant's <fileSet> in such a simple, --STABLE--
> and effective manner.

While I agree that a general solution to this problem might be useful,
I've got a question about your specific use case ... why are you
copying the Struts TLDs and DTDs separately?  The runtime environment
does not need them (unless your servlet container is totally broken
about loading resources from inside a jar file), so the only reason I
can think that you might want the files separately is for an IDE.
Even there, most IDEs have a way to register things external to the
project that is worth looking at.

As to the general resource copying problem, one thing you can actually
do is run Ant scripts in a Maven build, using the antrun plugin.  It
would be pretty straightforward to use this in the resource-copying
phase to execute your own script to copy whatever files you need, to
wherever you need, without waiting for Maven to provide a plugin that
behaves the way you require.

Craig


>
> ========================
> The javaworld article on "The Maven 2 POM demystified" mentioned the use of
>
> |<resource>
>         <targetPath>/META-INF/plexus/</targetPath>|
>
> But that didn't work. I had to use a complex workaround that *!*!* may
> not work for too long *!*!*.
>
>    <resource>
>         <!-- DOES NOT WORK : targetPath>./WEB-INF/.</targetPath -->
>         <!-- DOES NOT WORK : targetPath>WEB-INF</targetPath -->
>
>         <!-- Make sure the value INSIDE targetPath below is IDENTICAL to
> ${build.finalName} specified above -->
>
> <targetPath>../${TargetName}-${artifactId}-${version}/WEB-INF</targetPath>
>
> why would ./Fldr  and  ../Fldr  for targetPath, behave in different ways?
>
> I am hoping that someone will point me towards a simple and
> maven-upgrade-safe way to include struts DTDs and TLDs.
> This stable approach is important for us, because that approach is ALSO
> DESPERATELY NEEDED for the other DTDs and XSDs that are required under
> /WEB-INF by the 3rd-party JARs we use.
>
> ========================
> Also, there was mention in a web site about a POM capability like :
>         </dependency>
>             <scope>tld</scope>
> Does this exist, and if so, how to use it, and how to create/get the
> appropriate JAR to support this?
>
> Summary of Issue:
> ============
> Copy files from a fixed external path, into specific paths rooted at
> /WEB-INF inside the WAR file.
> The Path within WAR starting at /WEB-INF/classes is no good.  Not in our
> control.
> Re: struts, we think its easy to keep the <dependency> version of struts
> in pom.xml to match the FIXED read-only external folder containing the
> DTDs and TLDs.
>
>         Maven version: 2.0.4
>         j2sdk1.4.2_05
>         debian Testing Etch
>
> In case, there are people like me, I like a long-lasting solution,
> especially as I am getting older and cannot afford the luxury of
> revisiting the same problems for each new upgrade.
>
> [end]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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