You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by mschipperheyn <m....@gmail.com> on 2012/01/12 14:57:33 UTC
mavem-war-plugin packagingExcludes regex not working
Hi,
I'm trying to exclude javascript source files from war packaging process and
include minified files that end with -min.js
files are named as such
/msa-network/msa-network.js
/msa-network/msa-network-min.js
etc
On regex planet, http://www.regexplanet.com/, this regular expression does
the trick:
(?<!min)\.js
However, in the maven-war-plugin I use this in packagingExcludes and it
doesn't work. The files are still included
<packagingExcludes></packagingExcludes>
I've tried other variations. Nothing works, although I did confirm that
regular expressions work in packagingExcludes.
I'm using maven-war-plugin 2.2-SNAPSHOT
Any suggestions?
Marc
--
View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5139981.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: mavem-war-plugin packagingExcludes regex not working
Posted by mschipperheyn <m....@gmail.com>.
Yeah, I tried it though on regexplanet and it didn't seem to work. Maybe I
copied and pasted wrong.
In any case, thanks.
Marc
--
View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5160331.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: mavem-war-plugin packagingExcludes regex not working
Posted by Guillaume Polet <gu...@gmail.com>.
Isn't that what I told you?
Cheers,
Guillaume
Le 20/01/2012 12:41, mschipperheyn a écrit :
> .*(?<!min)\.js
>
> does the trick. Why didn't I find this sooner?<smiley
> image="anim_confused.gif"/>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5160145.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: mavem-war-plugin packagingExcludes regex not working
Posted by mschipperheyn <m....@gmail.com>.
.*(?<!min)\.js
does the trick. Why didn't I find this sooner? <smiley
image="anim_confused.gif"/>
--
View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5160145.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: mavem-war-plugin packagingExcludes regex not working
Posted by Stephen Connolly <st...@gmail.com>.
find() just means that there is a partial match, but you need a
complete match (i.e. the match() column needs to say yes)
On 16 January 2012 15:49, mschipperheyn <m....@gmail.com> wrote:
> Your suggestion doesn't work. BTW, I do see a Yes in the column find() in the
> example you are referring to, or am I reading this wrong?
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5149055.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: mavem-war-plugin packagingExcludes regex not working
Posted by mschipperheyn <m....@gmail.com>.
Your suggestion doesn't work. BTW, I do see a Yes in the column find() in the
example you are referring to, or am I reading this wrong?
--
View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5149055.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: mavem-war-plugin packagingExcludes regex not working
Posted by Guillaume Polet <gu...@gmail.com>.
Test Results
Regular Expression
Original Expression (?<!min)\.js
as a Java string "(?<!min)\\.js"
Replacement
groupCount() 0
Test Target String matches() replaceFirst() replaceAll()
lookingAt() find() group(0)
1 /msa-network/msa-network-min.js No
/msa-network/msa-network-min.js /msa-network/msa-network-min.js No No
2 /msa-network/msa-network.js No /msa-network/msa-network
/msa-network/msa-network No Yes .js
It obviously does not work... See column matches()
Maybe you meant this: .*?(?<!min)\.js
Cheers,
Guillaume
Le 13/01/2012 13:32, mschipperheyn a écrit :
> Sorry, try it here
> http://www.regexplanet.com/simple/index.html
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5142437.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
Re: mavem-war-plugin packagingExcludes regex not working
Posted by mschipperheyn <m....@gmail.com>.
Sorry, try it here
http://www.regexplanet.com/simple/index.html
--
View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5142437.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: mavem-war-plugin packagingExcludes regex not working
Posted by Dennis Lundberg <de...@apache.org>.
On 2012-01-12 14:57, mschipperheyn wrote:
> Hi,
>
> I'm trying to exclude javascript source files from war packaging process and
> include minified files that end with -min.js
>
> files are named as such
> /msa-network/msa-network.js
> /msa-network/msa-network-min.js
>
> etc
>
> On regex planet, http://www.regexplanet.com/, this regular expression does
> the trick:
> (?<!min)\.js
It doesn't for me. I get "No" in the "matches()" column for both the
above file names.
>
> However, in the maven-war-plugin I use this in packagingExcludes and it
> doesn't work. The files are still included
>
> <packagingExcludes></packagingExcludes>
>
> I've tried other variations. Nothing works, although I did confirm that
> regular expressions work in packagingExcludes.
> I'm using maven-war-plugin 2.2-SNAPSHOT
>
> Any suggestions?
>
> Marc
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/mavem-war-plugin-packagingExcludes-regex-not-working-tp5139981p5139981.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Dennis Lundberg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org