You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by rcbandit <pe...@gmail.com> on 2012/04/25 21:30:35 UTC

How to remove comments with Maven

Hi,
  I have a WAR package with JSF pages, JavaScript files, CSS files and Maven
POM file. I'm interested can I configure Maven to delete all comments into
the source code files before packaging the files?

Best Wishes
Peter

--
View this message in context: http://maven.40175.n5.nabble.com/How-to-remove-comments-with-Maven-tp5665768p5665768.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: How to remove comments with Maven

Posted by Manfred Moser <ma...@mosabuam.com>.
I think I would just create another module that depends on the original.
It could download the sources, strip them and them use them as source for
the current project..

manfred

On Wed, April 25, 2012 2:25 pm, Jörg Hohwiller wrote:
> Hi Manfred,
>
> great hints on this.
>
> However Peter may not want to do this on his files in src/main/
> but on copies of these in target/...
>
> Copying and invoking the stripping of comments on the copies is no
> problem (antrun plugin) but how to make the maven standard plugins to
> build the
> *-sources.jar from the modified copies?
>
> http://maven.apache.org/plugins/maven-source-plugin/jar-mojo.html
>
>
> Regards
>   Jörg
>
>> For Java use proguard either directly or via the ant task or the
>> proguard
>> maven plugin.
>>
>> For javascript and css used related compression tools with potentially
>> the
>> exec plugin or some other invocation of them natively. There is probably
>> something like that already part of the javascript plugin actually.
>>
>> manfred
>>
>> On Wed, April 25, 2012 12:30 pm, rcbandit wrote:
>>> Hi,
>>>   I have a WAR package with JSF pages, JavaScript files, CSS files and
>>> Maven
>>> POM file. I'm interested can I configure Maven to delete all comments
>>> into
>>> the source code files before packaging the files?
>>>
>>> Best Wishes
>>> Peter
>>>
>>> --
>>> View this message in context:
>>> http://maven.40175.n5.nabble.com/How-to-remove-comments-with-Maven-tp5665768p5665768.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
>>
>
>
> ---------------------------------------------------------------------
> 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: How to remove comments with Maven

Posted by Jörg Hohwiller <jo...@j-hohwiller.de>.
Hi Manfred,

great hints on this.

However Peter may not want to do this on his files in src/main/
but on copies of these in target/...

Copying and invoking the stripping of comments on the copies is no
problem (antrun plugin) but how to make the maven standard plugins to build the
*-sources.jar from the modified copies?

http://maven.apache.org/plugins/maven-source-plugin/jar-mojo.html


Regards
  Jörg

> For Java use proguard either directly or via the ant task or the proguard
> maven plugin.
> 
> For javascript and css used related compression tools with potentially the
> exec plugin or some other invocation of them natively. There is probably
> something like that already part of the javascript plugin actually.
> 
> manfred
> 
> On Wed, April 25, 2012 12:30 pm, rcbandit wrote:
>> Hi,
>>   I have a WAR package with JSF pages, JavaScript files, CSS files and
>> Maven
>> POM file. I'm interested can I configure Maven to delete all comments into
>> the source code files before packaging the files?
>>
>> Best Wishes
>> Peter
>>
>> --
>> View this message in context:
>> http://maven.40175.n5.nabble.com/How-to-remove-comments-with-Maven-tp5665768p5665768.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
> 


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


Re: How to remove comments with Maven

Posted by Manfred Moser <ma...@mosabuam.com>.
For Java use proguard either directly or via the ant task or the proguard
maven plugin.

For javascript and css used related compression tools with potentially the
exec plugin or some other invocation of them natively. There is probably
something like that already part of the javascript plugin actually.

manfred

On Wed, April 25, 2012 12:30 pm, rcbandit wrote:
> Hi,
>   I have a WAR package with JSF pages, JavaScript files, CSS files and
> Maven
> POM file. I'm interested can I configure Maven to delete all comments into
> the source code files before packaging the files?
>
> Best Wishes
> Peter
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/How-to-remove-comments-with-Maven-tp5665768p5665768.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: How to remove comments with Maven

Posted by Wayne Fay <wa...@gmail.com>.
> Here you are:
> http://onlinefundb.com/forum/index.php?topic=2531.0

Chapter 11 of the book Maven: The Definitive Guide will help you turn
this Java code into a Maven plugin:
http://books.sonatype.com/books/mvnref-book/reference/writing-plugins.html

Also refer to this documentation:
http://maven.apache.org/plugin-developers/index.html
http://maven.apache.org/guides/introduction/introduction-to-plugins.html
http://maven.apache.org/guides/plugin/guide-java-plugin-development.html

Wayne

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


Re: How to remove comments with Maven

Posted by rcbandit <pe...@gmail.com>.
Here you are:
http://onlinefundb.com/forum/index.php?topic=2531.0

--
View this message in context: http://maven.40175.n5.nabble.com/How-to-remove-comments-with-Maven-tp5665768p5665845.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: How to remove comments with Maven

Posted by Wayne Fay <wa...@gmail.com>.
>   I have a WAR package with JSF pages, JavaScript files, CSS files and
> Maven
> POM file. I'm interested can I configure Maven to delete all comments into
> the source code files before packaging the files?

If you can point me at a tool (ideally written in Java, but this is
not required) which can strip comments from source code, then I can
tell you how to turn it into a Maven plugin. Does Tidy have this
functionality for HTML?

I've never heard of such a tool myself. I'm not sure why you would
want to do this either. Most people just obfuscate things.

Wayne

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