You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by John Fallows <jo...@gmail.com> on 2005/07/19 03:09:17 UTC

[m2] slow filtered resources

If there are a lot of resources in a JAR, say images, and one text
file that requires filtering, then filtering is still enabled with a
global switch on the maven-reources-plugin, right?

This seems to be causing a significant slow down in file copying. 
Perhaps all files are being put through the filtering process, even
non-text files?

Although my specific use case relates to binary vs. text files, I
think this is a more general issue of filtered vs. non-filtered
resources.

Is there a way to restrict which resource files are filtered?

The general directory layout for m2 seems to prefer to separate at
top-level directories (eg. java vs. resources, rather than resource
patterns inside java).

Therefore, would it be appropriate to have separate java/, resources/
and filtered-resources/ directories, where filtering would only be
enabled for files inside filtered resources?

Then the rule would be:
  1. if it is Java source, put it in java/
  2. if it is a static resource, put it in resources/
  3. if it is a filtered resource, put it in filtered-resources/

Kind Regards,
John Fallows.

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


Re: [m2] slow filtered resources

Posted by John Fallows <jo...@gmail.com>.
On 7/19/05, Kenney Westerhof <fo...@neonics.com> wrote:
> On Tue, 19 Jul 2005, Brett Porter wrote:
> 
> Filtering is indeed off by default.
> 
> My 2 cents:
> 
> I've been pondering how to exclude resources from filtering. All that I
> could think of was to apply some includes/excludes mechanism (that would
> apply to all <resources/> defined), or to add the <filtering/> tag to a
> <resource> tag to allow resources to be split up into filtering/non
> filtering ones. This would require a POM change..
> 
> But the src/filtered-resources solution seems really great to me!
> Cons: you lose oversight (no more single directory structure for all
> resources)

Agreed.

To some degree, however, this has already happened as a result of
splitting Java source from JAR resources.  For example, if there is
Java code in src/java/.../MyObject.java of the form:

MyObject.class.getResource("resource.txt");

then we have to ensure that resource.txt resides at the correct
location in src/resources, rather than just storing it next to
MyObject.java.

What was the original rationale for splitting these into separate
directories, rather than having a standard ".java" exclusion filter
for resources in the src/java/ directory?

Presumably, the same rationale applies here to the splitting of
resources and filtered resources.

> Pros: file location specifies filtering rather than complex
> include/exclude mechanisms in the pom.

Yes - although the name could use some work. :-)

perhaps src/resources-filtered to make it slightly more discoverable?

Kind Regards,
John Fallows.

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


Re: [m2] slow filtered resources

Posted by Kenney Westerhof <fo...@neonics.com>.
On Tue, 19 Jul 2005, Brett Porter wrote:

Filtering is indeed off by default.

My 2 cents:

I've been pondering how to exclude resources from filtering. All that I
could think of was to apply some includes/excludes mechanism (that would
apply to all <resources/> defined), or to add the <filtering/> tag to a
<resource> tag to allow resources to be split up into filtering/non
filtering ones. This would require a POM change..

But the src/filtered-resources solution seems really great to me!
Cons: you lose oversight (no more single directory structure for all
resources)
Pros: file location specifies filtering rather than complex
include/exclude mechanisms in the pom.

-- Kenney

> I think filtering should be off by default (not sure if this is the
> case), and you should introduce your own resources directories with
> patterns and <filtering> attributes if you want filtering, though the
> below solution is also a good one.
>
> I'd like to see what others think.
>
> - Brett
>
> On 7/19/05, John Fallows <jo...@gmail.com> wrote:
> > If there are a lot of resources in a JAR, say images, and one text
> > file that requires filtering, then filtering is still enabled with a
> > global switch on the maven-reources-plugin, right?
> >
> > This seems to be causing a significant slow down in file copying.
> > Perhaps all files are being put through the filtering process, even
> > non-text files?
> >
> > Although my specific use case relates to binary vs. text files, I
> > think this is a more general issue of filtered vs. non-filtered
> > resources.
> >
> > Is there a way to restrict which resource files are filtered?
> >
> > The general directory layout for m2 seems to prefer to separate at
> > top-level directories (eg. java vs. resources, rather than resource
> > patterns inside java).
> >
> > Therefore, would it be appropriate to have separate java/, resources/
> > and filtered-resources/ directories, where filtering would only be
> > enabled for files inside filtered resources?
> >
> > Then the rule would be:
> >   1. if it is Java source, put it in java/
> >   2. if it is a static resource, put it in resources/
> >   3. if it is a filtered resource, put it in filtered-resources/
> >
> > Kind Regards,
> > John Fallows.
> >
> > ---------------------------------------------------------------------
> > 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
>
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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


Re: [m2] slow filtered resources

Posted by Brett Porter <br...@gmail.com>.
I think filtering should be off by default (not sure if this is the
case), and you should introduce your own resources directories with
patterns and <filtering> attributes if you want filtering, though the
below solution is also a good one.

I'd like to see what others think.

- Brett

On 7/19/05, John Fallows <jo...@gmail.com> wrote:
> If there are a lot of resources in a JAR, say images, and one text
> file that requires filtering, then filtering is still enabled with a
> global switch on the maven-reources-plugin, right?
> 
> This seems to be causing a significant slow down in file copying.
> Perhaps all files are being put through the filtering process, even
> non-text files?
> 
> Although my specific use case relates to binary vs. text files, I
> think this is a more general issue of filtered vs. non-filtered
> resources.
> 
> Is there a way to restrict which resource files are filtered?
> 
> The general directory layout for m2 seems to prefer to separate at
> top-level directories (eg. java vs. resources, rather than resource
> patterns inside java).
> 
> Therefore, would it be appropriate to have separate java/, resources/
> and filtered-resources/ directories, where filtering would only be
> enabled for files inside filtered resources?
> 
> Then the rule would be:
>   1. if it is Java source, put it in java/
>   2. if it is a static resource, put it in resources/
>   3. if it is a filtered resource, put it in filtered-resources/
> 
> Kind Regards,
> John Fallows.
> 
> ---------------------------------------------------------------------
> 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