You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2015/01/14 00:57:27 UTC

[ALL] Commons Parent - include Animal Sniffer?

I've been experimenting with Animal Sniffer in NET as a basic check
that the code does not try to use method etc which are not present in
the target Java version.
[For example, java.net.IDN requires Java 1.6+]

Although the plugin is not fool-proof, it should help to check basic
errors and allow developers to check code even if they don't have the
requisite Java version installed.

My question is - should it be included in Commons Parent?
And if so, should it be enabled by default?

There are various ways of including it:
- inline. It can then be suppressed by defining animal.sniffer.skip
- as a profile which is enabled by default, potentially disabled
manually or by use of a resource file
- as a profile which is disabled by default, but enabled manually of
by use of a resource file

The profile options would work a bit like Jacoc/Cobertura, but could
be enabled by default rather than disabled by default.

WDYT?

I would favour a profile, enabled by default, as this does not add to
the size of the main body of pom.

Note: the build helper plugin can be used to automatically convert
from the maven.compiler.target syntax (e.g. 1.6) to the Animal Sniffer
signature syntax (e.g. java16) so there is no need to maintain a
separate variable.

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


Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 14/01/2015 00:57, sebb a écrit :

> WDYT?

That sounds like a good idea. Is it possible to bind the plugin to the
package or deploy phase to avoid slowing the build in compile/test
operations?

Emmanuel Bourg


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


Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by sebb <se...@gmail.com>.
On 14 January 2015 at 01:42, Gary Gregory <ga...@gmail.com> wrote:
> On Tue, Jan 13, 2015 at 6:57 PM, sebb <se...@gmail.com> wrote:
>
>> I've been experimenting with Animal Sniffer in NET as a basic check
>> that the code does not try to use method etc which are not present in
>> the target Java version.
>> [For example, java.net.IDN requires Java 1.6+]
>>
>> Although the plugin is not fool-proof, it should help to check basic
>> errors and allow developers to check code even if they don't have the
>> requisite Java version installed.
>>
>> My question is - should it be included in Commons Parent?
>> And if so, should it be enabled by default?
>>
>> There are various ways of including it:
>> - inline. It can then be suppressed by defining animal.sniffer.skip
>> - as a profile which is enabled by default, potentially disabled
>> manually or by use of a resource file
>> - as a profile which is disabled by default, but enabled manually of
>> by use of a resource file
>>
>> The profile options would work a bit like Jacoc/Cobertura, but could
>> be enabled by default rather than disabled by default.
>>
>> WDYT?
>>
>> I would favour a profile, enabled by default, as this does not add to
>> the size of the main body of pom.
>>
>
> Sounds reasonable. How long does it take to run for [Net]?

Difficult to measure, a quick comparison with/out gives  about 0.65 seconds

> Gary
>
>
>>
>> Note: the build helper plugin can be used to automatically convert
>> from the maven.compiler.target syntax (e.g. 1.6) to the Animal Sniffer
>> signature syntax (e.g. java16) so there is no need to maintain a
>> separate variable.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

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


Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Jan 13, 2015 at 6:57 PM, sebb <se...@gmail.com> wrote:

> I've been experimenting with Animal Sniffer in NET as a basic check
> that the code does not try to use method etc which are not present in
> the target Java version.
> [For example, java.net.IDN requires Java 1.6+]
>
> Although the plugin is not fool-proof, it should help to check basic
> errors and allow developers to check code even if they don't have the
> requisite Java version installed.
>
> My question is - should it be included in Commons Parent?
> And if so, should it be enabled by default?
>
> There are various ways of including it:
> - inline. It can then be suppressed by defining animal.sniffer.skip
> - as a profile which is enabled by default, potentially disabled
> manually or by use of a resource file
> - as a profile which is disabled by default, but enabled manually of
> by use of a resource file
>
> The profile options would work a bit like Jacoc/Cobertura, but could
> be enabled by default rather than disabled by default.
>
> WDYT?
>
> I would favour a profile, enabled by default, as this does not add to
> the size of the main body of pom.
>

Sounds reasonable. How long does it take to run for [Net]?

Gary


>
> Note: the build helper plugin can be used to automatically convert
> from the maven.compiler.target syntax (e.g. 1.6) to the Animal Sniffer
> signature syntax (e.g. java16) so there is no need to maintain a
> separate variable.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by Benedikt Ritter <br...@apache.org>.
2015-01-14 0:57 GMT+01:00 sebb <se...@gmail.com>:

> I've been experimenting with Animal Sniffer in NET as a basic check
> that the code does not try to use method etc which are not present in
> the target Java version.
> [For example, java.net.IDN requires Java 1.6+]
>
> Although the plugin is not fool-proof, it should help to check basic
> errors and allow developers to check code even if they don't have the
> requisite Java version installed.
>
> My question is - should it be included in Commons Parent?
> And if so, should it be enabled by default?
>
> There are various ways of including it:
> - inline. It can then be suppressed by defining animal.sniffer.skip
> - as a profile which is enabled by default, potentially disabled
> manually or by use of a resource file
> - as a profile which is disabled by default, but enabled manually of
> by use of a resource file
>
> The profile options would work a bit like Jacoc/Cobertura, but could
> be enabled by default rather than disabled by default.
>
> WDYT?
>
> I would favour a profile, enabled by default, as this does not add to
> the size of the main body of pom.
>

+1


>
> Note: the build helper plugin can be used to automatically convert
> from the maven.compiler.target syntax (e.g. 1.6) to the Animal Sniffer
> signature syntax (e.g. java16) so there is no need to maintain a
> separate variable.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Hello,

I have tested CP 37 with the multi module build of VFS as well. It
worked with a Java7 build on windows. (I did not test if it detects
wrong signatures, only that the build passes).

I also commited the osgi bundle-plugin property I was talking about,
from my POV it would be good if we can release it (both).

The following changes are pending (note I changed the version selection
comment for animal sniffer a bit)

Version 37:

- Update org.apache:apache 15 to 16 (nop for Commons,
  maven-compiler-plugin already contained source/target)
- Adjust Maven prerequisite 3.0 -> 3.0.1 as required by Findbugs
- Update Maven Project Info Reports Plugin : 2.7 => 2.8
- merged maven-3 profile into main body (Maven 2 is no longer supported)
- added Animal Sniffer plugin in profile "animal-sniffer". This is
  active by default.
  The current version of the plugin (1.13) requires Java 7 to report
  API violations.
  The default version is set to 1.11 which works with Java 5 unless
  jdk7-plugin-fix-version is detected.
- renamed the profile jdk7-findbugs to jdk7-plugin-fix-version
- OSGI bundle-plugin allows commons.osgi.excludeDependencies to be
  configured
  (default is true for compatibility with older versions, it excludes
  all dependencies and makes
  the plugin skip most of its work around attributing packages
  correctly)


Gruss
Bernd


 Am Sat, 17 Jan 2015 22:13:20 +0000
schrieb sebb <se...@gmail.com>:

> On 17 January 2015 at 19:35, Thomas Neidhart
> <th...@gmail.com> wrote:
> > On 01/14/2015 12:57 AM, sebb wrote:
> >> I've been experimenting with Animal Sniffer in NET as a basic check
> >> that the code does not try to use method etc which are not present
> >> in the target Java version.
> >> [For example, java.net.IDN requires Java 1.6+]
> >>
> >> Although the plugin is not fool-proof, it should help to check
> >> basic errors and allow developers to check code even if they don't
> >> have the requisite Java version installed.
> >>
> >> My question is - should it be included in Commons Parent?
> >> And if so, should it be enabled by default?
> >>
> >> There are various ways of including it:
> >> - inline. It can then be suppressed by defining animal.sniffer.skip
> >> - as a profile which is enabled by default, potentially disabled
> >> manually or by use of a resource file
> >> - as a profile which is disabled by default, but enabled manually
> >> of by use of a resource file
> >>
> >> The profile options would work a bit like Jacoc/Cobertura, but
> >> could be enabled by default rather than disabled by default.
> >>
> >> WDYT?
> >>
> >> I would favour a profile, enabled by default, as this does not add
> >> to the size of the main body of pom.
> >>
> >> Note: the build helper plugin can be used to automatically convert
> >> from the maven.compiler.target syntax (e.g. 1.6) to the Animal
> >> Sniffer signature syntax (e.g. java16) so there is no need to
> >> maintain a separate variable.
> >
> > I have tested the latest parent 37-SNAPSHOT with the animal-sniffer
> > plugin on email using OpenJDK 1.7 and it worked fine.
> >
> > Thanks!
> 
> Great, thanks for testing it.
> 
> > Thomas
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


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


Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by sebb <se...@gmail.com>.
On 17 January 2015 at 19:35, Thomas Neidhart <th...@gmail.com> wrote:
> On 01/14/2015 12:57 AM, sebb wrote:
>> I've been experimenting with Animal Sniffer in NET as a basic check
>> that the code does not try to use method etc which are not present in
>> the target Java version.
>> [For example, java.net.IDN requires Java 1.6+]
>>
>> Although the plugin is not fool-proof, it should help to check basic
>> errors and allow developers to check code even if they don't have the
>> requisite Java version installed.
>>
>> My question is - should it be included in Commons Parent?
>> And if so, should it be enabled by default?
>>
>> There are various ways of including it:
>> - inline. It can then be suppressed by defining animal.sniffer.skip
>> - as a profile which is enabled by default, potentially disabled
>> manually or by use of a resource file
>> - as a profile which is disabled by default, but enabled manually of
>> by use of a resource file
>>
>> The profile options would work a bit like Jacoc/Cobertura, but could
>> be enabled by default rather than disabled by default.
>>
>> WDYT?
>>
>> I would favour a profile, enabled by default, as this does not add to
>> the size of the main body of pom.
>>
>> Note: the build helper plugin can be used to automatically convert
>> from the maven.compiler.target syntax (e.g. 1.6) to the Animal Sniffer
>> signature syntax (e.g. java16) so there is no need to maintain a
>> separate variable.
>
> I have tested the latest parent 37-SNAPSHOT with the animal-sniffer
> plugin on email using OpenJDK 1.7 and it worked fine.
>
> Thanks!

Great, thanks for testing it.

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

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


Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by Thomas Neidhart <th...@gmail.com>.
On 01/14/2015 12:57 AM, sebb wrote:
> I've been experimenting with Animal Sniffer in NET as a basic check
> that the code does not try to use method etc which are not present in
> the target Java version.
> [For example, java.net.IDN requires Java 1.6+]
> 
> Although the plugin is not fool-proof, it should help to check basic
> errors and allow developers to check code even if they don't have the
> requisite Java version installed.
> 
> My question is - should it be included in Commons Parent?
> And if so, should it be enabled by default?
> 
> There are various ways of including it:
> - inline. It can then be suppressed by defining animal.sniffer.skip
> - as a profile which is enabled by default, potentially disabled
> manually or by use of a resource file
> - as a profile which is disabled by default, but enabled manually of
> by use of a resource file
> 
> The profile options would work a bit like Jacoc/Cobertura, but could
> be enabled by default rather than disabled by default.
> 
> WDYT?
> 
> I would favour a profile, enabled by default, as this does not add to
> the size of the main body of pom.
> 
> Note: the build helper plugin can be used to automatically convert
> from the maven.compiler.target syntax (e.g. 1.6) to the Animal Sniffer
> signature syntax (e.g. java16) so there is no need to maintain a
> separate variable.

I have tested the latest parent 37-SNAPSHOT with the animal-sniffer
plugin on email using OpenJDK 1.7 and it worked fine.

Thanks!

Thomas

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


Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by sebb <se...@gmail.com>.
On 14 January 2015 at 12:16, Thomas Neidhart <th...@gmail.com> wrote:
> I think it would be good to add it by default with the option to disable it
> on a component level.
>
> According to
> http://mojo.codehaus.org/animal-sniffer-maven-plugin/plugin-info.html, the
> minimum requirements are JDK 1.5 and maven 2.0, but I wonder if anybody
> would use an older jdk to build a component.

Commons Parent 36 requires Maven 3.0 or higher which requires Java 1.5
or higher so that's not an issue for the plugin.

I expect most developers to be using at least Java 6 now to actually run Maven.

> Did you resolve the problems you had with Java on MacOS?

No, I've not looked into it.
I should probably add a comment to CP in the animal sniffer section.

> Thomas
>
> On Wed, Jan 14, 2015 at 12:57 AM, sebb <se...@gmail.com> wrote:
>
>> I've been experimenting with Animal Sniffer in NET as a basic check
>> that the code does not try to use method etc which are not present in
>> the target Java version.
>> [For example, java.net.IDN requires Java 1.6+]
>>
>> Although the plugin is not fool-proof, it should help to check basic
>> errors and allow developers to check code even if they don't have the
>> requisite Java version installed.
>>
>> My question is - should it be included in Commons Parent?
>> And if so, should it be enabled by default?
>>
>> There are various ways of including it:
>> - inline. It can then be suppressed by defining animal.sniffer.skip
>> - as a profile which is enabled by default, potentially disabled
>> manually or by use of a resource file
>> - as a profile which is disabled by default, but enabled manually of
>> by use of a resource file
>>
>> The profile options would work a bit like Jacoc/Cobertura, but could
>> be enabled by default rather than disabled by default.
>>
>> WDYT?
>>
>> I would favour a profile, enabled by default, as this does not add to
>> the size of the main body of pom.
>>
>> Note: the build helper plugin can be used to automatically convert
>> from the maven.compiler.target syntax (e.g. 1.6) to the Animal Sniffer
>> signature syntax (e.g. java16) so there is no need to maintain a
>> separate variable.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>

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


Re: [ALL] Commons Parent - include Animal Sniffer?

Posted by Thomas Neidhart <th...@gmail.com>.
I think it would be good to add it by default with the option to disable it
on a component level.

According to
http://mojo.codehaus.org/animal-sniffer-maven-plugin/plugin-info.html, the
minimum requirements are JDK 1.5 and maven 2.0, but I wonder if anybody
would use an older jdk to build a component.

Did you resolve the problems you had with Java on MacOS?

Thomas

On Wed, Jan 14, 2015 at 12:57 AM, sebb <se...@gmail.com> wrote:

> I've been experimenting with Animal Sniffer in NET as a basic check
> that the code does not try to use method etc which are not present in
> the target Java version.
> [For example, java.net.IDN requires Java 1.6+]
>
> Although the plugin is not fool-proof, it should help to check basic
> errors and allow developers to check code even if they don't have the
> requisite Java version installed.
>
> My question is - should it be included in Commons Parent?
> And if so, should it be enabled by default?
>
> There are various ways of including it:
> - inline. It can then be suppressed by defining animal.sniffer.skip
> - as a profile which is enabled by default, potentially disabled
> manually or by use of a resource file
> - as a profile which is disabled by default, but enabled manually of
> by use of a resource file
>
> The profile options would work a bit like Jacoc/Cobertura, but could
> be enabled by default rather than disabled by default.
>
> WDYT?
>
> I would favour a profile, enabled by default, as this does not add to
> the size of the main body of pom.
>
> Note: the build helper plugin can be used to automatically convert
> from the maven.compiler.target syntax (e.g. 1.6) to the Animal Sniffer
> signature syntax (e.g. java16) so there is no need to maintain a
> separate variable.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>