You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Antonio Petrelli <an...@gmail.com> on 2008/04/18 09:06:09 UTC

[S2] Adding configuration for Maven License Plugin

Hi all
Since the license headers are an annoying problem, I wish to add the
Maven License plugin:
http://code.google.com/p/maven-license-plugin/
This plugin can *add* license headers on top of files *automatically*

Thoughts?

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2] Adding configuration for Maven License Plugin

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/18, Antonio Petrelli <an...@gmail.com>:
> Hi all
>  Since the license headers are an annoying problem, I wish to add the
>  Maven License plugin:
>  http://code.google.com/p/maven-license-plugin/
>  This plugin can *add* license headers on top of files *automatically*

Sorry, I changed my mind... temporarily.
The headers are not added "our" way, so it needs some hacking.
Currently I am playing with the plugin to get the correct headers.
Once I find a correct way, I will post a patch to the plugin
maintainers and will update all the headers.
Notice that I feel pretty near to the solution :-)

Ciao
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2] Adding configuration for Maven License Plugin

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/18, Jeromy Evans <je...@blueskyminds.com.au>:
>
> I may be guilty of forgetting to add the license header as I always
> automatically collapse them.



No problem :-)

If not this plugin, it would be helpful if there was an svn hook (eg. commit
> failed due to missing license), otherwise to have a license check earlier in
> the build cycle.



Don configured Bamboo with the "release" profile, but deactivated the RAT
maven plugin. Once reactivated, the build will check for license headers.
Anyway, the meaning of the introduction of the License plugin is primarily
to restore license headers.

Antonio

Re: [S2] Adding configuration for Maven License Plugin

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Antonio Petrelli wrote:
> Hi all
> Since the license headers are an annoying problem, I wish to add the
> Maven License plugin:
> http://code.google.com/p/maven-license-plugin/
> This plugin can *add* license headers on top of files *automatically*
>
> Thoughts?
>
>   

I may be guilty of forgetting to add the license header as I always 
automatically collapse them.
If not this plugin, it would be helpful if there was an svn hook (eg. 
commit failed due to missing license), otherwise to have a license check 
earlier in the build cycle. 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2] Adding configuration for Maven License Plugin

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/18, Giovanni Azua <gi...@imc.nl>:
>
> Ciao Antonio,
>
> Antonio Petrelli wrote:
>
> > In fact the problem is with *old* files :-(
> >
> >
> Then an alternative way would be using find/sed once and having the coding
> style xml config for new files.



It's really hard to fix 600+ files :-(


I personally find that the perfect combination is coding std xml config +
> jalopy + checkstyle because checkstyle only signals mistakes and coding
> style config generates new files code respecting the defined conding std in
> the first place.


+1
But the problem here is the lack of license file. I don't think that Jalopy
can help here, at least not for JSP, FTL etc, files.

Using a maven plugin for this would be nice but maybe better if activated on
> demand only as part of a profile and not running for every build.



Well, in fact the "license:format" goal will be run on-demand, only when
needed, the license:check (similar to RAT maven plugin, I don't know even if
it is necessary) will be activated in the "release" profile.

As I understood for your comments it is not possible because you have
> placeholders replaced in every build ...



Maybe I have not been clear: there are files completely without license
headers, without placeholders. The license plugin helps putting it in the
right places.
The placeholders (variables) I was referring to are in the "txt" file
containing the header to add to files. See:
http://code.google.com/p/maven-license-plugin/wiki/Configuration
(search for "variable replacement").

Thanks
Antonio

Re: [S2] Adding configuration for Maven License Plugin

Posted by Giovanni Azua <gi...@imc.nl>.
Ciao Antonio,

Antonio Petrelli wrote:
> In fact the problem is with *old* files :-(
>   
Then an alternative way would be using find/sed once and having the 
coding style xml config for new files.  I personally find that the 
perfect combination is coding std xml config + jalopy + checkstyle 
because checkstyle only signals mistakes and coding style config 
generates new files code respecting the defined conding std in the first 
place.

Using a maven plugin for this would be nice but maybe better if 
activated on demand only as part of a profile and not running for every 
build. As I understood for your comments it is not possible because you 
have placeholders replaced in every build ...

Best regards,
Giovanni


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2] Adding configuration for Maven License Plugin

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/18, Giovanni Azua <gi...@imc.nl>:
>
> hi Antonio,
>
> Using Eclipse => Preferences -> Java -> Code Style -> Code Template ->
> Comments -> Files
>
> you can set a license header and it will be automatically applied to every
> new file.



In fact the problem is with *old* files :-(


Better yet, you can define a Struts coding standards xml configuration that
> any developer can import into their IDE (for either Eclipse etc) and the
> good news is that it does not take build time.



There is already one, using checkstyle:
http://svn.apache.org/repos/asf/struts/maven/trunk/build/struts_checks.xml
And Checkstyle can be used inside Eclipse (with the Eclipse-CS plugin).

It is a trade off though because maybe (?) the maven license plugin keeps it
> in sync with license changes.



Yep, there is a variable replacement in headers, though we don't need
replacement, if I am correct.

Ciao
Antonio

Re: [S2] Adding configuration for Maven License Plugin

Posted by Giovanni Azua <gi...@imc.nl>.
hi Antonio,

Using Eclipse => Preferences -> Java -> Code Style -> Code Template -> 
Comments -> Files

you can set a license header and it will be automatically applied to 
every new file. Better yet, you can define a Struts coding standards xml 
configuration that any developer can import into their IDE (for either 
Eclipse etc) and the good news is that it does not take build time. It 
is a trade off though because maybe (?) the maven license plugin keeps 
it in sync with license changes. 

Best regards,
Giovanni

Antonio Petrelli wrote:
> Hi all
> Since the license headers are an annoying problem, I wish to add the
> Maven License plugin:
> http://code.google.com/p/maven-license-plugin/
> This plugin can *add* license headers on top of files *automatically*
>
> Thoughts?
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org