You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Laurent Martelli <ma...@gmail.com> on 2010/07/24 16:12:03 UTC

Custom resource filter

Hi there !

I'm working on a webapp project where PNG images are huge because they
contain many layers. The layers are useless when running the webapp, but we
would like to keep them in our repository because that's the native format
for the guy editing them.

We all know that Maven can substitute properties in text resources, but how
can we filter those binary PNG images through pngcrush or a similar program
in order to create a war that is as small as possible ?

It looks like plugin configurations are not enough to do this, so I'm
getting ready to create a custom plugin. But I don't know what would be the
best way to achieve our goal.

Thanks in advance for you asnwers !

Re: Custom resource filter

Posted by Ron Wheeler <rw...@artifact-software.com>.
  On 24/07/2010 12:36 PM, Laurent Martelli wrote:
> Yes, but since it is only able to handle one file at a time, I'll probably
> have to create a plugin in order to run it for each image.
>
> Laurent
>
> 2010/7/24 Kalle Korhonen<ka...@gmail.com>
>
>> Unless there's a Java version of pngcrush, I wouldn't worry about
>> running it as a plugin. You could just configure exec plugin
>> (http://mojo.codehaus.org/exec-maven-plugin/) to run pngcrush.
>>
>> Kalle
>>
>>
>> On Sat, Jul 24, 2010 at 7:12 AM, Laurent Martelli
>> <ma...@gmail.com>  wrote:
>>> Hi there !
>>>
>>> I'm working on a webapp project where PNG images are huge because they
>>> contain many layers. The layers are useless when running the webapp, but
>> we
>>> would like to keep them in our repository because that's the native
>> format
>>> for the guy editing them.
>>>
>>> We all know that Maven can substitute properties in text resources, but
>> how
>>> can we filter those binary PNG images through pngcrush or a similar
>> program
>>> in order to create a war that is as small as possible ?
>>>
>>> It looks like plugin configurations are not enough to do this, so I'm
>>> getting ready to create a custom plugin. But I don't know what would be
>> the
>>> best way to achieve our goal.
>>>
>>> Thanks in advance for you asnwers !
>>>
>> ---------------------------------------------------------------------
>> 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


Re: Custom resource filter

Posted by Laurent Martelli <ma...@gmail.com>.
Hi all,

Sorry for the french private reply on the list :-/

Cheers,
Laurent

2010/9/23 Laurent Martelli <ma...@gmail.com>

> Salut,
>
> Je n'ai pas eu le temps de regarder ton patch plus tôt.
>
> J'ai eu un peu de mal à l'appliquer sur trunk, en particulier parce qu'il
> n'y a pas de répertoire src/it/user-filters. Mais j'ai pu appliquer ça sur
> src/it/MRESOURCES-78
>
> Quand j'essaie de lancer les tests avec "mvn -Prun-its integration-test",
> le test MRESOURCES-78 plante (cf fichier attaché). Je n'ai encore jamais
> fait de plugin Maven, donc l'erreur est pour moi complètement obscure, et
> mes recherches sur Google ne m'ont pas éclairé. Donc si tu avait par hasard
> une piste, je suis preneur.
>
> Cordialement,
> Laurent
>
>

Re: Custom resource filter

Posted by Laurent Martelli <ma...@gmail.com>.
Salut,

Je n'ai pas eu le temps de regarder ton patch plus t�t.

J'ai eu un peu de mal � l'appliquer sur trunk, en particulier parce qu'il
n'y a pas de r�pertoire src/it/user-filters. Mais j'ai pu appliquer �a sur
src/it/MRESOURCES-78

Quand j'essaie de lancer les tests avec "mvn -Prun-its integration-test", le
test MRESOURCES-78 plante (cf fichier attach�). Je n'ai encore jamais fait
de plugin Maven, donc l'erreur est pour moi compl�tement obscure, et mes
recherches sur Google ne m'ont pas �clair�. Donc si tu avait par hasard une
piste, je suis preneur.

Cordialement,
Laurent


2010/7/27 Olivier Lamy <ol...@apache.org>

> So I have attached a patch to the issue.
> Let me know if it's fine with your use case.
> Basically you have to implements an existing interface used for the
> current filtering stuff. (have a look at the it test included in the
> patch).
> If it's fine I will push this
>
> 2010/7/26 Laurent Martelli <ma...@gmail.com>:
> > OK thanks, the proposed interface is really just a proposition. You
> probably
> > know Maven better than I do to actually do it right.
> >
> > Cheers,
> > Laurent
> >
> > 2010/7/26 Olivier Lamy <ol...@apache.org>
> >
> >> Ok Thanks.
> >> I will review this later today (and probably propose some other
> >> interface to implements).
> >>
> >> 2010/7/26 Laurent Martelli <ma...@gmail.com>:
> >> > OK, I've created an issue on Jira :
> >> > http://jira.codehaus.org/browse/MRESOURCES-128.
> >> >
> >> > I've created some Java classes to do the job of filtering PNG chunks
> (PNG
> >> > does not actually contain layers, but allow proprietary chunks, which
> is
> >> > what the software used to edit them does) so I wouldn't mind having a
> >> > solution that allows the use of Java filters.
> >> >
> >> > Cheers,
> >> > Laurent
> >> >
> >> > 2010/7/24 Olivier Lamy <ol...@apache.org>
> >> >
> >> >> Hi,
> >> >> So it can be a nice feature to implements in the resources plugin
> >> >> ("filters" need to be plexus component).
> >> >>
> >> >> Can you load an issue in jira ?
> >> >> I will have a look.
> >> >>
> >> >>
> >> >
> >>
> >>
> >>
> >> --
> >> Olivier
> >> http://twitter.com/olamy
> >> http://fr.linkedin.com/in/olamy
> >> http://www.viadeo.com/fr/profile/olivier.lamy7
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
>
>
> --
> Olivier
> http://twitter.com/olamy
> http://fr.linkedin.com/in/olamy
> http://www.viadeo.com/fr/profile/olivier.lamy7
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Custom resource filter

Posted by Olivier Lamy <ol...@apache.org>.
So I have attached a patch to the issue.
Let me know if it's fine with your use case.
Basically you have to implements an existing interface used for the
current filtering stuff. (have a look at the it test included in the
patch).
If it's fine I will push this

2010/7/26 Laurent Martelli <ma...@gmail.com>:
> OK thanks, the proposed interface is really just a proposition. You probably
> know Maven better than I do to actually do it right.
>
> Cheers,
> Laurent
>
> 2010/7/26 Olivier Lamy <ol...@apache.org>
>
>> Ok Thanks.
>> I will review this later today (and probably propose some other
>> interface to implements).
>>
>> 2010/7/26 Laurent Martelli <ma...@gmail.com>:
>> > OK, I've created an issue on Jira :
>> > http://jira.codehaus.org/browse/MRESOURCES-128.
>> >
>> > I've created some Java classes to do the job of filtering PNG chunks (PNG
>> > does not actually contain layers, but allow proprietary chunks, which is
>> > what the software used to edit them does) so I wouldn't mind having a
>> > solution that allows the use of Java filters.
>> >
>> > Cheers,
>> > Laurent
>> >
>> > 2010/7/24 Olivier Lamy <ol...@apache.org>
>> >
>> >> Hi,
>> >> So it can be a nice feature to implements in the resources plugin
>> >> ("filters" need to be plexus component).
>> >>
>> >> Can you load an issue in jira ?
>> >> I will have a look.
>> >>
>> >>
>> >
>>
>>
>>
>> --
>> Olivier
>> http://twitter.com/olamy
>> http://fr.linkedin.com/in/olamy
>> http://www.viadeo.com/fr/profile/olivier.lamy7
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>



-- 
Olivier
http://twitter.com/olamy
http://fr.linkedin.com/in/olamy
http://www.viadeo.com/fr/profile/olivier.lamy7

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


Re: Custom resource filter

Posted by Laurent Martelli <ma...@gmail.com>.
OK thanks, the proposed interface is really just a proposition. You probably
know Maven better than I do to actually do it right.

Cheers,
Laurent

2010/7/26 Olivier Lamy <ol...@apache.org>

> Ok Thanks.
> I will review this later today (and probably propose some other
> interface to implements).
>
> 2010/7/26 Laurent Martelli <ma...@gmail.com>:
> > OK, I've created an issue on Jira :
> > http://jira.codehaus.org/browse/MRESOURCES-128.
> >
> > I've created some Java classes to do the job of filtering PNG chunks (PNG
> > does not actually contain layers, but allow proprietary chunks, which is
> > what the software used to edit them does) so I wouldn't mind having a
> > solution that allows the use of Java filters.
> >
> > Cheers,
> > Laurent
> >
> > 2010/7/24 Olivier Lamy <ol...@apache.org>
> >
> >> Hi,
> >> So it can be a nice feature to implements in the resources plugin
> >> ("filters" need to be plexus component).
> >>
> >> Can you load an issue in jira ?
> >> I will have a look.
> >>
> >>
> >
>
>
>
> --
> Olivier
> http://twitter.com/olamy
> http://fr.linkedin.com/in/olamy
> http://www.viadeo.com/fr/profile/olivier.lamy7
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Custom resource filter

Posted by Olivier Lamy <ol...@apache.org>.
Ok Thanks.
I will review this later today (and probably propose some other
interface to implements).

2010/7/26 Laurent Martelli <ma...@gmail.com>:
> OK, I've created an issue on Jira :
> http://jira.codehaus.org/browse/MRESOURCES-128.
>
> I've created some Java classes to do the job of filtering PNG chunks (PNG
> does not actually contain layers, but allow proprietary chunks, which is
> what the software used to edit them does) so I wouldn't mind having a
> solution that allows the use of Java filters.
>
> Cheers,
> Laurent
>
> 2010/7/24 Olivier Lamy <ol...@apache.org>
>
>> Hi,
>> So it can be a nice feature to implements in the resources plugin
>> ("filters" need to be plexus component).
>>
>> Can you load an issue in jira ?
>> I will have a look.
>>
>>
>



-- 
Olivier
http://twitter.com/olamy
http://fr.linkedin.com/in/olamy
http://www.viadeo.com/fr/profile/olivier.lamy7

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


Re: Custom resource filter

Posted by Laurent Martelli <ma...@gmail.com>.
OK, I've created an issue on Jira :
http://jira.codehaus.org/browse/MRESOURCES-128.

I've created some Java classes to do the job of filtering PNG chunks (PNG
does not actually contain layers, but allow proprietary chunks, which is
what the software used to edit them does) so I wouldn't mind having a
solution that allows the use of Java filters.

Cheers,
Laurent

2010/7/24 Olivier Lamy <ol...@apache.org>

> Hi,
> So it can be a nice feature to implements in the resources plugin
> ("filters" need to be plexus component).
>
> Can you load an issue in jira ?
> I will have a look.
>
>

Re: Custom resource filter

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
So it can be a nice feature to implements in the resources plugin
("filters" need to be plexus component).

Can you load an issue in jira ?
I will have a look.

2010/7/24 Laurent Martelli <ma...@gmail.com>:
> Yes, but since it is only able to handle one file at a time, I'll probably
> have to create a plugin in order to run it for each image.
>
> Laurent
>
> 2010/7/24 Kalle Korhonen <ka...@gmail.com>
>
>> Unless there's a Java version of pngcrush, I wouldn't worry about
>> running it as a plugin. You could just configure exec plugin
>> (http://mojo.codehaus.org/exec-maven-plugin/) to run pngcrush.
>>
>> Kalle
>>
>>
>> On Sat, Jul 24, 2010 at 7:12 AM, Laurent Martelli
>> <ma...@gmail.com> wrote:
>> > Hi there !
>> >
>> > I'm working on a webapp project where PNG images are huge because they
>> > contain many layers. The layers are useless when running the webapp, but
>> we
>> > would like to keep them in our repository because that's the native
>> format
>> > for the guy editing them.
>> >
>> > We all know that Maven can substitute properties in text resources, but
>> how
>> > can we filter those binary PNG images through pngcrush or a similar
>> program
>> > in order to create a war that is as small as possible ?
>> >
>> > It looks like plugin configurations are not enough to do this, so I'm
>> > getting ready to create a custom plugin. But I don't know what would be
>> the
>> > best way to achieve our goal.
>> >
>> > Thanks in advance for you asnwers !
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>



-- 
Olivier
http://twitter.com/olamy
http://fr.linkedin.com/in/olamy
http://www.viadeo.com/fr/profile/olivier.lamy7

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


Re: Custom resource filter

Posted by Laurent Martelli <ma...@gmail.com>.
Yes, but since it is only able to handle one file at a time, I'll probably
have to create a plugin in order to run it for each image.

Laurent

2010/7/24 Kalle Korhonen <ka...@gmail.com>

> Unless there's a Java version of pngcrush, I wouldn't worry about
> running it as a plugin. You could just configure exec plugin
> (http://mojo.codehaus.org/exec-maven-plugin/) to run pngcrush.
>
> Kalle
>
>
> On Sat, Jul 24, 2010 at 7:12 AM, Laurent Martelli
> <ma...@gmail.com> wrote:
> > Hi there !
> >
> > I'm working on a webapp project where PNG images are huge because they
> > contain many layers. The layers are useless when running the webapp, but
> we
> > would like to keep them in our repository because that's the native
> format
> > for the guy editing them.
> >
> > We all know that Maven can substitute properties in text resources, but
> how
> > can we filter those binary PNG images through pngcrush or a similar
> program
> > in order to create a war that is as small as possible ?
> >
> > It looks like plugin configurations are not enough to do this, so I'm
> > getting ready to create a custom plugin. But I don't know what would be
> the
> > best way to achieve our goal.
> >
> > Thanks in advance for you asnwers !
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Custom resource filter

Posted by Kalle Korhonen <ka...@gmail.com>.
Unless there's a Java version of pngcrush, I wouldn't worry about
running it as a plugin. You could just configure exec plugin
(http://mojo.codehaus.org/exec-maven-plugin/) to run pngcrush.

Kalle


On Sat, Jul 24, 2010 at 7:12 AM, Laurent Martelli
<ma...@gmail.com> wrote:
> Hi there !
>
> I'm working on a webapp project where PNG images are huge because they
> contain many layers. The layers are useless when running the webapp, but we
> would like to keep them in our repository because that's the native format
> for the guy editing them.
>
> We all know that Maven can substitute properties in text resources, but how
> can we filter those binary PNG images through pngcrush or a similar program
> in order to create a war that is as small as possible ?
>
> It looks like plugin configurations are not enough to do this, so I'm
> getting ready to create a custom plugin. But I don't know what would be the
> best way to achieve our goal.
>
> Thanks in advance for you asnwers !
>

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