You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by Uwe Schindler <uw...@thetaphi.de> on 2015/01/23 12:11:22 UTC

Forbidden-APIS no longer ran because of carzy POM change

Hi,

I just noticed while checking the problems around the ExternalParsers that the TIKA's build no longer runs the forbidden-apis Maven plugin, so we got a few new violation especially regarding the toUpper/LowerCase(). In fact the following commit broke this:

Revision: 1624185
Author: mattmann
Date: Donnerstag, 11. September 2014 05:11:19
Message:
surround in plugin management to resolve http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin
----
Modified : /tika/trunk/tika-parent/pom.xml

Since that change, the plugin is no longer run by default. I have no idea, why this is like this, but in fact this broke some of the globally defined check tasks. I have no idea how to reenable it easily.
So I cannot help, but reverting that commit restores behavior. What is the reason for this commit, there is not even an issue about that. I think it seems to be a workaround for some Eclipse issue, but in fact this disables the whole plugins. To reenable forbidden-apis you have to now explicitely enable it in every module (because pluginManagement just gives the config of a plugin, where without that it also enables its execution.

In addition, there is already version 1.7 of forbiddenapis, so you can replace 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs with Java 8 and Java 9).

The following new violations were found -> and in fact those broke code in turkish locale:
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tika core 1.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
[INFO] Scanning for classes to check...
[INFO] Reading bundled API signatures: jdk-unsafe
[INFO] Reading bundled API signatures: jdk-deprecated
[INFO] Loading classes to check...
[INFO] Scanning for API signatures and dependencies...
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest (BasicContentHandlerFactoryTest.java:79)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest (BasicContentHandlerFactoryTest.java:80)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest (BasicContentHandlerFactoryTest.java:88)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest (BasicContentHandlerFactoryTest.java:133)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest (BasicContentHandlerFactoryTest.java:176)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest (BasicContentHandlerFactoryTest.java:221)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest (BasicContentHandlerFactoryTest.java:273)
[ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API invocations (in 0.16s), 7 error(s).
[INFO] ------------------------------------------------------------------------
[...]
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tika parsers 1.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
[INFO] Scanning for classes to check...
[INFO] Reading bundled API signatures: jdk-unsafe
[INFO] Reading bundled API signatures: jdk-deprecated
[INFO] Loading classes to check...
[INFO] Scanning for API signatures and dependencies...
[ERROR] Forbidden method invocation: java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default charset]
[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2 (TesseractOCRParser.java:309)
[ERROR] Forbidden method invocation: java.lang.String#<init>(byte[],int,int) [Uses default charset]
[ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet (ChmDirectoryListingSet.java:240)
[ERROR] Forbidden method invocation: java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default locale]
[ERROR]   in org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1 (ImageMetadataExtractor.java:304)
[ERROR] Forbidden method invocation: java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default locale]
[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig (TesseractOCRConfig.java:214)
[ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API invocations (in 0.38s), 4 error(s).

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de



Re: Forbidden-APIS no longer ran because of carzy POM change

Posted by "Mattmann, Chris A (3980)" <ch...@jpl.nasa.gov>.
Thanks Uwe, no problem we’ll figure it out. We’ll get it re-enabled
and also figure out the Eclipse thing. Thanks for bringing this up!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: chris.a.mattmann@nasa.gov
WWW:  http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Uwe Schindler <uw...@thetaphi.de>
Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
Date: Friday, January 23, 2015 at 7:20 AM
To: "dev@tika.apache.org" <de...@tika.apache.org>
Subject: RE: Forbidden-APIS no longer ran because of carzy POM change

>Hi,
>
>> Hmm, weird, that’s a commit from September 2014, Uwe, so quite a while
>> ago.
>> 
>> I think I was having some issues in Eclipse complaining about that
>>plugin, so I
>> used the workaround presented on StackOverflow to deal with it.
>> 
>> I’m not fine reverting the commit unless the behavior that it did was
>> preserved - in other words, I wanted Eclipse to stop complaining about
>>that
>> plugin. So maybe we can figure out a way that both enables the plugin,
>>and
>> makes Eclipse not complain about it.
>
>For me it just says that it cannot handle that plugin, but it does not
>prevent you from using Eclipse or running anything in eclipse. I have the
>plugin in various Eclipse projects with Maven running here locally...
>
>Another option would be to make a Maven profile like you do for RAT?
>Unfortunately I have no idea how to do this correctly. In that case you
>could just instruct Jenkins to run the profile...
>
>> I’ll check.
>> 
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> ++++++++
>> Chris Mattmann, Ph.D.
>> Chief Architect
>> Instrument Software and Science Data Systems Section (398) NASA Jet
>> Propulsion Laboratory Pasadena, CA 91109 USA
>> Office: 168-519, Mailstop: 168-527
>> Email: chris.a.mattmann@nasa.gov
>> WWW:  http://sunset.usc.edu/~mattmann/
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> ++++++++
>> Adjunct Associate Professor, Computer Science Department University of
>> Southern California, Los Angeles, CA 90089 USA
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> ++++++++
>> 
>> 
>> 
>> 
>> 
>> 
>> -----Original Message-----
>> From: Uwe Schindler <uw...@thetaphi.de>
>> Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
>> Date: Friday, January 23, 2015 at 3:11 AM
>> To: "dev@tika.apache.org" <de...@tika.apache.org>
>> Subject: Forbidden-APIS no longer ran because of carzy POM change
>> 
>> >Hi,
>> >
>> >I just noticed while checking the problems around the ExternalParsers
>> >that the TIKA's build no longer runs the forbidden-apis Maven plugin,
>> >so we got a few new violation especially regarding the
>> toUpper/LowerCase().
>> >In fact the following commit broke this:
>> >
>> >Revision: 1624185
>> >Author: mattmann
>> >Date: Donnerstag, 11. September 2014 05:11:19
>> >Message:
>> >surround in plugin management to resolve
>> >http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
>> executio
>> >n-n ot-covered-by-lifecycle-configuration-for-sprin
>> >----
>> >Modified : /tika/trunk/tika-parent/pom.xml
>> >
>> >Since that change, the plugin is no longer run by default. I have no
>> >idea, why this is like this, but in fact this broke some of the
>> >globally defined check tasks. I have no idea how to reenable it easily.
>> >So I cannot help, but reverting that commit restores behavior. What is
>> >the reason for this commit, there is not even an issue about that. I
>> >think it seems to be a workaround for some Eclipse issue, but in fact
>> >this disables the whole plugins. To reenable forbidden-apis you have to
>> >now explicitely enable it in every module (because pluginManagement
>> >just gives the config of a plugin, where without that it also enables
>> >its execution.
>> >
>> >In addition, there is already version 1.7 of forbiddenapis, so you can
>> >replace 1.6.1 of forbidden-apis with version 1.7 (which fixes a few
>> >bugs with Java 8 and Java 9).
>> >
>> >The following new violations were found -> and in fact those broke code
>> >in turkish locale:
>> >[INFO]
>> >-----------------------------------------------------------------------
>> >- [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
>> >-----------------------------------------------------------------------
>> >-
>> >[INFO]
>> >[INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core --- [INFO]
>> >Scanning for classes to check...
>> >[INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
>> >bundled API signatures: jdk-deprecated [INFO] Loading classes to
>> >check...
>> >[INFO] Scanning for API signatures and dependencies...
>> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> >[Uses default locale]
>> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> >(BasicContentHandlerFactoryTest.java:79)
>> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> >[Uses default locale]
>> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> >(BasicContentHandlerFactoryTest.java:80)
>> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> >[Uses default locale]
>> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> >(BasicContentHandlerFactoryTest.java:88)
>> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> >[Uses default locale]
>> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> >(BasicContentHandlerFactoryTest.java:133)
>> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> >[Uses default locale]
>> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> >(BasicContentHandlerFactoryTest.java:176)
>> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> >[Uses default locale]
>> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> >(BasicContentHandlerFactoryTest.java:221)
>> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> >[Uses default locale]
>> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> >(BasicContentHandlerFactoryTest.java:273)
>> >[ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
>> >invocations (in 0.16s), 7 error(s).
>> >[INFO]
>> >-----------------------------------------------------------------------
>> >-
>> >[...]
>> >[INFO]
>> >-----------------------------------------------------------------------
>> >- [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
>> >-----------------------------------------------------------------------
>> >-
>> >[INFO]
>> >[INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
>> >[INFO] Scanning for classes to check...
>> >[INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
>> >bundled API signatures: jdk-deprecated [INFO] Loading classes to
>> >check...
>> >[INFO] Scanning for API signatures and dependencies...
>> >[ERROR] Forbidden method invocation:
>> >java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
>> >charset]
>> >[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
>> >(TesseractOCRParser.java:309)
>> >[ERROR] Forbidden method invocation:
>> >java.lang.String#<init>(byte[],int,int) [Uses default charset]
>> >[ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
>> >(ChmDirectoryListingSet.java:240)
>> >[ERROR] Forbidden method invocation:
>> >java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
>>locale]
>> >[ERROR]   in
>> >org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
>> >(ImageMetadataExtractor.java:304)
>> >[ERROR] Forbidden method invocation:
>> >java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
>> >default locale]
>> >[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
>> >(TesseractOCRConfig.java:214)
>> >[ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API
>> >invocations (in 0.38s), 4 error(s).
>> >
>> >Uwe
>> >
>> >-----
>> >Uwe Schindler
>> >H.-H.-Meier-Allee 63, D-28213 Bremen
>> >http://www.thetaphi.de
>> >eMail: uwe@thetaphi.de
>> >
>> >
>
>


RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

> Hmm, weird, that’s a commit from September 2014, Uwe, so quite a while
> ago.
> 
> I think I was having some issues in Eclipse complaining about that plugin, so I
> used the workaround presented on StackOverflow to deal with it.
> 
> I’m not fine reverting the commit unless the behavior that it did was
> preserved - in other words, I wanted Eclipse to stop complaining about that
> plugin. So maybe we can figure out a way that both enables the plugin, and
> makes Eclipse not complain about it.

For me it just says that it cannot handle that plugin, but it does not prevent you from using Eclipse or running anything in eclipse. I have the plugin in various Eclipse projects with Maven running here locally...

Another option would be to make a Maven profile like you do for RAT? Unfortunately I have no idea how to do this correctly. In that case you could just instruct Jenkins to run the profile...

> I’ll check.
> 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> Chris Mattmann, Ph.D.
> Chief Architect
> Instrument Software and Science Data Systems Section (398) NASA Jet
> Propulsion Laboratory Pasadena, CA 91109 USA
> Office: 168-519, Mailstop: 168-527
> Email: chris.a.mattmann@nasa.gov
> WWW:  http://sunset.usc.edu/~mattmann/
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> Adjunct Associate Professor, Computer Science Department University of
> Southern California, Los Angeles, CA 90089 USA
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Uwe Schindler <uw...@thetaphi.de>
> Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
> Date: Friday, January 23, 2015 at 3:11 AM
> To: "dev@tika.apache.org" <de...@tika.apache.org>
> Subject: Forbidden-APIS no longer ran because of carzy POM change
> 
> >Hi,
> >
> >I just noticed while checking the problems around the ExternalParsers
> >that the TIKA's build no longer runs the forbidden-apis Maven plugin,
> >so we got a few new violation especially regarding the
> toUpper/LowerCase().
> >In fact the following commit broke this:
> >
> >Revision: 1624185
> >Author: mattmann
> >Date: Donnerstag, 11. September 2014 05:11:19
> >Message:
> >surround in plugin management to resolve
> >http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> executio
> >n-n ot-covered-by-lifecycle-configuration-for-sprin
> >----
> >Modified : /tika/trunk/tika-parent/pom.xml
> >
> >Since that change, the plugin is no longer run by default. I have no
> >idea, why this is like this, but in fact this broke some of the
> >globally defined check tasks. I have no idea how to reenable it easily.
> >So I cannot help, but reverting that commit restores behavior. What is
> >the reason for this commit, there is not even an issue about that. I
> >think it seems to be a workaround for some Eclipse issue, but in fact
> >this disables the whole plugins. To reenable forbidden-apis you have to
> >now explicitely enable it in every module (because pluginManagement
> >just gives the config of a plugin, where without that it also enables
> >its execution.
> >
> >In addition, there is already version 1.7 of forbiddenapis, so you can
> >replace 1.6.1 of forbidden-apis with version 1.7 (which fixes a few
> >bugs with Java 8 and Java 9).
> >
> >The following new violations were found -> and in fact those broke code
> >in turkish locale:
> >[INFO]
> >-----------------------------------------------------------------------
> >- [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> >-----------------------------------------------------------------------
> >-
> >[INFO]
> >[INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core --- [INFO]
> >Scanning for classes to check...
> >[INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> >bundled API signatures: jdk-deprecated [INFO] Loading classes to
> >check...
> >[INFO] Scanning for API signatures and dependencies...
> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >[Uses default locale]
> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >(BasicContentHandlerFactoryTest.java:79)
> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >[Uses default locale]
> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >(BasicContentHandlerFactoryTest.java:80)
> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >[Uses default locale]
> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >(BasicContentHandlerFactoryTest.java:88)
> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >[Uses default locale]
> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >(BasicContentHandlerFactoryTest.java:133)
> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >[Uses default locale]
> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >(BasicContentHandlerFactoryTest.java:176)
> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >[Uses default locale]
> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >(BasicContentHandlerFactoryTest.java:221)
> >[ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >[Uses default locale]
> >[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >(BasicContentHandlerFactoryTest.java:273)
> >[ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
> >invocations (in 0.16s), 7 error(s).
> >[INFO]
> >-----------------------------------------------------------------------
> >-
> >[...]
> >[INFO]
> >-----------------------------------------------------------------------
> >- [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> >-----------------------------------------------------------------------
> >-
> >[INFO]
> >[INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
> >[INFO] Scanning for classes to check...
> >[INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> >bundled API signatures: jdk-deprecated [INFO] Loading classes to
> >check...
> >[INFO] Scanning for API signatures and dependencies...
> >[ERROR] Forbidden method invocation:
> >java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> >charset]
> >[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> >(TesseractOCRParser.java:309)
> >[ERROR] Forbidden method invocation:
> >java.lang.String#<init>(byte[],int,int) [Uses default charset]
> >[ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> >(ChmDirectoryListingSet.java:240)
> >[ERROR] Forbidden method invocation:
> >java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default locale]
> >[ERROR]   in
> >org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> >(ImageMetadataExtractor.java:304)
> >[ERROR] Forbidden method invocation:
> >java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
> >default locale]
> >[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> >(TesseractOCRConfig.java:214)
> >[ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API
> >invocations (in 0.38s), 4 error(s).
> >
> >Uwe
> >
> >-----
> >Uwe Schindler
> >H.-H.-Meier-Allee 63, D-28213 Bremen
> >http://www.thetaphi.de
> >eMail: uwe@thetaphi.de
> >
> >



Re: Forbidden-APIS no longer ran because of carzy POM change

Posted by "Mattmann, Chris A (3980)" <ch...@jpl.nasa.gov>.
Hmm, weird, that’s a commit from September 2014, Uwe, so quite a
while ago.

I think I was having some issues in Eclipse complaining about that
plugin, so I used the workaround presented on StackOverflow to deal
with it. 

I’m not fine reverting the commit unless the behavior that it did
was preserved - in other words, I wanted Eclipse to stop complaining
about that plugin. So maybe we can figure out a way that both enables
the plugin, and makes Eclipse not complain about it.

I’ll check.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: chris.a.mattmann@nasa.gov
WWW:  http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Uwe Schindler <uw...@thetaphi.de>
Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
Date: Friday, January 23, 2015 at 3:11 AM
To: "dev@tika.apache.org" <de...@tika.apache.org>
Subject: Forbidden-APIS no longer ran because of carzy POM change

>Hi,
>
>I just noticed while checking the problems around the ExternalParsers
>that the TIKA's build no longer runs the forbidden-apis Maven plugin, so
>we got a few new violation especially regarding the toUpper/LowerCase().
>In fact the following commit broke this:
>
>Revision: 1624185
>Author: mattmann
>Date: Donnerstag, 11. September 2014 05:11:19
>Message:
>surround in plugin management to resolve
>http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-n
>ot-covered-by-lifecycle-configuration-for-sprin
>----
>Modified : /tika/trunk/tika-parent/pom.xml
>
>Since that change, the plugin is no longer run by default. I have no
>idea, why this is like this, but in fact this broke some of the globally
>defined check tasks. I have no idea how to reenable it easily.
>So I cannot help, but reverting that commit restores behavior. What is
>the reason for this commit, there is not even an issue about that. I
>think it seems to be a workaround for some Eclipse issue, but in fact
>this disables the whole plugins. To reenable forbidden-apis you have to
>now explicitely enable it in every module (because pluginManagement just
>gives the config of a plugin, where without that it also enables its
>execution.
>
>In addition, there is already version 1.7 of forbiddenapis, so you can
>replace 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
>with Java 8 and Java 9).
>
>The following new violations were found -> and in fact those broke code
>in turkish locale:
>[INFO] 
>------------------------------------------------------------------------
>[INFO] Building Apache Tika core 1.8-SNAPSHOT
>[INFO] 
>------------------------------------------------------------------------
>[INFO] 
>[INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
>[INFO] Scanning for classes to check...
>[INFO] Reading bundled API signatures: jdk-unsafe
>[INFO] Reading bundled API signatures: jdk-deprecated
>[INFO] Loading classes to check...
>[INFO] Scanning for API signatures and dependencies...
>[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses
>default locale]
>[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>(BasicContentHandlerFactoryTest.java:79)
>[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses
>default locale]
>[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>(BasicContentHandlerFactoryTest.java:80)
>[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses
>default locale]
>[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>(BasicContentHandlerFactoryTest.java:88)
>[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses
>default locale]
>[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>(BasicContentHandlerFactoryTest.java:133)
>[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses
>default locale]
>[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>(BasicContentHandlerFactoryTest.java:176)
>[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses
>default locale]
>[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>(BasicContentHandlerFactoryTest.java:221)
>[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses
>default locale]
>[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>(BasicContentHandlerFactoryTest.java:273)
>[ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
>invocations (in 0.16s), 7 error(s).
>[INFO] 
>------------------------------------------------------------------------
>[...]
>[INFO] 
>------------------------------------------------------------------------
>[INFO] Building Apache Tika parsers 1.8-SNAPSHOT
>[INFO] 
>------------------------------------------------------------------------
>[INFO]
>[INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
>[INFO] Scanning for classes to check...
>[INFO] Reading bundled API signatures: jdk-unsafe
>[INFO] Reading bundled API signatures: jdk-deprecated
>[INFO] Loading classes to check...
>[INFO] Scanning for API signatures and dependencies...
>[ERROR] Forbidden method invocation:
>java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
>charset]
>[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
>(TesseractOCRParser.java:309)
>[ERROR] Forbidden method invocation:
>java.lang.String#<init>(byte[],int,int) [Uses default charset]
>[ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
>(ChmDirectoryListingSet.java:240)
>[ERROR] Forbidden method invocation:
>java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default locale]
>[ERROR]   in 
>org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
>(ImageMetadataExtractor.java:304)
>[ERROR] Forbidden method invocation:
>java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
>default locale]
>[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
>(TesseractOCRConfig.java:214)
>[ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API
>invocations (in 0.38s), 4 error(s).
>
>Uwe
>
>-----
>Uwe Schindler
>H.-H.-Meier-Allee 63, D-28213 Bremen
>http://www.thetaphi.de
>eMail: uwe@thetaphi.de
>
>


RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

> There're several places where forbiddenapis will give errors in Tika.
> I don't know if there is better way to fallback. E.g. in one of chm parser
> classes:
> 
> try {
>   dle.setName(new String(bytes, "UTF-8")); catch
> (UnsupportedCharsetException e) {
>   dle.setName(new String(bytes));
> }
> 
> Can you add special annotation parsing (like
> @SuppressWarnings("forbiddenapis") on element) to avoid emitting build
> error in special cases like above mentioned?

Not yet, see: https://code.google.com/p/forbidden-apis/issues/detail?id=34

But the above is not needed. UTF-8 is always defined (the JVM standard requires this). In fact in Java 7, you can use StandardCharsets.UTF_8. It is also a bad idea to use charsets as strings. Just somewhere define a constant (if you have to Java 7) like: 
public final Charset UTF_8 = Charset.forName("UTF-8");

And use that everywhere instead of a string. This spares the synchronized lookup of the string, the JVM is doing otherwise.

Uwe

> --
> Best regards,
> Konstantin Gribov
> 
> Fri Jan 23 2015 at 15:10:18, Uwe Schindler <uw...@thetaphi.de>:
> 
> Here is the patch, mailing list swallowed it:
> >
> > Index: tika-parent/pom.xml
> >
> ==========================================================
> =========
> > --- tika-parent/pom.xml (revision 1654171)
> > +++ tika-parent/pom.xml (working copy)
> > @@ -274,7 +274,6 @@
> >    </properties>
> >
> >    <build>
> > -    <pluginManagement>
> >        <plugins>
> >          <plugin>
> >            <artifactId>maven-compiler-plugin</artifactId>
> > @@ -287,7 +286,7 @@
> >          <plugin>
> >            <groupId>de.thetaphi</groupId>
> >            <artifactId>forbiddenapis</artifactId>
> > -          <version>1.6.1</version>
> > +          <version>1.7</version>
> >            <configuration>
> >              <targetVersion>${maven.compiler.target}</targetVersion>
> >              <internalRuntimeForbidden>true</internalRuntimeForbidden>
> > @@ -322,7 +321,6 @@
> >            <version>2.3</version>
> >          </plugin>
> >        </plugins>
> > -    </pluginManagement>
> >    </build>
> >
> >    <profiles>
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de
> >
> >
> > > -----Original Message-----
> > > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > Sent: Friday, January 23, 2015 1:08 PM
> > > To: dev@tika.apache.org
> > > Subject: RE: Forbidden-APIS no longer ran because of carzy POM
> > > change
> > >
> > > The attached patch reverts the change and updates the forbidden plugin.
> > >
> > > Uwe
> > >
> > > -----
> > > Uwe Schindler
> > > H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > eMail: uwe@thetaphi.de
> > >
> > >
> > > > -----Original Message-----
> > > > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > > Sent: Friday, January 23, 2015 1:00 PM
> > > > To: dev@tika.apache.org
> > > > Subject: RE: Forbidden-APIS no longer ran because of carzy POM
> change
> > > >
> > > > Here ist he explanation why the plugin is no longer called because of
> > this:
> > > >
> > > > - Works for me too, but can anyone explain why? –  Andrew Swan May
> 15
> > > > '13 at 6:26
> > > > - @Andrew I think this works because m2e is not looking for plugins in
> > > > pluginManagement, but only in build/plugins. In the Maven world,
> there
> > > > is a difference between the two - the former defines "if you happen to
> > > > use this plugin, here's the configuration to use", whereas the latter
> > > > states "use this plugin". See this post and its top two answers. –
> > > > GreenGiant Jul 5 '13 at 17:52
> > > > - I agree with @GreenGiant. I tried this solution but it then breaks
> > > > the compilation since the aspectj plugin is not called before
> > > > compilation. –  Pierre Aug 30 '13 at 20:21
> > > >
> > > > This explains the change. In fact placing the plugins in
> > > > pluginManagements disables them unless explicitely configured in a
> > > > sub-module. So this commit should be reverted.
> > > >
> > > >
> > > > In fact the bug described here no longer applies to later M2E
> > > > installations. It still complains about plugins that Eclipse does not
> > > > know about, but this does not prevent you from using Eclipse. So I
> > > > would strongly ask to revert the commit because it breaks the build.
> > > >
> > > > Uwe
> > > >
> > > > -----
> > > > Uwe Schindler
> > > > H.-H.-Meier-Allee 63, D-28213 Bremen
> > > > http://www.thetaphi.de
> > > > eMail: uwe@thetaphi.de
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > > > Sent: Friday, January 23, 2015 12:11 PM
> > > > > To: dev@tika.apache.org
> > > > > Subject: Forbidden-APIS no longer ran because of carzy POM change
> > > > >
> > > > > Hi,
> > > > >
> > > > > I just noticed while checking the problems around the
> > > > > ExternalParsers that the TIKA's build no longer runs the
> > > > > forbidden-apis Maven plugin, so we got a few new violation
> > > > > especially regarding the toUpper/LowerCase(). In fact the following
> > > commit broke this:
> > > > >
> > > > > Revision: 1624185
> > > > > Author: mattmann
> > > > > Date: Donnerstag, 11. September 2014 05:11:19
> > > > > Message:
> > > > > surround in plugin management to resolve
> > > > > http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> > > > > execution-not-covered-by-lifecycle-configuration-for-sprin
> > > > > ----
> > > > > Modified : /tika/trunk/tika-parent/pom.xml
> > > > >
> > > > > Since that change, the plugin is no longer run by default. I have no
> > > > > idea, why this is like this, but in fact this broke some of the
> > > > > globally defined
> > > > check tasks.
> > > > > I have no idea how to reenable it easily.
> > > > > So I cannot help, but reverting that commit restores behavior. What
> > > > > is the reason for this commit, there is not even an issue about
> > > > > that. I think it seems to be a workaround for some Eclipse issue,
> > > > > but in fact this disables the whole plugins. To reenable
> > > > > forbidden-apis you have to now explicitely enable it in every module
> > > > > (because pluginManagement just gives the config of a plugin, where
> > > > > without that it also enables its
> > > > execution.
> > > > >
> > > > > In addition, there is already version 1.7 of forbiddenapis, so you
> > > > > can replace
> > > > > 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
> > > > > with Java 8 and Java 9).
> > > > >
> > > > > The following new violations were found -> and in fact those broke
> > > > > code in turkish locale:
> > > > > [INFO]
> > > > > --------------------------------------------------------------------
> > > > > --
> > > > > -- [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> > > > > --------------------------
> > > > > ----------------------------------------------
> > > > > [INFO]
> > > > > [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> > > > > [INFO] Scanning for classes to check...
> > > > > [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > > > bundled API signatures: jdk-deprecated [INFO] Loading classes to
> > check...
> > > > > [INFO] Scanning for API signatures and dependencies...
> > > > > [ERROR] Forbidden method invocation:
> java.lang.String#toLowerCase()
> > > > > [Uses default locale]
> > > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > > (BasicContentHandlerFactoryTest.java:79)
> > > > > [ERROR] Forbidden method invocation:
> java.lang.String#toLowerCase()
> > > > > [Uses default locale]
> > > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > > (BasicContentHandlerFactoryTest.java:80)
> > > > > [ERROR] Forbidden method invocation:
> java.lang.String#toLowerCase()
> > > > > [Uses default locale]
> > > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > > (BasicContentHandlerFactoryTest.java:88)
> > > > > [ERROR] Forbidden method invocation:
> java.lang.String#toLowerCase()
> > > > > [Uses default locale]
> > > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > > (BasicContentHandlerFactoryTest.java:133)
> > > > > [ERROR] Forbidden method invocation:
> java.lang.String#toLowerCase()
> > > > > [Uses default locale]
> > > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > > (BasicContentHandlerFactoryTest.java:176)
> > > > > [ERROR] Forbidden method invocation:
> java.lang.String#toLowerCase()
> > > > > [Uses default locale]
> > > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > > (BasicContentHandlerFactoryTest.java:221)
> > > > > [ERROR] Forbidden method invocation:
> java.lang.String#toLowerCase()
> > > > > [Uses default locale]
> > > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > > (BasicContentHandlerFactoryTest.java:273)
> > > > > [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
> > > > > invocations (in 0.16s), 7 error(s).
> > > > > [INFO]
> > > > > --------------------------------------------------------------------
> > > > > --
> > > > > --
> > > > > [...]
> > > > > [INFO]
> > > > > --------------------------------------------------------------------
> > > > > --
> > > > > -- [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> > > > > ----------------------
> > > > > --------------------------------------------------
> > > > > [INFO]
> > > > > [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
> > > > > [INFO] Scanning for classes to check...
> > > > > [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > > > bundled API signatures: jdk-deprecated [INFO] Loading classes to
> > check...
> > > > > [INFO] Scanning for API signatures and dependencies...
> > > > > [ERROR] Forbidden method invocation:
> > > > > java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> > > > > charset]
> > > > > [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> > > > > (TesseractOCRParser.java:309)
> > > > > [ERROR] Forbidden method invocation:
> > > > > java.lang.String#<init>(byte[],int,int)
> > > > > [Uses default charset]
> > > > > [ERROR]   in org.apache.tika.parser.chm.accessor.
> > ChmDirectoryListingSet
> > > > > (ChmDirectoryListingSet.java:240)
> > > > > [ERROR] Forbidden method invocation:
> > > > > java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
> > locale]
> > > > > [ERROR]   in
> > > > > org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> > > > > (ImageMetadataExtractor.java:304)
> > > > > [ERROR] Forbidden method invocation:
> > > > > java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
> > > > > default locale]
> > > > > [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> > > > > (TesseractOCRConfig.java:214)
> > > > > [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
> > > > > API invocations (in 0.38s), 4 error(s).
> > > > >
> > > > > Uwe
> > > > >
> > > > > -----
> > > > > Uwe Schindler
> > > > > H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > > > eMail: uwe@thetaphi.de
> >
> >
> >


Re: Forbidden-APIS no longer ran because of carzy POM change

Posted by Konstantin Gribov <gr...@gmail.com>.
Hi, Uwe.

There're several places where forbiddenapis will give errors in Tika.
I don't know if there is better way to fallback. E.g. in one of chm parser
classes:

try {
  dle.setName(new String(bytes, "UTF-8"));
catch (UnsupportedCharsetException e) {
  dle.setName(new String(bytes));
}

Can you add special annotation parsing (like
@SuppressWarnings("forbiddenapis") on element) to avoid emitting build
error in special cases like above mentioned?

-- 
Best regards,
Konstantin Gribov

Fri Jan 23 2015 at 15:10:18, Uwe Schindler <uw...@thetaphi.de>:

Here is the patch, mailing list swallowed it:
>
> Index: tika-parent/pom.xml
> ===================================================================
> --- tika-parent/pom.xml (revision 1654171)
> +++ tika-parent/pom.xml (working copy)
> @@ -274,7 +274,6 @@
>    </properties>
>
>    <build>
> -    <pluginManagement>
>        <plugins>
>          <plugin>
>            <artifactId>maven-compiler-plugin</artifactId>
> @@ -287,7 +286,7 @@
>          <plugin>
>            <groupId>de.thetaphi</groupId>
>            <artifactId>forbiddenapis</artifactId>
> -          <version>1.6.1</version>
> +          <version>1.7</version>
>            <configuration>
>              <targetVersion>${maven.compiler.target}</targetVersion>
>              <internalRuntimeForbidden>true</internalRuntimeForbidden>
> @@ -322,7 +321,6 @@
>            <version>2.3</version>
>          </plugin>
>        </plugins>
> -    </pluginManagement>
>    </build>
>
>    <profiles>
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > Sent: Friday, January 23, 2015 1:08 PM
> > To: dev@tika.apache.org
> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> >
> > The attached patch reverts the change and updates the forbidden plugin.
> >
> > Uwe
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de
> >
> >
> > > -----Original Message-----
> > > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > Sent: Friday, January 23, 2015 1:00 PM
> > > To: dev@tika.apache.org
> > > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> > >
> > > Here ist he explanation why the plugin is no longer called because of
> this:
> > >
> > > - Works for me too, but can anyone explain why? –  Andrew Swan May 15
> > > '13 at 6:26
> > > - @Andrew I think this works because m2e is not looking for plugins in
> > > pluginManagement, but only in build/plugins. In the Maven world, there
> > > is a difference between the two - the former defines "if you happen to
> > > use this plugin, here's the configuration to use", whereas the latter
> > > states "use this plugin". See this post and its top two answers. –
> > > GreenGiant Jul 5 '13 at 17:52
> > > - I agree with @GreenGiant. I tried this solution but it then breaks
> > > the compilation since the aspectj plugin is not called before
> > > compilation. –  Pierre Aug 30 '13 at 20:21
> > >
> > > This explains the change. In fact placing the plugins in
> > > pluginManagements disables them unless explicitely configured in a
> > > sub-module. So this commit should be reverted.
> > >
> > >
> > > In fact the bug described here no longer applies to later M2E
> > > installations. It still complains about plugins that Eclipse does not
> > > know about, but this does not prevent you from using Eclipse. So I
> > > would strongly ask to revert the commit because it breaks the build.
> > >
> > > Uwe
> > >
> > > -----
> > > Uwe Schindler
> > > H.-H.-Meier-Allee 63, D-28213 Bremen
> > > http://www.thetaphi.de
> > > eMail: uwe@thetaphi.de
> > >
> > >
> > > > -----Original Message-----
> > > > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > > Sent: Friday, January 23, 2015 12:11 PM
> > > > To: dev@tika.apache.org
> > > > Subject: Forbidden-APIS no longer ran because of carzy POM change
> > > >
> > > > Hi,
> > > >
> > > > I just noticed while checking the problems around the
> > > > ExternalParsers that the TIKA's build no longer runs the
> > > > forbidden-apis Maven plugin, so we got a few new violation
> > > > especially regarding the toUpper/LowerCase(). In fact the following
> > commit broke this:
> > > >
> > > > Revision: 1624185
> > > > Author: mattmann
> > > > Date: Donnerstag, 11. September 2014 05:11:19
> > > > Message:
> > > > surround in plugin management to resolve
> > > > http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> > > > execution-not-covered-by-lifecycle-configuration-for-sprin
> > > > ----
> > > > Modified : /tika/trunk/tika-parent/pom.xml
> > > >
> > > > Since that change, the plugin is no longer run by default. I have no
> > > > idea, why this is like this, but in fact this broke some of the
> > > > globally defined
> > > check tasks.
> > > > I have no idea how to reenable it easily.
> > > > So I cannot help, but reverting that commit restores behavior. What
> > > > is the reason for this commit, there is not even an issue about
> > > > that. I think it seems to be a workaround for some Eclipse issue,
> > > > but in fact this disables the whole plugins. To reenable
> > > > forbidden-apis you have to now explicitely enable it in every module
> > > > (because pluginManagement just gives the config of a plugin, where
> > > > without that it also enables its
> > > execution.
> > > >
> > > > In addition, there is already version 1.7 of forbiddenapis, so you
> > > > can replace
> > > > 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
> > > > with Java 8 and Java 9).
> > > >
> > > > The following new violations were found -> and in fact those broke
> > > > code in turkish locale:
> > > > [INFO]
> > > > --------------------------------------------------------------------
> > > > --
> > > > -- [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> > > > --------------------------
> > > > ----------------------------------------------
> > > > [INFO]
> > > > [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> > > > [INFO] Scanning for classes to check...
> > > > [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > > bundled API signatures: jdk-deprecated [INFO] Loading classes to
> check...
> > > > [INFO] Scanning for API signatures and dependencies...
> > > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > > [Uses default locale]
> > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > (BasicContentHandlerFactoryTest.java:79)
> > > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > > [Uses default locale]
> > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > (BasicContentHandlerFactoryTest.java:80)
> > > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > > [Uses default locale]
> > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > (BasicContentHandlerFactoryTest.java:88)
> > > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > > [Uses default locale]
> > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > (BasicContentHandlerFactoryTest.java:133)
> > > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > > [Uses default locale]
> > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > (BasicContentHandlerFactoryTest.java:176)
> > > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > > [Uses default locale]
> > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > (BasicContentHandlerFactoryTest.java:221)
> > > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > > [Uses default locale]
> > > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > (BasicContentHandlerFactoryTest.java:273)
> > > > [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
> > > > invocations (in 0.16s), 7 error(s).
> > > > [INFO]
> > > > --------------------------------------------------------------------
> > > > --
> > > > --
> > > > [...]
> > > > [INFO]
> > > > --------------------------------------------------------------------
> > > > --
> > > > -- [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> > > > ----------------------
> > > > --------------------------------------------------
> > > > [INFO]
> > > > [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
> > > > [INFO] Scanning for classes to check...
> > > > [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > > bundled API signatures: jdk-deprecated [INFO] Loading classes to
> check...
> > > > [INFO] Scanning for API signatures and dependencies...
> > > > [ERROR] Forbidden method invocation:
> > > > java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> > > > charset]
> > > > [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> > > > (TesseractOCRParser.java:309)
> > > > [ERROR] Forbidden method invocation:
> > > > java.lang.String#<init>(byte[],int,int)
> > > > [Uses default charset]
> > > > [ERROR]   in org.apache.tika.parser.chm.accessor.
> ChmDirectoryListingSet
> > > > (ChmDirectoryListingSet.java:240)
> > > > [ERROR] Forbidden method invocation:
> > > > java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
> locale]
> > > > [ERROR]   in
> > > > org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> > > > (ImageMetadataExtractor.java:304)
> > > > [ERROR] Forbidden method invocation:
> > > > java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
> > > > default locale]
> > > > [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> > > > (TesseractOCRConfig.java:214)
> > > > [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
> > > > API invocations (in 0.38s), 4 error(s).
> > > >
> > > > Uwe
> > > >
> > > > -----
> > > > Uwe Schindler
> > > > H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > > eMail: uwe@thetaphi.de
>
>
>

RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
Here is the patch, mailing list swallowed it:

Index: tika-parent/pom.xml
===================================================================
--- tika-parent/pom.xml	(revision 1654171)
+++ tika-parent/pom.xml	(working copy)
@@ -274,7 +274,6 @@
   </properties>
 
   <build>
-    <pluginManagement>
       <plugins>
         <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
@@ -287,7 +286,7 @@
         <plugin>
           <groupId>de.thetaphi</groupId>
           <artifactId>forbiddenapis</artifactId>
-          <version>1.6.1</version>
+          <version>1.7</version>
           <configuration>
             <targetVersion>${maven.compiler.target}</targetVersion>
             <internalRuntimeForbidden>true</internalRuntimeForbidden>
@@ -322,7 +321,6 @@
           <version>2.3</version>
         </plugin>
       </plugins>
-    </pluginManagement>
   </build>
 
   <profiles>

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> Sent: Friday, January 23, 2015 1:08 PM
> To: dev@tika.apache.org
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> The attached patch reverts the change and updates the forbidden plugin.
> 
> Uwe
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > Sent: Friday, January 23, 2015 1:00 PM
> > To: dev@tika.apache.org
> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> >
> > Here ist he explanation why the plugin is no longer called because of this:
> >
> > - Works for me too, but can anyone explain why? –  Andrew Swan May 15
> > '13 at 6:26
> > - @Andrew I think this works because m2e is not looking for plugins in
> > pluginManagement, but only in build/plugins. In the Maven world, there
> > is a difference between the two - the former defines "if you happen to
> > use this plugin, here's the configuration to use", whereas the latter
> > states "use this plugin". See this post and its top two answers. –
> > GreenGiant Jul 5 '13 at 17:52
> > - I agree with @GreenGiant. I tried this solution but it then breaks
> > the compilation since the aspectj plugin is not called before
> > compilation. –  Pierre Aug 30 '13 at 20:21
> >
> > This explains the change. In fact placing the plugins in
> > pluginManagements disables them unless explicitely configured in a
> > sub-module. So this commit should be reverted.
> >
> >
> > In fact the bug described here no longer applies to later M2E
> > installations. It still complains about plugins that Eclipse does not
> > know about, but this does not prevent you from using Eclipse. So I
> > would strongly ask to revert the commit because it breaks the build.
> >
> > Uwe
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de
> >
> >
> > > -----Original Message-----
> > > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > Sent: Friday, January 23, 2015 12:11 PM
> > > To: dev@tika.apache.org
> > > Subject: Forbidden-APIS no longer ran because of carzy POM change
> > >
> > > Hi,
> > >
> > > I just noticed while checking the problems around the
> > > ExternalParsers that the TIKA's build no longer runs the
> > > forbidden-apis Maven plugin, so we got a few new violation
> > > especially regarding the toUpper/LowerCase(). In fact the following
> commit broke this:
> > >
> > > Revision: 1624185
> > > Author: mattmann
> > > Date: Donnerstag, 11. September 2014 05:11:19
> > > Message:
> > > surround in plugin management to resolve
> > > http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> > > execution-not-covered-by-lifecycle-configuration-for-sprin
> > > ----
> > > Modified : /tika/trunk/tika-parent/pom.xml
> > >
> > > Since that change, the plugin is no longer run by default. I have no
> > > idea, why this is like this, but in fact this broke some of the
> > > globally defined
> > check tasks.
> > > I have no idea how to reenable it easily.
> > > So I cannot help, but reverting that commit restores behavior. What
> > > is the reason for this commit, there is not even an issue about
> > > that. I think it seems to be a workaround for some Eclipse issue,
> > > but in fact this disables the whole plugins. To reenable
> > > forbidden-apis you have to now explicitely enable it in every module
> > > (because pluginManagement just gives the config of a plugin, where
> > > without that it also enables its
> > execution.
> > >
> > > In addition, there is already version 1.7 of forbiddenapis, so you
> > > can replace
> > > 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
> > > with Java 8 and Java 9).
> > >
> > > The following new violations were found -> and in fact those broke
> > > code in turkish locale:
> > > [INFO]
> > > --------------------------------------------------------------------
> > > --
> > > -- [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> > > --------------------------
> > > ----------------------------------------------
> > > [INFO]
> > > [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> > > [INFO] Scanning for classes to check...
> > > [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > bundled API signatures: jdk-deprecated [INFO] Loading classes to check...
> > > [INFO] Scanning for API signatures and dependencies...
> > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > [Uses default locale]
> > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > (BasicContentHandlerFactoryTest.java:79)
> > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > [Uses default locale]
> > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > (BasicContentHandlerFactoryTest.java:80)
> > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > [Uses default locale]
> > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > (BasicContentHandlerFactoryTest.java:88)
> > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > [Uses default locale]
> > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > (BasicContentHandlerFactoryTest.java:133)
> > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > [Uses default locale]
> > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > (BasicContentHandlerFactoryTest.java:176)
> > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > [Uses default locale]
> > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > (BasicContentHandlerFactoryTest.java:221)
> > > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > > [Uses default locale]
> > > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > (BasicContentHandlerFactoryTest.java:273)
> > > [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
> > > invocations (in 0.16s), 7 error(s).
> > > [INFO]
> > > --------------------------------------------------------------------
> > > --
> > > --
> > > [...]
> > > [INFO]
> > > --------------------------------------------------------------------
> > > --
> > > -- [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> > > ----------------------
> > > --------------------------------------------------
> > > [INFO]
> > > [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
> > > [INFO] Scanning for classes to check...
> > > [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > bundled API signatures: jdk-deprecated [INFO] Loading classes to check...
> > > [INFO] Scanning for API signatures and dependencies...
> > > [ERROR] Forbidden method invocation:
> > > java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> > > charset]
> > > [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> > > (TesseractOCRParser.java:309)
> > > [ERROR] Forbidden method invocation:
> > > java.lang.String#<init>(byte[],int,int)
> > > [Uses default charset]
> > > [ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> > > (ChmDirectoryListingSet.java:240)
> > > [ERROR] Forbidden method invocation:
> > > java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default locale]
> > > [ERROR]   in
> > > org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> > > (ImageMetadataExtractor.java:304)
> > > [ERROR] Forbidden method invocation:
> > > java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
> > > default locale]
> > > [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> > > (TesseractOCRConfig.java:214)
> > > [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
> > > API invocations (in 0.38s), 4 error(s).
> > >
> > > Uwe
> > >
> > > -----
> > > Uwe Schindler
> > > H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > eMail: uwe@thetaphi.de



RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
The attached patch reverts the change and updates the forbidden plugin.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> Sent: Friday, January 23, 2015 1:00 PM
> To: dev@tika.apache.org
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> Here ist he explanation why the plugin is no longer called because of this:
> 
> - Works for me too, but can anyone explain why? –  Andrew Swan May 15 '13
> at 6:26
> - @Andrew I think this works because m2e is not looking for plugins in
> pluginManagement, but only in build/plugins. In the Maven world, there is a
> difference between the two - the former defines "if you happen to use this
> plugin, here's the configuration to use", whereas the latter states "use this
> plugin". See this post and its top two answers. –  GreenGiant Jul 5 '13 at 17:52
> - I agree with @GreenGiant. I tried this solution but it then breaks the
> compilation since the aspectj plugin is not called before compilation. –  Pierre
> Aug 30 '13 at 20:21
> 
> This explains the change. In fact placing the plugins in pluginManagements
> disables them unless explicitely configured in a sub-module. So this commit
> should be reverted.
> 
> 
> In fact the bug described here no longer applies to later M2E installations. It
> still complains about plugins that Eclipse does not know about, but this does
> not prevent you from using Eclipse. So I would strongly ask to revert the
> commit because it breaks the build.
> 
> Uwe
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > Sent: Friday, January 23, 2015 12:11 PM
> > To: dev@tika.apache.org
> > Subject: Forbidden-APIS no longer ran because of carzy POM change
> >
> > Hi,
> >
> > I just noticed while checking the problems around the ExternalParsers
> > that the TIKA's build no longer runs the forbidden-apis Maven plugin,
> > so we got a few new violation especially regarding the
> > toUpper/LowerCase(). In fact the following commit broke this:
> >
> > Revision: 1624185
> > Author: mattmann
> > Date: Donnerstag, 11. September 2014 05:11:19
> > Message:
> > surround in plugin management to resolve
> > http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> > execution-not-covered-by-lifecycle-configuration-for-sprin
> > ----
> > Modified : /tika/trunk/tika-parent/pom.xml
> >
> > Since that change, the plugin is no longer run by default. I have no
> > idea, why this is like this, but in fact this broke some of the globally defined
> check tasks.
> > I have no idea how to reenable it easily.
> > So I cannot help, but reverting that commit restores behavior. What is
> > the reason for this commit, there is not even an issue about that. I
> > think it seems to be a workaround for some Eclipse issue, but in fact
> > this disables the whole plugins. To reenable forbidden-apis you have
> > to now explicitely enable it in every module (because pluginManagement
> > just gives the config of a plugin, where without that it also enables its
> execution.
> >
> > In addition, there is already version 1.7 of forbiddenapis, so you can
> > replace
> > 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs with
> > Java 8 and Java 9).
> >
> > The following new violations were found -> and in fact those broke
> > code in turkish locale:
> > [INFO]
> > ----------------------------------------------------------------------
> > -- [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> > --------------------------
> > ----------------------------------------------
> > [INFO]
> > [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> > [INFO] Scanning for classes to check...
> > [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > bundled API signatures: jdk-deprecated [INFO] Loading classes to check...
> > [INFO] Scanning for API signatures and dependencies...
> > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > [Uses default locale]
> > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > (BasicContentHandlerFactoryTest.java:79)
> > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > [Uses default locale]
> > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > (BasicContentHandlerFactoryTest.java:80)
> > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > [Uses default locale]
> > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > (BasicContentHandlerFactoryTest.java:88)
> > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > [Uses default locale]
> > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > (BasicContentHandlerFactoryTest.java:133)
> > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > [Uses default locale]
> > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > (BasicContentHandlerFactoryTest.java:176)
> > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > [Uses default locale]
> > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > (BasicContentHandlerFactoryTest.java:221)
> > [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > [Uses default locale]
> > [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > (BasicContentHandlerFactoryTest.java:273)
> > [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
> > invocations (in 0.16s), 7 error(s).
> > [INFO]
> > ----------------------------------------------------------------------
> > --
> > [...]
> > [INFO]
> > ----------------------------------------------------------------------
> > -- [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> > ----------------------
> > --------------------------------------------------
> > [INFO]
> > [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
> > [INFO] Scanning for classes to check...
> > [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > bundled API signatures: jdk-deprecated [INFO] Loading classes to check...
> > [INFO] Scanning for API signatures and dependencies...
> > [ERROR] Forbidden method invocation:
> > java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> > charset]
> > [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> > (TesseractOCRParser.java:309)
> > [ERROR] Forbidden method invocation:
> > java.lang.String#<init>(byte[],int,int)
> > [Uses default charset]
> > [ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> > (ChmDirectoryListingSet.java:240)
> > [ERROR] Forbidden method invocation:
> > java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default locale]
> > [ERROR]   in
> > org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> > (ImageMetadataExtractor.java:304)
> > [ERROR] Forbidden method invocation:
> > java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
> > default locale]
> > [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> > (TesseractOCRConfig.java:214)
> > [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API
> > invocations (in 0.38s), 4 error(s).
> >
> > Uwe
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de


Re: Forbidden-APIS no longer ran because of carzy POM change

Posted by "Mattmann, Chris A (3980)" <ch...@jpl.nasa.gov>.
woot thanks dude

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: chris.a.mattmann@nasa.gov
WWW:  http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Uwe Schindler <uw...@thetaphi.de>
Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
Date: Friday, January 23, 2015 at 2:17 PM
To: "dev@tika.apache.org" <de...@tika.apache.org>
Subject: RE: Forbidden-APIS no longer ran because of carzy POM change

>Works fine here!
>
>After I removed the manual override of the plugin lifecycle settings,
>restart, & maven update, TIKA built successfully. So the setting in
>Parent POM is enough.
>I will update the forbidden-apis documentation to help others, too.
>
>Uwe
>
>-----
>Uwe Schindler
>H.-H.-Meier-Allee 63, D-28213 Bremen
>http://www.thetaphi.de
>eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> Sent: Friday, January 23, 2015 9:08 PM
>> To: dev@tika.apache.org
>> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
>> 
>> Hi Timothy,
>> 
>> Your commit looks fine. Basically, this <pluginManagement> section is
>>just
>> containing some "fake" plugin that is never actively executed, but used
>>by
>> Eclipse to detect which plugins map to internal lifecycles of the
>>Eclipse IDE. It
>> uses this to map for example how to execute the "compile" maven plugin
>> inside Eclipse (use ECJ compiler) or let the surefire plugin map to the
>>internal
>> Eclipse test runner.
>> 
>> Our addition through the parent POM just tells eclipse how to map the
>> forbidden-apis plugin: To *nothing*, just ignore it inside the Eclipse
>>IDE.
>> 
>> I will try it with Eclipse later, to make sure all is fine. But looks
>>good to me. I
>> have not yet tried the setup with parent POMs, but I assume this should
>>be
>> fine.
>> 
>> Uwe
>> 
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>> 
>> 
>> > -----Original Message-----
>> > From: Allison, Timothy B. [mailto:tallison@mitre.org]
>> > Sent: Friday, January 23, 2015 8:35 PM
>> > To: dev@tika.apache.org
>> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
>> >
>> > Uwe,
>> >   To confirm, we need to add this
>> > <pluginManagement>...</pluginManagement> fully as it is in the parent
>> > pom.xml, we should not put the plugin under our regular plugins (which
>> > no longer have <pluginManagement>?
>> >
>> > -----Original Message-----
>> > From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> > Sent: Friday, January 23, 2015 11:47 AM
>> > To: dev@tika.apache.org
>> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
>> >
>> > Hi,
>> >
>> > I did further investigation. I had the plugin disabled in my eclipse
>> > (you can do this in quick fix for the whole workspace). In fact, if
>> > you remove the disable thing, it fails also in Eclipse Luna.
>> >
>> > If we want to make the plugin automatically "hidden" to all Eclipse
>> > versions through our own POM file - this is what the quick fix also
>> > allows to do for the current project:
>> >
>> >     <pluginManagement>
>> >     	<plugins>
>> >     		<!--This plugin's configuration is used to store Eclipse m2e
>> > settings only. It has no influence on the Maven build itself.-->
>> >     		<plugin>
>> >     			<groupId>org.eclipse.m2e</groupId>
>> >     			<artifactId>lifecycle-mapping</artifactId>
>> >     			<version>1.0.0</version>
>> >     			<configuration>
>> >     				<lifecycleMappingMetadata>
>> >     					<pluginExecutions>
>> >     						<pluginExecution>
>> >
>> > 	<pluginExecutionFilter>
>> >
>> > 	<groupId>de.thetaphi</groupId>
>> >
>> > 	<artifactId>forbiddenapis</artifactId>
>> >
>> > 	<versionRange>[1.0,)</versionRange>
>> >     								<goals>
>> >
>> > 	<goal>check</goal>
>> >
>> > 	<goal>testCheck</goal>
>> >     								</goals>
>> >
>> > 	</pluginExecutionFilter>
>> >     							<action>
>> >     								<ignore/>
>> >     							</action>
>> >     						</pluginExecution>
>> >     					</pluginExecutions>
>> >     				</lifecycleMappingMetadata>
>> >     			</configuration>
>> >     		</plugin>
>> >     	</plugins>
>> >     </pluginManagement>
>> >
>> > This can be put in to tika-parent's POM.
>> >
>> > -----
>> > Uwe Schindler
>> > H.-H.-Meier-Allee 63, D-28213 Bremen
>> > http://www.thetaphi.de
>> > eMail: uwe@thetaphi.de
>> >
>> >
>> > > -----Original Message-----
>> > > From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> > > Sent: Friday, January 23, 2015 5:18 PM
>> > > To: dev@tika.apache.org
>> > > Subject: RE: Forbidden-APIS no longer ran because of carzy POM
>> > > change
>> > >
>> > > Hi, this may also help, it also brings the needed information:
>> > >
>> > > https://www.eclipse.org/m2e/documentation/m2e-execution-not-
>> > > covered.html
>> > >
>> > > In fact the problem is: Eclipse has no idea how this plugin should
>> > > be executed internally in Eclipse. But as this is just a "check
>>plugin"
>> > > that does not affect the build output at all, you can leave it
>>disabled.
>> > >
>> > > If you scroll down, you see that Eclipse 4.2+ fixes this problem:
>> > > Disable the plugin for Maven using Project properties -> Maven ->
>> > > Lifecycle mappings -> ignore
>> > >
>> > > -----
>> > > Uwe Schindler
>> > > H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
>> > > eMail: uwe@thetaphi.de
>> > >
>> > >
>> > > > -----Original Message-----
>> > > > From: Mattmann, Chris A (3980)
>> > > > [mailto:chris.a.mattmann@jpl.nasa.gov]
>> > > > Sent: Friday, January 23, 2015 4:13 PM
>> > > > To: dev@tika.apache.org
>> > > > Subject: Re: Forbidden-APIS no longer ran because of carzy POM
>> > > > change
>> > > >
>> > > > Hi Uwe,
>> > > >
>> > > > Thanks. I will check it out. Like I said, I’m not OK reverting
>> > > > anything if my Eclipse keeps complaining at me so we’ll need a fix
>> > > > that handles both. Let me try with the latest version of Eclipse
>>and
>> > > > m2e and see if (with your patch) the issue goes away.
>> > > >
>> > > > Cheers,
>> > > > Chris
>> > > >
>> > > >
>> > >
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > > > ++++++++
>> > > > Chris Mattmann, Ph.D.
>> > > > Chief Architect
>> > > > Instrument Software and Science Data Systems Section (398) NASA
>>Jet
>> > > > Propulsion Laboratory Pasadena, CA 91109 USA
>> > > > Office: 168-519, Mailstop: 168-527
>> > > > Email: chris.a.mattmann@nasa.gov
>> > > > WWW:  http://sunset.usc.edu/~mattmann/
>> > > >
>> > >
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > > > ++++++++
>> > > > Adjunct Associate Professor, Computer Science Department
>>University
>> > > > of Southern California, Los Angeles, CA 90089 USA
>> > > >
>> > >
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > > > ++++++++
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > -----Original Message-----
>> > > > From: Uwe Schindler <uw...@thetaphi.de>
>> > > > Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
>> > > > Date: Friday, January 23, 2015 at 3:59 AM
>> > > > To: "dev@tika.apache.org" <de...@tika.apache.org>
>> > > > Subject: RE: Forbidden-APIS no longer ran because of carzy POM
>> > > > change
>> > > >
>> > > > >Here ist he explanation why the plugin is no longer called
>>because
>> > > > >of
>> > > > >this:
>> > > > >
>> > > > >- Works for me too, but can anyone explain why? –  Andrew Swan
>> May
>> > > > >15
>> > > > '13
>> > > > >at 6:26
>> > > > >- @Andrew I think this works because m2e is not looking for
>>plugins
>> > > > >in pluginManagement, but only in build/plugins. In the Maven
>>world,
>> > > > >there is a difference between the two - the former defines "if
>>you
>> > > > >happen to use this plugin, here's the configuration to use",
>> > > > >whereas the latter states "use this plugin". See this post and
>>its
>> > > > >top two answers. – GreenGiant Jul 5 '13 at 17:52
>> > > > >- I agree with @GreenGiant. I tried this solution but it then
>> > > > >breaks the compilation since the aspectj plugin is not called
>> > > > >before compilation. – Pierre Aug 30 '13 at 20:21
>> > > > >
>> > > > >This explains the change. In fact placing the plugins in
>> > > > >pluginManagements disables them unless explicitely configured in
>>a
>> > > > >sub-module. So this commit should be reverted.
>> > > > >
>> > > > >
>> > > > >In fact the bug described here no longer applies to later M2E
>> > > > >installations. It still complains about plugins that Eclipse does
>> > > > >not know about, but this does not prevent you from using Eclipse.
>> > > > >So I would strongly ask to revert the commit because it breaks
>>the
>> build.
>> > > > >
>> > > > >Uwe
>> > > > >
>> > > > >-----
>> > > > >Uwe Schindler
>> > > > >H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
>> > > > >eMail: uwe@thetaphi.de
>> > > > >
>> > > > >
>> > > > >> -----Original Message-----
>> > > > >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> > > > >> Sent: Friday, January 23, 2015 12:11 PM
>> > > > >> To: dev@tika.apache.org
>> > > > >> Subject: Forbidden-APIS no longer ran because of carzy POM
>>change
>> > > > >>
>> > > > >> Hi,
>> > > > >>
>> > > > >> I just noticed while checking the problems around the
>> > > > >>ExternalParsers that  the TIKA's build no longer runs the
>> > > > >>forbidden-apis Maven plugin, so we got a  few new violation
>> > > > >>especially regarding the toUpper/LowerCase(). In fact the
>> > > > >>following
>> > > commit broke this:
>> > > > >>
>> > > > >> Revision: 1624185
>> > > > >> Author: mattmann
>> > > > >> Date: Donnerstag, 11. September 2014 05:11:19
>> > > > >> Message:
>> > > > >> surround in plugin management to resolve
>> > > > >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
>> > > > >> execution-not-covered-by-lifecycle-configuration-for-sprin
>> > > > >> ----
>> > > > >> Modified : /tika/trunk/tika-parent/pom.xml
>> > > > >>
>> > > > >> Since that change, the plugin is no longer run by default. I
>>have
>> > > > >>no idea, why  this is like this, but in fact this broke some of
>> > > > >>the globally defined check tasks.
>> > > > >> I have no idea how to reenable it easily.
>> > > > >> So I cannot help, but reverting that commit restores behavior.
>> > > > >>What is the  reason for this commit, there is not even an issue
>>about
>> > that.
>> > > > >>I think it seems  to be a workaround for some Eclipse issue, but
>> > > > >>in fact this disables the whole  plugins. To reenable
>> > > > >>forbidden-apis you have to now explicitely enable it in  every
>> > > > >>module (because pluginManagement just gives the config of a
>> > > > >>plugin,  where without that it also enables its execution.
>> > > > >>
>> > > > >> In addition, there is already version 1.7 of forbiddenapis, so
>> > > > >>you can replace
>> > > > >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few
>>bugs
>> > > > >>with Java 8  and Java 9).
>> > > > >>
>> > > > >> The following new violations were found -> and in fact those
>> > > > >>broke code in  turkish locale:
>> > > > >> [INFO]
>> > > > 
>>>>------------------------------------------------------------------
>> > > > >>--
>> > > > >>--
>> > > > >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
>> > > > >>--------------------------
>> > > > >> ----------------------------------------------
>> > > > >> [INFO]
>> > > > >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core
>>---
>> > > > >>[INFO]  Scanning for classes to check...
>> > > > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO]
>>Reading
>> > > > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes
>>to
>> > > check...
>> > > > >> [INFO] Scanning for API signatures and dependencies...
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >>java.lang.String#toLowerCase() [Uses default locale]
>> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > > > >> (BasicContentHandlerFactoryTest.java:79)
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >>java.lang.String#toLowerCase() [Uses default locale]
>> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > > > >> (BasicContentHandlerFactoryTest.java:80)
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >>java.lang.String#toLowerCase() [Uses default locale]
>> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > > > >> (BasicContentHandlerFactoryTest.java:88)
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >>java.lang.String#toLowerCase() [Uses default locale]
>> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > > > >> (BasicContentHandlerFactoryTest.java:133)
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >>java.lang.String#toLowerCase() [Uses default locale]
>> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > > > >> (BasicContentHandlerFactoryTest.java:176)
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >>java.lang.String#toLowerCase() [Uses default locale]
>> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > > > >> (BasicContentHandlerFactoryTest.java:221)
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >>java.lang.String#toLowerCase() [Uses default locale]
>> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > > > >> (BasicContentHandlerFactoryTest.java:273)
>> > > > >> [ERROR] Scanned 52 (and 331 related) class file(s) for
>>forbidden
>> > > > >>API invocations (in 0.16s), 7 error(s).
>> > > > >> [INFO]
>> > > > 
>>>>------------------------------------------------------------------
>> > > > >>--
>> > > > >>--
>> > > > >>--
>> > > > >> [...]
>> > > > >> [INFO]
>> > > > 
>>>>------------------------------------------------------------------
>> > > > >>--
>> > > > >>--
>> > > > >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
>> > > > >>----------------------
>> > > > >> --------------------------------------------------
>> > > > >> [INFO]
>> > > > >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers
>> > > > >>--- [INFO]  Scanning for classes to check...
>> > > > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO]
>>Reading
>> > > > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes
>>to
>> > > check...
>> > > > >> [INFO] Scanning for API signatures and dependencies...
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses
>> > > > >>default charset]
>> > > > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
>> > > > >> (TesseractOCRParser.java:309)
>> > > > >> [ERROR] Forbidden method invocation:
>> > > > >>java.lang.String#<init>(byte[],int,int)
>> > > > >> [Uses default charset]
>> > > > >> [ERROR]   in
>> > > org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
>> > > > >> (ChmDirectoryListingSet.java:240)  [ERROR] Forbidden method
>> > > > >>invocation:
>> > > > >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses
>>default
>> > > > >>locale]
>> > > > >> [ERROR]   in
>> > > > >>
>> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
>> > > > >> (ImageMetadataExtractor.java:304)  [ERROR] Forbidden method
>> > > > >>invocation:
>> > > > >> java.lang.String#format(java.lang.String,java.lang.Object[])
>> > > > >>[Uses default  locale]
>> > > > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
>> > > > >> (TesseractOCRConfig.java:214)
>> > > > >> [ERROR] Scanned 281 (and 813 related) class file(s) for
>>forbidden
>> > > > >>API invocations (in 0.38s), 4 error(s).
>> > > > >>
>> > > > >> Uwe
>> > > > >>
>> > > > >> -----
>> > > > >> Uwe Schindler
>> > > > >> H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
>> > > > >> eMail: uwe@thetaphi.de
>> > > > >
>> > > > >
>> >
>
>


RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
Works fine here!

After I removed the manual override of the plugin lifecycle settings, restart, & maven update, TIKA built successfully. So the setting in Parent POM is enough.
I will update the forbidden-apis documentation to help others, too.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> Sent: Friday, January 23, 2015 9:08 PM
> To: dev@tika.apache.org
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> Hi Timothy,
> 
> Your commit looks fine. Basically, this <pluginManagement> section is just
> containing some "fake" plugin that is never actively executed, but used by
> Eclipse to detect which plugins map to internal lifecycles of the Eclipse IDE. It
> uses this to map for example how to execute the "compile" maven plugin
> inside Eclipse (use ECJ compiler) or let the surefire plugin map to the internal
> Eclipse test runner.
> 
> Our addition through the parent POM just tells eclipse how to map the
> forbidden-apis plugin: To *nothing*, just ignore it inside the Eclipse IDE.
> 
> I will try it with Eclipse later, to make sure all is fine. But looks good to me. I
> have not yet tried the setup with parent POMs, but I assume this should be
> fine.
> 
> Uwe
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Allison, Timothy B. [mailto:tallison@mitre.org]
> > Sent: Friday, January 23, 2015 8:35 PM
> > To: dev@tika.apache.org
> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> >
> > Uwe,
> >   To confirm, we need to add this
> > <pluginManagement>...</pluginManagement> fully as it is in the parent
> > pom.xml, we should not put the plugin under our regular plugins (which
> > no longer have <pluginManagement>?
> >
> > -----Original Message-----
> > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > Sent: Friday, January 23, 2015 11:47 AM
> > To: dev@tika.apache.org
> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> >
> > Hi,
> >
> > I did further investigation. I had the plugin disabled in my eclipse
> > (you can do this in quick fix for the whole workspace). In fact, if
> > you remove the disable thing, it fails also in Eclipse Luna.
> >
> > If we want to make the plugin automatically "hidden" to all Eclipse
> > versions through our own POM file - this is what the quick fix also
> > allows to do for the current project:
> >
> >     <pluginManagement>
> >     	<plugins>
> >     		<!--This plugin's configuration is used to store Eclipse m2e
> > settings only. It has no influence on the Maven build itself.-->
> >     		<plugin>
> >     			<groupId>org.eclipse.m2e</groupId>
> >     			<artifactId>lifecycle-mapping</artifactId>
> >     			<version>1.0.0</version>
> >     			<configuration>
> >     				<lifecycleMappingMetadata>
> >     					<pluginExecutions>
> >     						<pluginExecution>
> >
> > 	<pluginExecutionFilter>
> >
> > 	<groupId>de.thetaphi</groupId>
> >
> > 	<artifactId>forbiddenapis</artifactId>
> >
> > 	<versionRange>[1.0,)</versionRange>
> >     								<goals>
> >
> > 	<goal>check</goal>
> >
> > 	<goal>testCheck</goal>
> >     								</goals>
> >
> > 	</pluginExecutionFilter>
> >     							<action>
> >     								<ignore/>
> >     							</action>
> >     						</pluginExecution>
> >     					</pluginExecutions>
> >     				</lifecycleMappingMetadata>
> >     			</configuration>
> >     		</plugin>
> >     	</plugins>
> >     </pluginManagement>
> >
> > This can be put in to tika-parent's POM.
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de
> >
> >
> > > -----Original Message-----
> > > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > Sent: Friday, January 23, 2015 5:18 PM
> > > To: dev@tika.apache.org
> > > Subject: RE: Forbidden-APIS no longer ran because of carzy POM
> > > change
> > >
> > > Hi, this may also help, it also brings the needed information:
> > >
> > > https://www.eclipse.org/m2e/documentation/m2e-execution-not-
> > > covered.html
> > >
> > > In fact the problem is: Eclipse has no idea how this plugin should
> > > be executed internally in Eclipse. But as this is just a "check plugin"
> > > that does not affect the build output at all, you can leave it disabled.
> > >
> > > If you scroll down, you see that Eclipse 4.2+ fixes this problem:
> > > Disable the plugin for Maven using Project properties -> Maven ->
> > > Lifecycle mappings -> ignore
> > >
> > > -----
> > > Uwe Schindler
> > > H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > eMail: uwe@thetaphi.de
> > >
> > >
> > > > -----Original Message-----
> > > > From: Mattmann, Chris A (3980)
> > > > [mailto:chris.a.mattmann@jpl.nasa.gov]
> > > > Sent: Friday, January 23, 2015 4:13 PM
> > > > To: dev@tika.apache.org
> > > > Subject: Re: Forbidden-APIS no longer ran because of carzy POM
> > > > change
> > > >
> > > > Hi Uwe,
> > > >
> > > > Thanks. I will check it out. Like I said, I’m not OK reverting
> > > > anything if my Eclipse keeps complaining at me so we’ll need a fix
> > > > that handles both. Let me try with the latest version of Eclipse and
> > > > m2e and see if (with your patch) the issue goes away.
> > > >
> > > > Cheers,
> > > > Chris
> > > >
> > > >
> > >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > > ++++++++
> > > > Chris Mattmann, Ph.D.
> > > > Chief Architect
> > > > Instrument Software and Science Data Systems Section (398) NASA Jet
> > > > Propulsion Laboratory Pasadena, CA 91109 USA
> > > > Office: 168-519, Mailstop: 168-527
> > > > Email: chris.a.mattmann@nasa.gov
> > > > WWW:  http://sunset.usc.edu/~mattmann/
> > > >
> > >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > > ++++++++
> > > > Adjunct Associate Professor, Computer Science Department University
> > > > of Southern California, Los Angeles, CA 90089 USA
> > > >
> > >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > > ++++++++
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Uwe Schindler <uw...@thetaphi.de>
> > > > Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
> > > > Date: Friday, January 23, 2015 at 3:59 AM
> > > > To: "dev@tika.apache.org" <de...@tika.apache.org>
> > > > Subject: RE: Forbidden-APIS no longer ran because of carzy POM
> > > > change
> > > >
> > > > >Here ist he explanation why the plugin is no longer called because
> > > > >of
> > > > >this:
> > > > >
> > > > >- Works for me too, but can anyone explain why? –  Andrew Swan
> May
> > > > >15
> > > > '13
> > > > >at 6:26
> > > > >- @Andrew I think this works because m2e is not looking for plugins
> > > > >in pluginManagement, but only in build/plugins. In the Maven world,
> > > > >there is a difference between the two - the former defines "if you
> > > > >happen to use this plugin, here's the configuration to use",
> > > > >whereas the latter states "use this plugin". See this post and its
> > > > >top two answers. – GreenGiant Jul 5 '13 at 17:52
> > > > >- I agree with @GreenGiant. I tried this solution but it then
> > > > >breaks the compilation since the aspectj plugin is not called
> > > > >before compilation. – Pierre Aug 30 '13 at 20:21
> > > > >
> > > > >This explains the change. In fact placing the plugins in
> > > > >pluginManagements disables them unless explicitely configured in a
> > > > >sub-module. So this commit should be reverted.
> > > > >
> > > > >
> > > > >In fact the bug described here no longer applies to later M2E
> > > > >installations. It still complains about plugins that Eclipse does
> > > > >not know about, but this does not prevent you from using Eclipse.
> > > > >So I would strongly ask to revert the commit because it breaks the
> build.
> > > > >
> > > > >Uwe
> > > > >
> > > > >-----
> > > > >Uwe Schindler
> > > > >H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > > >eMail: uwe@thetaphi.de
> > > > >
> > > > >
> > > > >> -----Original Message-----
> > > > >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > > >> Sent: Friday, January 23, 2015 12:11 PM
> > > > >> To: dev@tika.apache.org
> > > > >> Subject: Forbidden-APIS no longer ran because of carzy POM change
> > > > >>
> > > > >> Hi,
> > > > >>
> > > > >> I just noticed while checking the problems around the
> > > > >>ExternalParsers that  the TIKA's build no longer runs the
> > > > >>forbidden-apis Maven plugin, so we got a  few new violation
> > > > >>especially regarding the toUpper/LowerCase(). In fact the
> > > > >>following
> > > commit broke this:
> > > > >>
> > > > >> Revision: 1624185
> > > > >> Author: mattmann
> > > > >> Date: Donnerstag, 11. September 2014 05:11:19
> > > > >> Message:
> > > > >> surround in plugin management to resolve
> > > > >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> > > > >> execution-not-covered-by-lifecycle-configuration-for-sprin
> > > > >> ----
> > > > >> Modified : /tika/trunk/tika-parent/pom.xml
> > > > >>
> > > > >> Since that change, the plugin is no longer run by default. I have
> > > > >>no idea, why  this is like this, but in fact this broke some of
> > > > >>the globally defined check tasks.
> > > > >> I have no idea how to reenable it easily.
> > > > >> So I cannot help, but reverting that commit restores behavior.
> > > > >>What is the  reason for this commit, there is not even an issue about
> > that.
> > > > >>I think it seems  to be a workaround for some Eclipse issue, but
> > > > >>in fact this disables the whole  plugins. To reenable
> > > > >>forbidden-apis you have to now explicitely enable it in  every
> > > > >>module (because pluginManagement just gives the config of a
> > > > >>plugin,  where without that it also enables its execution.
> > > > >>
> > > > >> In addition, there is already version 1.7 of forbiddenapis, so
> > > > >>you can replace
> > > > >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
> > > > >>with Java 8  and Java 9).
> > > > >>
> > > > >> The following new violations were found -> and in fact those
> > > > >>broke code in  turkish locale:
> > > > >> [INFO]
> > > > >>------------------------------------------------------------------
> > > > >>--
> > > > >>--
> > > > >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> > > > >>--------------------------
> > > > >> ----------------------------------------------
> > > > >> [INFO]
> > > > >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> > > > >>[INFO]  Scanning for classes to check...
> > > > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> > > check...
> > > > >> [INFO] Scanning for API signatures and dependencies...
> > > > >> [ERROR] Forbidden method invocation:
> > > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > >> (BasicContentHandlerFactoryTest.java:79)
> > > > >> [ERROR] Forbidden method invocation:
> > > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > >> (BasicContentHandlerFactoryTest.java:80)
> > > > >> [ERROR] Forbidden method invocation:
> > > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > >> (BasicContentHandlerFactoryTest.java:88)
> > > > >> [ERROR] Forbidden method invocation:
> > > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > >> (BasicContentHandlerFactoryTest.java:133)
> > > > >> [ERROR] Forbidden method invocation:
> > > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > >> (BasicContentHandlerFactoryTest.java:176)
> > > > >> [ERROR] Forbidden method invocation:
> > > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > >> (BasicContentHandlerFactoryTest.java:221)
> > > > >> [ERROR] Forbidden method invocation:
> > > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > > >> (BasicContentHandlerFactoryTest.java:273)
> > > > >> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden
> > > > >>API invocations (in 0.16s), 7 error(s).
> > > > >> [INFO]
> > > > >>------------------------------------------------------------------
> > > > >>--
> > > > >>--
> > > > >>--
> > > > >> [...]
> > > > >> [INFO]
> > > > >>------------------------------------------------------------------
> > > > >>--
> > > > >>--
> > > > >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> > > > >>----------------------
> > > > >> --------------------------------------------------
> > > > >> [INFO]
> > > > >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers
> > > > >>--- [INFO]  Scanning for classes to check...
> > > > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> > > check...
> > > > >> [INFO] Scanning for API signatures and dependencies...
> > > > >> [ERROR] Forbidden method invocation:
> > > > >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses
> > > > >>default charset]
> > > > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> > > > >> (TesseractOCRParser.java:309)
> > > > >> [ERROR] Forbidden method invocation:
> > > > >>java.lang.String#<init>(byte[],int,int)
> > > > >> [Uses default charset]
> > > > >> [ERROR]   in
> > > org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> > > > >> (ChmDirectoryListingSet.java:240)  [ERROR] Forbidden method
> > > > >>invocation:
> > > > >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
> > > > >>locale]
> > > > >> [ERROR]   in
> > > > >>
> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> > > > >> (ImageMetadataExtractor.java:304)  [ERROR] Forbidden method
> > > > >>invocation:
> > > > >> java.lang.String#format(java.lang.String,java.lang.Object[])
> > > > >>[Uses default  locale]
> > > > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> > > > >> (TesseractOCRConfig.java:214)
> > > > >> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
> > > > >>API invocations (in 0.38s), 4 error(s).
> > > > >>
> > > > >> Uwe
> > > > >>
> > > > >> -----
> > > > >> Uwe Schindler
> > > > >> H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > > >> eMail: uwe@thetaphi.de
> > > > >
> > > > >
> >



RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi Timothy,

Your commit looks fine. Basically, this <pluginManagement> section is just containing some "fake" plugin that is never actively executed, but used by Eclipse to detect which plugins map to internal lifecycles of the Eclipse IDE. It uses this to map for example how to execute the "compile" maven plugin inside Eclipse (use ECJ compiler) or let the surefire plugin map to the internal Eclipse test runner.

Our addition through the parent POM just tells eclipse how to map the forbidden-apis plugin: To *nothing*, just ignore it inside the Eclipse IDE.

I will try it with Eclipse later, to make sure all is fine. But looks good to me. I have not yet tried the setup with parent POMs, but I assume this should be fine.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Allison, Timothy B. [mailto:tallison@mitre.org]
> Sent: Friday, January 23, 2015 8:35 PM
> To: dev@tika.apache.org
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> Uwe,
>   To confirm, we need to add this
> <pluginManagement>...</pluginManagement> fully as it is in the parent
> pom.xml, we should not put the plugin under our regular plugins (which no
> longer have <pluginManagement>?
> 
> -----Original Message-----
> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> Sent: Friday, January 23, 2015 11:47 AM
> To: dev@tika.apache.org
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> Hi,
> 
> I did further investigation. I had the plugin disabled in my eclipse (you can do
> this in quick fix for the whole workspace). In fact, if you remove the disable
> thing, it fails also in Eclipse Luna.
> 
> If we want to make the plugin automatically "hidden" to all Eclipse versions
> through our own POM file - this is what the quick fix also allows to do for the
> current project:
> 
>     <pluginManagement>
>     	<plugins>
>     		<!--This plugin's configuration is used to store Eclipse m2e
> settings only. It has no influence on the Maven build itself.-->
>     		<plugin>
>     			<groupId>org.eclipse.m2e</groupId>
>     			<artifactId>lifecycle-mapping</artifactId>
>     			<version>1.0.0</version>
>     			<configuration>
>     				<lifecycleMappingMetadata>
>     					<pluginExecutions>
>     						<pluginExecution>
> 
> 	<pluginExecutionFilter>
> 
> 	<groupId>de.thetaphi</groupId>
> 
> 	<artifactId>forbiddenapis</artifactId>
> 
> 	<versionRange>[1.0,)</versionRange>
>     								<goals>
> 
> 	<goal>check</goal>
> 
> 	<goal>testCheck</goal>
>     								</goals>
> 
> 	</pluginExecutionFilter>
>     							<action>
>     								<ignore/>
>     							</action>
>     						</pluginExecution>
>     					</pluginExecutions>
>     				</lifecycleMappingMetadata>
>     			</configuration>
>     		</plugin>
>     	</plugins>
>     </pluginManagement>
> 
> This can be put in to tika-parent's POM.
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > Sent: Friday, January 23, 2015 5:18 PM
> > To: dev@tika.apache.org
> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> >
> > Hi, this may also help, it also brings the needed information:
> >
> > https://www.eclipse.org/m2e/documentation/m2e-execution-not-
> > covered.html
> >
> > In fact the problem is: Eclipse has no idea how this plugin should be
> > executed internally in Eclipse. But as this is just a "check plugin"
> > that does not affect the build output at all, you can leave it disabled.
> >
> > If you scroll down, you see that Eclipse 4.2+ fixes this problem:
> > Disable the plugin for Maven using Project properties -> Maven ->
> > Lifecycle mappings -> ignore
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de
> >
> >
> > > -----Original Message-----
> > > From: Mattmann, Chris A (3980)
> > > [mailto:chris.a.mattmann@jpl.nasa.gov]
> > > Sent: Friday, January 23, 2015 4:13 PM
> > > To: dev@tika.apache.org
> > > Subject: Re: Forbidden-APIS no longer ran because of carzy POM
> > > change
> > >
> > > Hi Uwe,
> > >
> > > Thanks. I will check it out. Like I said, I’m not OK reverting
> > > anything if my Eclipse keeps complaining at me so we’ll need a fix
> > > that handles both. Let me try with the latest version of Eclipse and
> > > m2e and see if (with your patch) the issue goes away.
> > >
> > > Cheers,
> > > Chris
> > >
> > >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > ++++++++
> > > Chris Mattmann, Ph.D.
> > > Chief Architect
> > > Instrument Software and Science Data Systems Section (398) NASA Jet
> > > Propulsion Laboratory Pasadena, CA 91109 USA
> > > Office: 168-519, Mailstop: 168-527
> > > Email: chris.a.mattmann@nasa.gov
> > > WWW:  http://sunset.usc.edu/~mattmann/
> > >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > ++++++++
> > > Adjunct Associate Professor, Computer Science Department University
> > > of Southern California, Los Angeles, CA 90089 USA
> > >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > ++++++++
> > >
> > >
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Uwe Schindler <uw...@thetaphi.de>
> > > Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
> > > Date: Friday, January 23, 2015 at 3:59 AM
> > > To: "dev@tika.apache.org" <de...@tika.apache.org>
> > > Subject: RE: Forbidden-APIS no longer ran because of carzy POM
> > > change
> > >
> > > >Here ist he explanation why the plugin is no longer called because
> > > >of
> > > >this:
> > > >
> > > >- Works for me too, but can anyone explain why? –  Andrew Swan May
> > > >15
> > > '13
> > > >at 6:26
> > > >- @Andrew I think this works because m2e is not looking for plugins
> > > >in pluginManagement, but only in build/plugins. In the Maven world,
> > > >there is a difference between the two - the former defines "if you
> > > >happen to use this plugin, here's the configuration to use",
> > > >whereas the latter states "use this plugin". See this post and its
> > > >top two answers. – GreenGiant Jul 5 '13 at 17:52
> > > >- I agree with @GreenGiant. I tried this solution but it then
> > > >breaks the compilation since the aspectj plugin is not called
> > > >before compilation. – Pierre Aug 30 '13 at 20:21
> > > >
> > > >This explains the change. In fact placing the plugins in
> > > >pluginManagements disables them unless explicitely configured in a
> > > >sub-module. So this commit should be reverted.
> > > >
> > > >
> > > >In fact the bug described here no longer applies to later M2E
> > > >installations. It still complains about plugins that Eclipse does
> > > >not know about, but this does not prevent you from using Eclipse.
> > > >So I would strongly ask to revert the commit because it breaks the build.
> > > >
> > > >Uwe
> > > >
> > > >-----
> > > >Uwe Schindler
> > > >H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > >eMail: uwe@thetaphi.de
> > > >
> > > >
> > > >> -----Original Message-----
> > > >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > > >> Sent: Friday, January 23, 2015 12:11 PM
> > > >> To: dev@tika.apache.org
> > > >> Subject: Forbidden-APIS no longer ran because of carzy POM change
> > > >>
> > > >> Hi,
> > > >>
> > > >> I just noticed while checking the problems around the
> > > >>ExternalParsers that  the TIKA's build no longer runs the
> > > >>forbidden-apis Maven plugin, so we got a  few new violation
> > > >>especially regarding the toUpper/LowerCase(). In fact the
> > > >>following
> > commit broke this:
> > > >>
> > > >> Revision: 1624185
> > > >> Author: mattmann
> > > >> Date: Donnerstag, 11. September 2014 05:11:19
> > > >> Message:
> > > >> surround in plugin management to resolve
> > > >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> > > >> execution-not-covered-by-lifecycle-configuration-for-sprin
> > > >> ----
> > > >> Modified : /tika/trunk/tika-parent/pom.xml
> > > >>
> > > >> Since that change, the plugin is no longer run by default. I have
> > > >>no idea, why  this is like this, but in fact this broke some of
> > > >>the globally defined check tasks.
> > > >> I have no idea how to reenable it easily.
> > > >> So I cannot help, but reverting that commit restores behavior.
> > > >>What is the  reason for this commit, there is not even an issue about
> that.
> > > >>I think it seems  to be a workaround for some Eclipse issue, but
> > > >>in fact this disables the whole  plugins. To reenable
> > > >>forbidden-apis you have to now explicitely enable it in  every
> > > >>module (because pluginManagement just gives the config of a
> > > >>plugin,  where without that it also enables its execution.
> > > >>
> > > >> In addition, there is already version 1.7 of forbiddenapis, so
> > > >>you can replace
> > > >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
> > > >>with Java 8  and Java 9).
> > > >>
> > > >> The following new violations were found -> and in fact those
> > > >>broke code in  turkish locale:
> > > >> [INFO]
> > > >>------------------------------------------------------------------
> > > >>--
> > > >>--
> > > >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> > > >>--------------------------
> > > >> ----------------------------------------------
> > > >> [INFO]
> > > >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> > > >>[INFO]  Scanning for classes to check...
> > > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> > check...
> > > >> [INFO] Scanning for API signatures and dependencies...
> > > >> [ERROR] Forbidden method invocation:
> > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > >> (BasicContentHandlerFactoryTest.java:79)
> > > >> [ERROR] Forbidden method invocation:
> > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > >> (BasicContentHandlerFactoryTest.java:80)
> > > >> [ERROR] Forbidden method invocation:
> > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > >> (BasicContentHandlerFactoryTest.java:88)
> > > >> [ERROR] Forbidden method invocation:
> > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > >> (BasicContentHandlerFactoryTest.java:133)
> > > >> [ERROR] Forbidden method invocation:
> > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > >> (BasicContentHandlerFactoryTest.java:176)
> > > >> [ERROR] Forbidden method invocation:
> > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > >> (BasicContentHandlerFactoryTest.java:221)
> > > >> [ERROR] Forbidden method invocation:
> > > >>java.lang.String#toLowerCase() [Uses default locale]
> > > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > > >> (BasicContentHandlerFactoryTest.java:273)
> > > >> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden
> > > >>API invocations (in 0.16s), 7 error(s).
> > > >> [INFO]
> > > >>------------------------------------------------------------------
> > > >>--
> > > >>--
> > > >>--
> > > >> [...]
> > > >> [INFO]
> > > >>------------------------------------------------------------------
> > > >>--
> > > >>--
> > > >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> > > >>----------------------
> > > >> --------------------------------------------------
> > > >> [INFO]
> > > >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers
> > > >>--- [INFO]  Scanning for classes to check...
> > > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> > check...
> > > >> [INFO] Scanning for API signatures and dependencies...
> > > >> [ERROR] Forbidden method invocation:
> > > >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses
> > > >>default charset]
> > > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> > > >> (TesseractOCRParser.java:309)
> > > >> [ERROR] Forbidden method invocation:
> > > >>java.lang.String#<init>(byte[],int,int)
> > > >> [Uses default charset]
> > > >> [ERROR]   in
> > org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> > > >> (ChmDirectoryListingSet.java:240)  [ERROR] Forbidden method
> > > >>invocation:
> > > >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
> > > >>locale]
> > > >> [ERROR]   in
> > > >> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> > > >> (ImageMetadataExtractor.java:304)  [ERROR] Forbidden method
> > > >>invocation:
> > > >> java.lang.String#format(java.lang.String,java.lang.Object[])
> > > >>[Uses default  locale]
> > > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> > > >> (TesseractOCRConfig.java:214)
> > > >> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
> > > >>API invocations (in 0.38s), 4 error(s).
> > > >>
> > > >> Uwe
> > > >>
> > > >> -----
> > > >> Uwe Schindler
> > > >> H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > > >> eMail: uwe@thetaphi.de
> > > >
> > > >
> 



RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by "Allison, Timothy B." <ta...@mitre.org>.
Uwe,
  To confirm, we need to add this  <pluginManagement>...</pluginManagement> fully as it is in the parent pom.xml, we should not put the plugin under our regular plugins (which no longer have <pluginManagement>?

-----Original Message-----
From: Uwe Schindler [mailto:uwe@thetaphi.de] 
Sent: Friday, January 23, 2015 11:47 AM
To: dev@tika.apache.org
Subject: RE: Forbidden-APIS no longer ran because of carzy POM change

Hi,

I did further investigation. I had the plugin disabled in my eclipse (you can do this in quick fix for the whole workspace). In fact, if you remove the disable thing, it fails also in Eclipse Luna.

If we want to make the plugin automatically "hidden" to all Eclipse versions through our own POM file - this is what the quick fix also allows to do for the current project:

    <pluginManagement>
    	<plugins>
    		<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
    		<plugin>
    			<groupId>org.eclipse.m2e</groupId>
    			<artifactId>lifecycle-mapping</artifactId>
    			<version>1.0.0</version>
    			<configuration>
    				<lifecycleMappingMetadata>
    					<pluginExecutions>
    						<pluginExecution>
    							<pluginExecutionFilter>
    								<groupId>de.thetaphi</groupId>
    								<artifactId>forbiddenapis</artifactId>
    								<versionRange>[1.0,)</versionRange>
    								<goals>
    									<goal>check</goal>
    									<goal>testCheck</goal>
    								</goals>
    							</pluginExecutionFilter>
    							<action>
    								<ignore/>
    							</action>
    						</pluginExecution>
    					</pluginExecutions>
    				</lifecycleMappingMetadata>
    			</configuration>
    		</plugin>
    	</plugins>
    </pluginManagement>

This can be put in to tika-parent's POM.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> Sent: Friday, January 23, 2015 5:18 PM
> To: dev@tika.apache.org
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> Hi, this may also help, it also brings the needed information:
> 
> https://www.eclipse.org/m2e/documentation/m2e-execution-not-
> covered.html
> 
> In fact the problem is: Eclipse has no idea how this plugin should be executed
> internally in Eclipse. But as this is just a "check plugin" that does not affect the
> build output at all, you can leave it disabled.
> 
> If you scroll down, you see that Eclipse 4.2+ fixes this problem: Disable the
> plugin for Maven using Project properties -> Maven -> Lifecycle mappings ->
> ignore
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Mattmann, Chris A (3980) [mailto:chris.a.mattmann@jpl.nasa.gov]
> > Sent: Friday, January 23, 2015 4:13 PM
> > To: dev@tika.apache.org
> > Subject: Re: Forbidden-APIS no longer ran because of carzy POM change
> >
> > Hi Uwe,
> >
> > Thanks. I will check it out. Like I said, I’m not OK reverting
> > anything if my Eclipse keeps complaining at me so we’ll need a fix
> > that handles both. Let me try with the latest version of Eclipse and
> > m2e and see if (with your patch) the issue goes away.
> >
> > Cheers,
> > Chris
> >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > ++++++++
> > Chris Mattmann, Ph.D.
> > Chief Architect
> > Instrument Software and Science Data Systems Section (398) NASA Jet
> > Propulsion Laboratory Pasadena, CA 91109 USA
> > Office: 168-519, Mailstop: 168-527
> > Email: chris.a.mattmann@nasa.gov
> > WWW:  http://sunset.usc.edu/~mattmann/
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > ++++++++
> > Adjunct Associate Professor, Computer Science Department University of
> > Southern California, Los Angeles, CA 90089 USA
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > ++++++++
> >
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Uwe Schindler <uw...@thetaphi.de>
> > Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
> > Date: Friday, January 23, 2015 at 3:59 AM
> > To: "dev@tika.apache.org" <de...@tika.apache.org>
> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> >
> > >Here ist he explanation why the plugin is no longer called because of
> > >this:
> > >
> > >- Works for me too, but can anyone explain why? –  Andrew Swan May 15
> > '13
> > >at 6:26
> > >- @Andrew I think this works because m2e is not looking for plugins
> > >in pluginManagement, but only in build/plugins. In the Maven world,
> > >there is a difference between the two - the former defines "if you
> > >happen to use this plugin, here's the configuration to use", whereas
> > >the latter states "use this plugin". See this post and its top two
> > >answers. – GreenGiant Jul 5 '13 at 17:52
> > >- I agree with @GreenGiant. I tried this solution but it then breaks
> > >the compilation since the aspectj plugin is not called before
> > >compilation. – Pierre Aug 30 '13 at 20:21
> > >
> > >This explains the change. In fact placing the plugins in
> > >pluginManagements disables them unless explicitely configured in a
> > >sub-module. So this commit should be reverted.
> > >
> > >
> > >In fact the bug described here no longer applies to later M2E
> > >installations. It still complains about plugins that Eclipse does not
> > >know about, but this does not prevent you from using Eclipse. So I
> > >would strongly ask to revert the commit because it breaks the build.
> > >
> > >Uwe
> > >
> > >-----
> > >Uwe Schindler
> > >H.-H.-Meier-Allee 63, D-28213 Bremen
> > >http://www.thetaphi.de
> > >eMail: uwe@thetaphi.de
> > >
> > >
> > >> -----Original Message-----
> > >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > >> Sent: Friday, January 23, 2015 12:11 PM
> > >> To: dev@tika.apache.org
> > >> Subject: Forbidden-APIS no longer ran because of carzy POM change
> > >>
> > >> Hi,
> > >>
> > >> I just noticed while checking the problems around the
> > >>ExternalParsers that  the TIKA's build no longer runs the
> > >>forbidden-apis Maven plugin, so we got a  few new violation
> > >>especially regarding the toUpper/LowerCase(). In fact the  following
> commit broke this:
> > >>
> > >> Revision: 1624185
> > >> Author: mattmann
> > >> Date: Donnerstag, 11. September 2014 05:11:19
> > >> Message:
> > >> surround in plugin management to resolve
> > >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> > >> execution-not-covered-by-lifecycle-configuration-for-sprin
> > >> ----
> > >> Modified : /tika/trunk/tika-parent/pom.xml
> > >>
> > >> Since that change, the plugin is no longer run by default. I have
> > >>no idea, why  this is like this, but in fact this broke some of the
> > >>globally defined check tasks.
> > >> I have no idea how to reenable it easily.
> > >> So I cannot help, but reverting that commit restores behavior. What
> > >>is the  reason for this commit, there is not even an issue about that.
> > >>I think it seems  to be a workaround for some Eclipse issue, but in
> > >>fact this disables the whole  plugins. To reenable forbidden-apis
> > >>you have to now explicitely enable it in  every module (because
> > >>pluginManagement just gives the config of a plugin,  where without
> > >>that it also enables its execution.
> > >>
> > >> In addition, there is already version 1.7 of forbiddenapis, so you
> > >>can replace
> > >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
> > >>with Java 8  and Java 9).
> > >>
> > >> The following new violations were found -> and in fact those broke
> > >>code in  turkish locale:
> > >> [INFO]
> > >>--------------------------------------------------------------------
> > >>--
> > >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> > >>--------------------------
> > >> ----------------------------------------------
> > >> [INFO]
> > >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> > >>[INFO]  Scanning for classes to check...
> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> check...
> > >> [INFO] Scanning for API signatures and dependencies...
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:79)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:80)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:88)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:133)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:176)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:221)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:273)
> > >> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden
> > >>API invocations (in 0.16s), 7 error(s).
> > >> [INFO]
> > >>--------------------------------------------------------------------
> > >>--
> > >>--
> > >> [...]
> > >> [INFO]
> > >>--------------------------------------------------------------------
> > >>--
> > >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> > >>----------------------
> > >> --------------------------------------------------
> > >> [INFO]
> > >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
> > >>[INFO]  Scanning for classes to check...
> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> check...
> > >> [INFO] Scanning for API signatures and dependencies...
> > >> [ERROR] Forbidden method invocation:
> > >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> > >>charset]
> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> > >> (TesseractOCRParser.java:309)
> > >> [ERROR] Forbidden method invocation:
> > >>java.lang.String#<init>(byte[],int,int)
> > >> [Uses default charset]
> > >> [ERROR]   in
> org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> > >> (ChmDirectoryListingSet.java:240)
> > >> [ERROR] Forbidden method invocation:
> > >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
> > >>locale]
> > >> [ERROR]   in
> > >> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> > >> (ImageMetadataExtractor.java:304)
> > >> [ERROR] Forbidden method invocation:
> > >> java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
> > >>default  locale]
> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> > >> (TesseractOCRConfig.java:214)
> > >> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
> > >>API invocations (in 0.38s), 4 error(s).
> > >>
> > >> Uwe
> > >>
> > >> -----
> > >> Uwe Schindler
> > >> H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > >> eMail: uwe@thetaphi.de
> > >
> > >



RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
I will add this to the documentation page of forbidden-apis. This may also help Elasticsearch and other people :-) 

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Mattmann, Chris A (3980) [mailto:chris.a.mattmann@jpl.nasa.gov]
> Sent: Friday, January 23, 2015 8:11 PM
> To: dev@tika.apache.org
> Subject: Re: Forbidden-APIS no longer ran because of carzy POM change
> 
> awesome. Thanks Uwe.
> 
> Tim you want to put that in, or you want me to?
> 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> Chris Mattmann, Ph.D.
> Chief Architect
> Instrument Software and Science Data Systems Section (398) NASA Jet
> Propulsion Laboratory Pasadena, CA 91109 USA
> Office: 168-519, Mailstop: 168-527
> Email: chris.a.mattmann@nasa.gov
> WWW:  http://sunset.usc.edu/~mattmann/
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> Adjunct Associate Professor, Computer Science Department University of
> Southern California, Los Angeles, CA 90089 USA
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Uwe Schindler <uw...@thetaphi.de>
> Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
> Date: Friday, January 23, 2015 at 8:47 AM
> To: "dev@tika.apache.org" <de...@tika.apache.org>
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> >Hi,
> >
> >I did further investigation. I had the plugin disabled in my eclipse
> >(you can do this in quick fix for the whole workspace). In fact, if you
> >remove the disable thing, it fails also in Eclipse Luna.
> >
> >If we want to make the plugin automatically "hidden" to all Eclipse
> >versions through our own POM file - this is what the quick fix also
> >allows to do for the current project:
> >
> >    <pluginManagement>
> >    	<plugins>
> >    		<!--This plugin's configuration is used to store Eclipse m2e
> >settings only. It has no influence on the Maven build itself.-->
> >    		<plugin>
> >    			<groupId>org.eclipse.m2e</groupId>
> >    			<artifactId>lifecycle-mapping</artifactId>
> >    			<version>1.0.0</version>
> >    			<configuration>
> >    				<lifecycleMappingMetadata>
> >    					<pluginExecutions>
> >    						<pluginExecution>
> >
> 	<pluginExecutionFilter>
> >
> 	<groupId>de.thetaphi</groupId>
> >
> 	<artifactId>forbiddenapis</artifactId>
> >
> 	<versionRange>[1.0,)</versionRange>
> >    								<goals>
> >
> 	<goal>check</goal>
> >
> 	<goal>testCheck</goal>
> >    								</goals>
> >
> 	</pluginExecutionFilter>
> >    							<action>
> >    								<ignore/>
> >    							</action>
> >    						</pluginExecution>
> >    					</pluginExecutions>
> >    				</lifecycleMappingMetadata>
> >    			</configuration>
> >    		</plugin>
> >    	</plugins>
> >    </pluginManagement>
> >
> >This can be put in to tika-parent's POM.
> >
> >-----
> >Uwe Schindler
> >H.-H.-Meier-Allee 63, D-28213 Bremen
> >http://www.thetaphi.de
> >eMail: uwe@thetaphi.de
> >
> >
> >> -----Original Message-----
> >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> >> Sent: Friday, January 23, 2015 5:18 PM
> >> To: dev@tika.apache.org
> >> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> >>
> >> Hi, this may also help, it also brings the needed information:
> >>
> >> https://www.eclipse.org/m2e/documentation/m2e-execution-not-
> >> covered.html
> >>
> >> In fact the problem is: Eclipse has no idea how this plugin should be
> >>executed  internally in Eclipse. But as this is just a "check plugin"
> >>that does not affect the  build output at all, you can leave it
> >>disabled.
> >>
> >> If you scroll down, you see that Eclipse 4.2+ fixes this problem:
> >>Disable the
> >> plugin for Maven using Project properties -> Maven -> Lifecycle
> >>mappings ->  ignore
> >>
> >> -----
> >> Uwe Schindler
> >> H.-H.-Meier-Allee 63, D-28213 Bremen
> >> http://www.thetaphi.de
> >> eMail: uwe@thetaphi.de
> >>
> >>
> >> > -----Original Message-----
> >> > From: Mattmann, Chris A (3980)
> >> > [mailto:chris.a.mattmann@jpl.nasa.gov]
> >> > Sent: Friday, January 23, 2015 4:13 PM
> >> > To: dev@tika.apache.org
> >> > Subject: Re: Forbidden-APIS no longer ran because of carzy POM
> >> > change
> >> >
> >> > Hi Uwe,
> >> >
> >> > Thanks. I will check it out. Like I said, I’m not OK reverting
> >> > anything if my Eclipse keeps complaining at me so we’ll need a fix
> >> > that handles both. Let me try with the latest version of Eclipse
> >> > and m2e and see if (with your patch) the issue goes away.
> >> >
> >> > Cheers,
> >> > Chris
> >> >
> >> >
> >>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >> > ++++++++
> >> > Chris Mattmann, Ph.D.
> >> > Chief Architect
> >> > Instrument Software and Science Data Systems Section (398) NASA Jet
> >> > Propulsion Laboratory Pasadena, CA 91109 USA
> >> > Office: 168-519, Mailstop: 168-527
> >> > Email: chris.a.mattmann@nasa.gov
> >> > WWW:  http://sunset.usc.edu/~mattmann/
> >> >
> >>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >> > ++++++++
> >> > Adjunct Associate Professor, Computer Science Department University
> >> > of Southern California, Los Angeles, CA 90089 USA
> >> >
> >>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >> > ++++++++
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > -----Original Message-----
> >> > From: Uwe Schindler <uw...@thetaphi.de>
> >> > Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
> >> > Date: Friday, January 23, 2015 at 3:59 AM
> >> > To: "dev@tika.apache.org" <de...@tika.apache.org>
> >> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM
> >> > change
> >> >
> >> > >Here ist he explanation why the plugin is no longer called because
> >> > >of
> >> > >this:
> >> > >
> >> > >- Works for me too, but can anyone explain why? –  Andrew Swan May
> >> > >15
> >> > '13
> >> > >at 6:26
> >> > >- @Andrew I think this works because m2e is not looking for
> >> > >plugins in pluginManagement, but only in build/plugins. In the
> >> > >Maven world, there is a difference between the two - the former
> >> > >defines "if you happen to use this plugin, here's the
> >> > >configuration to use", whereas the latter states "use this
> >> > >plugin". See this post and its top two answers. – GreenGiant Jul 5
> >> > >'13 at 17:52
> >> > >- I agree with @GreenGiant. I tried this solution but it then
> >> > >breaks the compilation since the aspectj plugin is not called
> >> > >before compilation. – Pierre Aug 30 '13 at 20:21
> >> > >
> >> > >This explains the change. In fact placing the plugins in
> >> > >pluginManagements disables them unless explicitely configured in a
> >> > >sub-module. So this commit should be reverted.
> >> > >
> >> > >
> >> > >In fact the bug described here no longer applies to later M2E
> >> > >installations. It still complains about plugins that Eclipse does
> >> > >not know about, but this does not prevent you from using Eclipse.
> >> > >So I would strongly ask to revert the commit because it breaks the
> build.
> >> > >
> >> > >Uwe
> >> > >
> >> > >-----
> >> > >Uwe Schindler
> >> > >H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> >> > >eMail: uwe@thetaphi.de
> >> > >
> >> > >
> >> > >> -----Original Message-----
> >> > >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> >> > >> Sent: Friday, January 23, 2015 12:11 PM
> >> > >> To: dev@tika.apache.org
> >> > >> Subject: Forbidden-APIS no longer ran because of carzy POM
> >> > >> change
> >> > >>
> >> > >> Hi,
> >> > >>
> >> > >> I just noticed while checking the problems around the
> >> > >>ExternalParsers that  the TIKA's build no longer runs the
> >> > >>forbidden-apis Maven plugin, so we got a  few new violation
> >> > >>especially regarding the toUpper/LowerCase(). In fact the
> >> > >>following
> >> commit broke this:
> >> > >>
> >> > >> Revision: 1624185
> >> > >> Author: mattmann
> >> > >> Date: Donnerstag, 11. September 2014 05:11:19
> >> > >> Message:
> >> > >> surround in plugin management to resolve
> >> > >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> >> > >> execution-not-covered-by-lifecycle-configuration-for-sprin
> >> > >> ----
> >> > >> Modified : /tika/trunk/tika-parent/pom.xml
> >> > >>
> >> > >> Since that change, the plugin is no longer run by default. I
> >> > >>have no idea, why  this is like this, but in fact this broke some
> >> > >>of the globally defined check tasks.
> >> > >> I have no idea how to reenable it easily.
> >> > >> So I cannot help, but reverting that commit restores behavior.
> >> > >>What is the  reason for this commit, there is not even an issue
> >> > >>about
> >>that.
> >> > >>I think it seems  to be a workaround for some Eclipse issue, but
> >> > >>in fact this disables the whole  plugins. To reenable
> >> > >>forbidden-apis you have to now explicitely enable it in  every
> >> > >>module (because pluginManagement just gives the config of a
> >> > >>plugin,  where without that it also enables its execution.
> >> > >>
> >> > >> In addition, there is already version 1.7 of forbiddenapis, so
> >> > >>you can replace
> >> > >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
> >> > >>with Java 8  and Java 9).
> >> > >>
> >> > >> The following new violations were found -> and in fact those
> >> > >>broke code in  turkish locale:
> >> > >> [INFO]
> >> > >>-----------------------------------------------------------------
> >> > >>---
> >> > >>--
> >> > >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> >> > >>--------------------------
> >> > >> ----------------------------------------------
> >> > >> [INFO]
> >> > >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> >> > >>[INFO]  Scanning for classes to check...
> >> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> >> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> >> check...
> >> > >> [INFO] Scanning for API signatures and dependencies...
> >> > >> [ERROR] Forbidden method invocation:
> >> > >>java.lang.String#toLowerCase() [Uses default locale]
> >> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> > >> (BasicContentHandlerFactoryTest.java:79)
> >> > >> [ERROR] Forbidden method invocation:
> >> > >>java.lang.String#toLowerCase() [Uses default locale]
> >> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> > >> (BasicContentHandlerFactoryTest.java:80)
> >> > >> [ERROR] Forbidden method invocation:
> >> > >>java.lang.String#toLowerCase() [Uses default locale]
> >> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> > >> (BasicContentHandlerFactoryTest.java:88)
> >> > >> [ERROR] Forbidden method invocation:
> >> > >>java.lang.String#toLowerCase() [Uses default locale]
> >> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> > >> (BasicContentHandlerFactoryTest.java:133)
> >> > >> [ERROR] Forbidden method invocation:
> >> > >>java.lang.String#toLowerCase() [Uses default locale]
> >> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> > >> (BasicContentHandlerFactoryTest.java:176)
> >> > >> [ERROR] Forbidden method invocation:
> >> > >>java.lang.String#toLowerCase() [Uses default locale]
> >> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> > >> (BasicContentHandlerFactoryTest.java:221)
> >> > >> [ERROR] Forbidden method invocation:
> >> > >>java.lang.String#toLowerCase() [Uses default locale]
> >> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> > >> (BasicContentHandlerFactoryTest.java:273)
> >> > >> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden
> >> > >>API invocations (in 0.16s), 7 error(s).
> >> > >> [INFO]
> >> > >>-----------------------------------------------------------------
> >> > >>---
> >> > >>--
> >> > >>--
> >> > >> [...]
> >> > >> [INFO]
> >> > >>-----------------------------------------------------------------
> >> > >>---
> >> > >>--
> >> > >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> >> > >>----------------------
> >> > >> --------------------------------------------------
> >> > >> [INFO]
> >> > >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers
> >> > >>--- [INFO]  Scanning for classes to check...
> >> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> >> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> >> check...
> >> > >> [INFO] Scanning for API signatures and dependencies...
> >> > >> [ERROR] Forbidden method invocation:
> >> > >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses
> >> > >>default charset]
> >> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> >> > >> (TesseractOCRParser.java:309)
> >> > >> [ERROR] Forbidden method invocation:
> >> > >>java.lang.String#<init>(byte[],int,int)
> >> > >> [Uses default charset]
> >> > >> [ERROR]   in
> >> org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> >> > >> (ChmDirectoryListingSet.java:240)  [ERROR] Forbidden method
> >> > >>invocation:
> >> > >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses
> >> > >>default locale]
> >> > >> [ERROR]   in
> >> > >>
> >> >
> >>org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> >> > >> (ImageMetadataExtractor.java:304)  [ERROR] Forbidden method
> >> > >>invocation:
> >> > >> java.lang.String#format(java.lang.String,java.lang.Object[])
> >> > >>[Uses default  locale]
> >> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> >> > >> (TesseractOCRConfig.java:214)
> >> > >> [ERROR] Scanned 281 (and 813 related) class file(s) for
> >> > >>forbidden API invocations (in 0.38s), 4 error(s).
> >> > >>
> >> > >> Uwe
> >> > >>
> >> > >> -----
> >> > >> Uwe Schindler
> >> > >> H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> >> > >> eMail: uwe@thetaphi.de
> >> > >
> >> > >
> >
> >



RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by "Allison, Timothy B." <ta...@mitre.org>.
Will do.

-----Original Message-----
From: Mattmann, Chris A (3980) [mailto:chris.a.mattmann@jpl.nasa.gov] 
Sent: Friday, January 23, 2015 2:11 PM
To: dev@tika.apache.org
Subject: Re: Forbidden-APIS no longer ran because of carzy POM change

awesome. Thanks Uwe.

Tim you want to put that in, or you want me to?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: chris.a.mattmann@nasa.gov
WWW:  http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Uwe Schindler <uw...@thetaphi.de>
Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
Date: Friday, January 23, 2015 at 8:47 AM
To: "dev@tika.apache.org" <de...@tika.apache.org>
Subject: RE: Forbidden-APIS no longer ran because of carzy POM change

>Hi,
>
>I did further investigation. I had the plugin disabled in my eclipse (you
>can do this in quick fix for the whole workspace). In fact, if you remove
>the disable thing, it fails also in Eclipse Luna.
>
>If we want to make the plugin automatically "hidden" to all Eclipse
>versions through our own POM file - this is what the quick fix also
>allows to do for the current project:
>
>    <pluginManagement>
>    	<plugins>
>    		<!--This plugin's configuration is used to store Eclipse m2e
>settings only. It has no influence on the Maven build itself.-->
>    		<plugin>
>    			<groupId>org.eclipse.m2e</groupId>
>    			<artifactId>lifecycle-mapping</artifactId>
>    			<version>1.0.0</version>
>    			<configuration>
>    				<lifecycleMappingMetadata>
>    					<pluginExecutions>
>    						<pluginExecution>
>    							<pluginExecutionFilter>
>    								<groupId>de.thetaphi</groupId>
>    								<artifactId>forbiddenapis</artifactId>
>    								<versionRange>[1.0,)</versionRange>
>    								<goals>
>    									<goal>check</goal>
>    									<goal>testCheck</goal>
>    								</goals>
>    							</pluginExecutionFilter>
>    							<action>
>    								<ignore/>
>    							</action>
>    						</pluginExecution>
>    					</pluginExecutions>
>    				</lifecycleMappingMetadata>
>    			</configuration>
>    		</plugin>
>    	</plugins>
>    </pluginManagement>
>
>This can be put in to tika-parent's POM.
>
>-----
>Uwe Schindler
>H.-H.-Meier-Allee 63, D-28213 Bremen
>http://www.thetaphi.de
>eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> Sent: Friday, January 23, 2015 5:18 PM
>> To: dev@tika.apache.org
>> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
>> 
>> Hi, this may also help, it also brings the needed information:
>> 
>> https://www.eclipse.org/m2e/documentation/m2e-execution-not-
>> covered.html
>> 
>> In fact the problem is: Eclipse has no idea how this plugin should be
>>executed
>> internally in Eclipse. But as this is just a "check plugin" that does
>>not affect the
>> build output at all, you can leave it disabled.
>> 
>> If you scroll down, you see that Eclipse 4.2+ fixes this problem:
>>Disable the
>> plugin for Maven using Project properties -> Maven -> Lifecycle
>>mappings ->
>> ignore
>> 
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>> 
>> 
>> > -----Original Message-----
>> > From: Mattmann, Chris A (3980) [mailto:chris.a.mattmann@jpl.nasa.gov]
>> > Sent: Friday, January 23, 2015 4:13 PM
>> > To: dev@tika.apache.org
>> > Subject: Re: Forbidden-APIS no longer ran because of carzy POM change
>> >
>> > Hi Uwe,
>> >
>> > Thanks. I will check it out. Like I said, I’m not OK reverting
>> > anything if my Eclipse keeps complaining at me so we’ll need a fix
>> > that handles both. Let me try with the latest version of Eclipse and
>> > m2e and see if (with your patch) the issue goes away.
>> >
>> > Cheers,
>> > Chris
>> >
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > ++++++++
>> > Chris Mattmann, Ph.D.
>> > Chief Architect
>> > Instrument Software and Science Data Systems Section (398) NASA Jet
>> > Propulsion Laboratory Pasadena, CA 91109 USA
>> > Office: 168-519, Mailstop: 168-527
>> > Email: chris.a.mattmann@nasa.gov
>> > WWW:  http://sunset.usc.edu/~mattmann/
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > ++++++++
>> > Adjunct Associate Professor, Computer Science Department University of
>> > Southern California, Los Angeles, CA 90089 USA
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > ++++++++
>> >
>> >
>> >
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: Uwe Schindler <uw...@thetaphi.de>
>> > Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
>> > Date: Friday, January 23, 2015 at 3:59 AM
>> > To: "dev@tika.apache.org" <de...@tika.apache.org>
>> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
>> >
>> > >Here ist he explanation why the plugin is no longer called because of
>> > >this:
>> > >
>> > >- Works for me too, but can anyone explain why? –  Andrew Swan May 15
>> > '13
>> > >at 6:26
>> > >- @Andrew I think this works because m2e is not looking for plugins
>> > >in pluginManagement, but only in build/plugins. In the Maven world,
>> > >there is a difference between the two - the former defines "if you
>> > >happen to use this plugin, here's the configuration to use", whereas
>> > >the latter states "use this plugin". See this post and its top two
>> > >answers. – GreenGiant Jul 5 '13 at 17:52
>> > >- I agree with @GreenGiant. I tried this solution but it then breaks
>> > >the compilation since the aspectj plugin is not called before
>> > >compilation. – Pierre Aug 30 '13 at 20:21
>> > >
>> > >This explains the change. In fact placing the plugins in
>> > >pluginManagements disables them unless explicitely configured in a
>> > >sub-module. So this commit should be reverted.
>> > >
>> > >
>> > >In fact the bug described here no longer applies to later M2E
>> > >installations. It still complains about plugins that Eclipse does not
>> > >know about, but this does not prevent you from using Eclipse. So I
>> > >would strongly ask to revert the commit because it breaks the build.
>> > >
>> > >Uwe
>> > >
>> > >-----
>> > >Uwe Schindler
>> > >H.-H.-Meier-Allee 63, D-28213 Bremen
>> > >http://www.thetaphi.de
>> > >eMail: uwe@thetaphi.de
>> > >
>> > >
>> > >> -----Original Message-----
>> > >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> > >> Sent: Friday, January 23, 2015 12:11 PM
>> > >> To: dev@tika.apache.org
>> > >> Subject: Forbidden-APIS no longer ran because of carzy POM change
>> > >>
>> > >> Hi,
>> > >>
>> > >> I just noticed while checking the problems around the
>> > >>ExternalParsers that  the TIKA's build no longer runs the
>> > >>forbidden-apis Maven plugin, so we got a  few new violation
>> > >>especially regarding the toUpper/LowerCase(). In fact the  following
>> commit broke this:
>> > >>
>> > >> Revision: 1624185
>> > >> Author: mattmann
>> > >> Date: Donnerstag, 11. September 2014 05:11:19
>> > >> Message:
>> > >> surround in plugin management to resolve
>> > >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
>> > >> execution-not-covered-by-lifecycle-configuration-for-sprin
>> > >> ----
>> > >> Modified : /tika/trunk/tika-parent/pom.xml
>> > >>
>> > >> Since that change, the plugin is no longer run by default. I have
>> > >>no idea, why  this is like this, but in fact this broke some of the
>> > >>globally defined check tasks.
>> > >> I have no idea how to reenable it easily.
>> > >> So I cannot help, but reverting that commit restores behavior. What
>> > >>is the  reason for this commit, there is not even an issue about
>>that.
>> > >>I think it seems  to be a workaround for some Eclipse issue, but in
>> > >>fact this disables the whole  plugins. To reenable forbidden-apis
>> > >>you have to now explicitely enable it in  every module (because
>> > >>pluginManagement just gives the config of a plugin,  where without
>> > >>that it also enables its execution.
>> > >>
>> > >> In addition, there is already version 1.7 of forbiddenapis, so you
>> > >>can replace
>> > >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
>> > >>with Java 8  and Java 9).
>> > >>
>> > >> The following new violations were found -> and in fact those broke
>> > >>code in  turkish locale:
>> > >> [INFO]
>> > >>--------------------------------------------------------------------
>> > >>--
>> > >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
>> > >>--------------------------
>> > >> ----------------------------------------------
>> > >> [INFO]
>> > >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
>> > >>[INFO]  Scanning for classes to check...
>> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
>> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
>> check...
>> > >> [INFO] Scanning for API signatures and dependencies...
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:79)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:80)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:88)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:133)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:176)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:221)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:273)
>> > >> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden
>> > >>API invocations (in 0.16s), 7 error(s).
>> > >> [INFO]
>> > >>--------------------------------------------------------------------
>> > >>--
>> > >>--
>> > >> [...]
>> > >> [INFO]
>> > >>--------------------------------------------------------------------
>> > >>--
>> > >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
>> > >>----------------------
>> > >> --------------------------------------------------
>> > >> [INFO]
>> > >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
>> > >>[INFO]  Scanning for classes to check...
>> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
>> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
>> check...
>> > >> [INFO] Scanning for API signatures and dependencies...
>> > >> [ERROR] Forbidden method invocation:
>> > >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
>> > >>charset]
>> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
>> > >> (TesseractOCRParser.java:309)
>> > >> [ERROR] Forbidden method invocation:
>> > >>java.lang.String#<init>(byte[],int,int)
>> > >> [Uses default charset]
>> > >> [ERROR]   in
>> org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
>> > >> (ChmDirectoryListingSet.java:240)
>> > >> [ERROR] Forbidden method invocation:
>> > >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
>> > >>locale]
>> > >> [ERROR]   in
>> > >> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
>> > >> (ImageMetadataExtractor.java:304)
>> > >> [ERROR] Forbidden method invocation:
>> > >> java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
>> > >>default  locale]
>> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
>> > >> (TesseractOCRConfig.java:214)
>> > >> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
>> > >>API invocations (in 0.38s), 4 error(s).
>> > >>
>> > >> Uwe
>> > >>
>> > >> -----
>> > >> Uwe Schindler
>> > >> H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
>> > >> eMail: uwe@thetaphi.de
>> > >
>> > >
>
>


Re: Forbidden-APIS no longer ran because of carzy POM change

Posted by "Mattmann, Chris A (3980)" <ch...@jpl.nasa.gov>.
awesome. Thanks Uwe.

Tim you want to put that in, or you want me to?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: chris.a.mattmann@nasa.gov
WWW:  http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Uwe Schindler <uw...@thetaphi.de>
Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
Date: Friday, January 23, 2015 at 8:47 AM
To: "dev@tika.apache.org" <de...@tika.apache.org>
Subject: RE: Forbidden-APIS no longer ran because of carzy POM change

>Hi,
>
>I did further investigation. I had the plugin disabled in my eclipse (you
>can do this in quick fix for the whole workspace). In fact, if you remove
>the disable thing, it fails also in Eclipse Luna.
>
>If we want to make the plugin automatically "hidden" to all Eclipse
>versions through our own POM file - this is what the quick fix also
>allows to do for the current project:
>
>    <pluginManagement>
>    	<plugins>
>    		<!--This plugin's configuration is used to store Eclipse m2e
>settings only. It has no influence on the Maven build itself.-->
>    		<plugin>
>    			<groupId>org.eclipse.m2e</groupId>
>    			<artifactId>lifecycle-mapping</artifactId>
>    			<version>1.0.0</version>
>    			<configuration>
>    				<lifecycleMappingMetadata>
>    					<pluginExecutions>
>    						<pluginExecution>
>    							<pluginExecutionFilter>
>    								<groupId>de.thetaphi</groupId>
>    								<artifactId>forbiddenapis</artifactId>
>    								<versionRange>[1.0,)</versionRange>
>    								<goals>
>    									<goal>check</goal>
>    									<goal>testCheck</goal>
>    								</goals>
>    							</pluginExecutionFilter>
>    							<action>
>    								<ignore/>
>    							</action>
>    						</pluginExecution>
>    					</pluginExecutions>
>    				</lifecycleMappingMetadata>
>    			</configuration>
>    		</plugin>
>    	</plugins>
>    </pluginManagement>
>
>This can be put in to tika-parent's POM.
>
>-----
>Uwe Schindler
>H.-H.-Meier-Allee 63, D-28213 Bremen
>http://www.thetaphi.de
>eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> Sent: Friday, January 23, 2015 5:18 PM
>> To: dev@tika.apache.org
>> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
>> 
>> Hi, this may also help, it also brings the needed information:
>> 
>> https://www.eclipse.org/m2e/documentation/m2e-execution-not-
>> covered.html
>> 
>> In fact the problem is: Eclipse has no idea how this plugin should be
>>executed
>> internally in Eclipse. But as this is just a "check plugin" that does
>>not affect the
>> build output at all, you can leave it disabled.
>> 
>> If you scroll down, you see that Eclipse 4.2+ fixes this problem:
>>Disable the
>> plugin for Maven using Project properties -> Maven -> Lifecycle
>>mappings ->
>> ignore
>> 
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>> 
>> 
>> > -----Original Message-----
>> > From: Mattmann, Chris A (3980) [mailto:chris.a.mattmann@jpl.nasa.gov]
>> > Sent: Friday, January 23, 2015 4:13 PM
>> > To: dev@tika.apache.org
>> > Subject: Re: Forbidden-APIS no longer ran because of carzy POM change
>> >
>> > Hi Uwe,
>> >
>> > Thanks. I will check it out. Like I said, I’m not OK reverting
>> > anything if my Eclipse keeps complaining at me so we’ll need a fix
>> > that handles both. Let me try with the latest version of Eclipse and
>> > m2e and see if (with your patch) the issue goes away.
>> >
>> > Cheers,
>> > Chris
>> >
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > ++++++++
>> > Chris Mattmann, Ph.D.
>> > Chief Architect
>> > Instrument Software and Science Data Systems Section (398) NASA Jet
>> > Propulsion Laboratory Pasadena, CA 91109 USA
>> > Office: 168-519, Mailstop: 168-527
>> > Email: chris.a.mattmann@nasa.gov
>> > WWW:  http://sunset.usc.edu/~mattmann/
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > ++++++++
>> > Adjunct Associate Professor, Computer Science Department University of
>> > Southern California, Los Angeles, CA 90089 USA
>> >
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> > ++++++++
>> >
>> >
>> >
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: Uwe Schindler <uw...@thetaphi.de>
>> > Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
>> > Date: Friday, January 23, 2015 at 3:59 AM
>> > To: "dev@tika.apache.org" <de...@tika.apache.org>
>> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
>> >
>> > >Here ist he explanation why the plugin is no longer called because of
>> > >this:
>> > >
>> > >- Works for me too, but can anyone explain why? –  Andrew Swan May 15
>> > '13
>> > >at 6:26
>> > >- @Andrew I think this works because m2e is not looking for plugins
>> > >in pluginManagement, but only in build/plugins. In the Maven world,
>> > >there is a difference between the two - the former defines "if you
>> > >happen to use this plugin, here's the configuration to use", whereas
>> > >the latter states "use this plugin". See this post and its top two
>> > >answers. – GreenGiant Jul 5 '13 at 17:52
>> > >- I agree with @GreenGiant. I tried this solution but it then breaks
>> > >the compilation since the aspectj plugin is not called before
>> > >compilation. – Pierre Aug 30 '13 at 20:21
>> > >
>> > >This explains the change. In fact placing the plugins in
>> > >pluginManagements disables them unless explicitely configured in a
>> > >sub-module. So this commit should be reverted.
>> > >
>> > >
>> > >In fact the bug described here no longer applies to later M2E
>> > >installations. It still complains about plugins that Eclipse does not
>> > >know about, but this does not prevent you from using Eclipse. So I
>> > >would strongly ask to revert the commit because it breaks the build.
>> > >
>> > >Uwe
>> > >
>> > >-----
>> > >Uwe Schindler
>> > >H.-H.-Meier-Allee 63, D-28213 Bremen
>> > >http://www.thetaphi.de
>> > >eMail: uwe@thetaphi.de
>> > >
>> > >
>> > >> -----Original Message-----
>> > >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> > >> Sent: Friday, January 23, 2015 12:11 PM
>> > >> To: dev@tika.apache.org
>> > >> Subject: Forbidden-APIS no longer ran because of carzy POM change
>> > >>
>> > >> Hi,
>> > >>
>> > >> I just noticed while checking the problems around the
>> > >>ExternalParsers that  the TIKA's build no longer runs the
>> > >>forbidden-apis Maven plugin, so we got a  few new violation
>> > >>especially regarding the toUpper/LowerCase(). In fact the  following
>> commit broke this:
>> > >>
>> > >> Revision: 1624185
>> > >> Author: mattmann
>> > >> Date: Donnerstag, 11. September 2014 05:11:19
>> > >> Message:
>> > >> surround in plugin management to resolve
>> > >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
>> > >> execution-not-covered-by-lifecycle-configuration-for-sprin
>> > >> ----
>> > >> Modified : /tika/trunk/tika-parent/pom.xml
>> > >>
>> > >> Since that change, the plugin is no longer run by default. I have
>> > >>no idea, why  this is like this, but in fact this broke some of the
>> > >>globally defined check tasks.
>> > >> I have no idea how to reenable it easily.
>> > >> So I cannot help, but reverting that commit restores behavior. What
>> > >>is the  reason for this commit, there is not even an issue about
>>that.
>> > >>I think it seems  to be a workaround for some Eclipse issue, but in
>> > >>fact this disables the whole  plugins. To reenable forbidden-apis
>> > >>you have to now explicitely enable it in  every module (because
>> > >>pluginManagement just gives the config of a plugin,  where without
>> > >>that it also enables its execution.
>> > >>
>> > >> In addition, there is already version 1.7 of forbiddenapis, so you
>> > >>can replace
>> > >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
>> > >>with Java 8  and Java 9).
>> > >>
>> > >> The following new violations were found -> and in fact those broke
>> > >>code in  turkish locale:
>> > >> [INFO]
>> > >>--------------------------------------------------------------------
>> > >>--
>> > >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
>> > >>--------------------------
>> > >> ----------------------------------------------
>> > >> [INFO]
>> > >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
>> > >>[INFO]  Scanning for classes to check...
>> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
>> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
>> check...
>> > >> [INFO] Scanning for API signatures and dependencies...
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:79)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:80)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:88)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:133)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:176)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:221)
>> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> > >>[Uses default locale]
>> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> > >> (BasicContentHandlerFactoryTest.java:273)
>> > >> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden
>> > >>API invocations (in 0.16s), 7 error(s).
>> > >> [INFO]
>> > >>--------------------------------------------------------------------
>> > >>--
>> > >>--
>> > >> [...]
>> > >> [INFO]
>> > >>--------------------------------------------------------------------
>> > >>--
>> > >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
>> > >>----------------------
>> > >> --------------------------------------------------
>> > >> [INFO]
>> > >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
>> > >>[INFO]  Scanning for classes to check...
>> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
>> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
>> check...
>> > >> [INFO] Scanning for API signatures and dependencies...
>> > >> [ERROR] Forbidden method invocation:
>> > >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
>> > >>charset]
>> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
>> > >> (TesseractOCRParser.java:309)
>> > >> [ERROR] Forbidden method invocation:
>> > >>java.lang.String#<init>(byte[],int,int)
>> > >> [Uses default charset]
>> > >> [ERROR]   in
>> org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
>> > >> (ChmDirectoryListingSet.java:240)
>> > >> [ERROR] Forbidden method invocation:
>> > >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
>> > >>locale]
>> > >> [ERROR]   in
>> > >> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
>> > >> (ImageMetadataExtractor.java:304)
>> > >> [ERROR] Forbidden method invocation:
>> > >> java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
>> > >>default  locale]
>> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
>> > >> (TesseractOCRConfig.java:214)
>> > >> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
>> > >>API invocations (in 0.38s), 4 error(s).
>> > >>
>> > >> Uwe
>> > >>
>> > >> -----
>> > >> Uwe Schindler
>> > >> H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
>> > >> eMail: uwe@thetaphi.de
>> > >
>> > >
>
>


RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

I did further investigation. I had the plugin disabled in my eclipse (you can do this in quick fix for the whole workspace). In fact, if you remove the disable thing, it fails also in Eclipse Luna.

If we want to make the plugin automatically "hidden" to all Eclipse versions through our own POM file - this is what the quick fix also allows to do for the current project:

    <pluginManagement>
    	<plugins>
    		<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
    		<plugin>
    			<groupId>org.eclipse.m2e</groupId>
    			<artifactId>lifecycle-mapping</artifactId>
    			<version>1.0.0</version>
    			<configuration>
    				<lifecycleMappingMetadata>
    					<pluginExecutions>
    						<pluginExecution>
    							<pluginExecutionFilter>
    								<groupId>de.thetaphi</groupId>
    								<artifactId>forbiddenapis</artifactId>
    								<versionRange>[1.0,)</versionRange>
    								<goals>
    									<goal>check</goal>
    									<goal>testCheck</goal>
    								</goals>
    							</pluginExecutionFilter>
    							<action>
    								<ignore/>
    							</action>
    						</pluginExecution>
    					</pluginExecutions>
    				</lifecycleMappingMetadata>
    			</configuration>
    		</plugin>
    	</plugins>
    </pluginManagement>

This can be put in to tika-parent's POM.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> Sent: Friday, January 23, 2015 5:18 PM
> To: dev@tika.apache.org
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> Hi, this may also help, it also brings the needed information:
> 
> https://www.eclipse.org/m2e/documentation/m2e-execution-not-
> covered.html
> 
> In fact the problem is: Eclipse has no idea how this plugin should be executed
> internally in Eclipse. But as this is just a "check plugin" that does not affect the
> build output at all, you can leave it disabled.
> 
> If you scroll down, you see that Eclipse 4.2+ fixes this problem: Disable the
> plugin for Maven using Project properties -> Maven -> Lifecycle mappings ->
> ignore
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Mattmann, Chris A (3980) [mailto:chris.a.mattmann@jpl.nasa.gov]
> > Sent: Friday, January 23, 2015 4:13 PM
> > To: dev@tika.apache.org
> > Subject: Re: Forbidden-APIS no longer ran because of carzy POM change
> >
> > Hi Uwe,
> >
> > Thanks. I will check it out. Like I said, I’m not OK reverting
> > anything if my Eclipse keeps complaining at me so we’ll need a fix
> > that handles both. Let me try with the latest version of Eclipse and
> > m2e and see if (with your patch) the issue goes away.
> >
> > Cheers,
> > Chris
> >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > ++++++++
> > Chris Mattmann, Ph.D.
> > Chief Architect
> > Instrument Software and Science Data Systems Section (398) NASA Jet
> > Propulsion Laboratory Pasadena, CA 91109 USA
> > Office: 168-519, Mailstop: 168-527
> > Email: chris.a.mattmann@nasa.gov
> > WWW:  http://sunset.usc.edu/~mattmann/
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > ++++++++
> > Adjunct Associate Professor, Computer Science Department University of
> > Southern California, Los Angeles, CA 90089 USA
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > ++++++++
> >
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Uwe Schindler <uw...@thetaphi.de>
> > Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
> > Date: Friday, January 23, 2015 at 3:59 AM
> > To: "dev@tika.apache.org" <de...@tika.apache.org>
> > Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> >
> > >Here ist he explanation why the plugin is no longer called because of
> > >this:
> > >
> > >- Works for me too, but can anyone explain why? –  Andrew Swan May 15
> > '13
> > >at 6:26
> > >- @Andrew I think this works because m2e is not looking for plugins
> > >in pluginManagement, but only in build/plugins. In the Maven world,
> > >there is a difference between the two - the former defines "if you
> > >happen to use this plugin, here's the configuration to use", whereas
> > >the latter states "use this plugin". See this post and its top two
> > >answers. – GreenGiant Jul 5 '13 at 17:52
> > >- I agree with @GreenGiant. I tried this solution but it then breaks
> > >the compilation since the aspectj plugin is not called before
> > >compilation. – Pierre Aug 30 '13 at 20:21
> > >
> > >This explains the change. In fact placing the plugins in
> > >pluginManagements disables them unless explicitely configured in a
> > >sub-module. So this commit should be reverted.
> > >
> > >
> > >In fact the bug described here no longer applies to later M2E
> > >installations. It still complains about plugins that Eclipse does not
> > >know about, but this does not prevent you from using Eclipse. So I
> > >would strongly ask to revert the commit because it breaks the build.
> > >
> > >Uwe
> > >
> > >-----
> > >Uwe Schindler
> > >H.-H.-Meier-Allee 63, D-28213 Bremen
> > >http://www.thetaphi.de
> > >eMail: uwe@thetaphi.de
> > >
> > >
> > >> -----Original Message-----
> > >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> > >> Sent: Friday, January 23, 2015 12:11 PM
> > >> To: dev@tika.apache.org
> > >> Subject: Forbidden-APIS no longer ran because of carzy POM change
> > >>
> > >> Hi,
> > >>
> > >> I just noticed while checking the problems around the
> > >>ExternalParsers that  the TIKA's build no longer runs the
> > >>forbidden-apis Maven plugin, so we got a  few new violation
> > >>especially regarding the toUpper/LowerCase(). In fact the  following
> commit broke this:
> > >>
> > >> Revision: 1624185
> > >> Author: mattmann
> > >> Date: Donnerstag, 11. September 2014 05:11:19
> > >> Message:
> > >> surround in plugin management to resolve
> > >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> > >> execution-not-covered-by-lifecycle-configuration-for-sprin
> > >> ----
> > >> Modified : /tika/trunk/tika-parent/pom.xml
> > >>
> > >> Since that change, the plugin is no longer run by default. I have
> > >>no idea, why  this is like this, but in fact this broke some of the
> > >>globally defined check tasks.
> > >> I have no idea how to reenable it easily.
> > >> So I cannot help, but reverting that commit restores behavior. What
> > >>is the  reason for this commit, there is not even an issue about that.
> > >>I think it seems  to be a workaround for some Eclipse issue, but in
> > >>fact this disables the whole  plugins. To reenable forbidden-apis
> > >>you have to now explicitely enable it in  every module (because
> > >>pluginManagement just gives the config of a plugin,  where without
> > >>that it also enables its execution.
> > >>
> > >> In addition, there is already version 1.7 of forbiddenapis, so you
> > >>can replace
> > >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs
> > >>with Java 8  and Java 9).
> > >>
> > >> The following new violations were found -> and in fact those broke
> > >>code in  turkish locale:
> > >> [INFO]
> > >>--------------------------------------------------------------------
> > >>--
> > >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> > >>--------------------------
> > >> ----------------------------------------------
> > >> [INFO]
> > >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> > >>[INFO]  Scanning for classes to check...
> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> check...
> > >> [INFO] Scanning for API signatures and dependencies...
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:79)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:80)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:88)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:133)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:176)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:221)
> > >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> > >>[Uses default locale]
> > >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> > >> (BasicContentHandlerFactoryTest.java:273)
> > >> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden
> > >>API invocations (in 0.16s), 7 error(s).
> > >> [INFO]
> > >>--------------------------------------------------------------------
> > >>--
> > >>--
> > >> [...]
> > >> [INFO]
> > >>--------------------------------------------------------------------
> > >>--
> > >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> > >>----------------------
> > >> --------------------------------------------------
> > >> [INFO]
> > >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
> > >>[INFO]  Scanning for classes to check...
> > >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> > >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to
> check...
> > >> [INFO] Scanning for API signatures and dependencies...
> > >> [ERROR] Forbidden method invocation:
> > >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> > >>charset]
> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> > >> (TesseractOCRParser.java:309)
> > >> [ERROR] Forbidden method invocation:
> > >>java.lang.String#<init>(byte[],int,int)
> > >> [Uses default charset]
> > >> [ERROR]   in
> org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> > >> (ChmDirectoryListingSet.java:240)
> > >> [ERROR] Forbidden method invocation:
> > >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
> > >>locale]
> > >> [ERROR]   in
> > >> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> > >> (ImageMetadataExtractor.java:304)
> > >> [ERROR] Forbidden method invocation:
> > >> java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
> > >>default  locale]
> > >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> > >> (TesseractOCRConfig.java:214)
> > >> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden
> > >>API invocations (in 0.38s), 4 error(s).
> > >>
> > >> Uwe
> > >>
> > >> -----
> > >> Uwe Schindler
> > >> H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de
> > >> eMail: uwe@thetaphi.de
> > >
> > >



RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi, this may also help, it also brings the needed information:

https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

In fact the problem is: Eclipse has no idea how this plugin should be executed internally in Eclipse. But as this is just a "check plugin" that does not affect the build output at all, you can leave it disabled.

If you scroll down, you see that Eclipse 4.2+ fixes this problem: Disable the plugin for Maven using Project properties -> Maven -> Lifecycle mappings -> ignore

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Mattmann, Chris A (3980) [mailto:chris.a.mattmann@jpl.nasa.gov]
> Sent: Friday, January 23, 2015 4:13 PM
> To: dev@tika.apache.org
> Subject: Re: Forbidden-APIS no longer ran because of carzy POM change
> 
> Hi Uwe,
> 
> Thanks. I will check it out. Like I said, I’m not OK reverting anything if my
> Eclipse keeps complaining at me so we’ll need a fix that handles both. Let me
> try with the latest version of Eclipse and m2e and see if (with your patch) the
> issue goes away.
> 
> Cheers,
> Chris
> 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> Chris Mattmann, Ph.D.
> Chief Architect
> Instrument Software and Science Data Systems Section (398) NASA Jet
> Propulsion Laboratory Pasadena, CA 91109 USA
> Office: 168-519, Mailstop: 168-527
> Email: chris.a.mattmann@nasa.gov
> WWW:  http://sunset.usc.edu/~mattmann/
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> Adjunct Associate Professor, Computer Science Department University of
> Southern California, Los Angeles, CA 90089 USA
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Uwe Schindler <uw...@thetaphi.de>
> Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
> Date: Friday, January 23, 2015 at 3:59 AM
> To: "dev@tika.apache.org" <de...@tika.apache.org>
> Subject: RE: Forbidden-APIS no longer ran because of carzy POM change
> 
> >Here ist he explanation why the plugin is no longer called because of
> >this:
> >
> >- Works for me too, but can anyone explain why? –  Andrew Swan May 15
> '13
> >at 6:26
> >- @Andrew I think this works because m2e is not looking for plugins in
> >pluginManagement, but only in build/plugins. In the Maven world, there
> >is a difference between the two - the former defines "if you happen to
> >use this plugin, here's the configuration to use", whereas the latter
> >states "use this plugin". See this post and its top two answers. –
> >GreenGiant Jul 5 '13 at 17:52
> >- I agree with @GreenGiant. I tried this solution but it then breaks
> >the compilation since the aspectj plugin is not called before
> >compilation. – Pierre Aug 30 '13 at 20:21
> >
> >This explains the change. In fact placing the plugins in
> >pluginManagements disables them unless explicitely configured in a
> >sub-module. So this commit should be reverted.
> >
> >
> >In fact the bug described here no longer applies to later M2E
> >installations. It still complains about plugins that Eclipse does not
> >know about, but this does not prevent you from using Eclipse. So I
> >would strongly ask to revert the commit because it breaks the build.
> >
> >Uwe
> >
> >-----
> >Uwe Schindler
> >H.-H.-Meier-Allee 63, D-28213 Bremen
> >http://www.thetaphi.de
> >eMail: uwe@thetaphi.de
> >
> >
> >> -----Original Message-----
> >> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> >> Sent: Friday, January 23, 2015 12:11 PM
> >> To: dev@tika.apache.org
> >> Subject: Forbidden-APIS no longer ran because of carzy POM change
> >>
> >> Hi,
> >>
> >> I just noticed while checking the problems around the ExternalParsers
> >>that  the TIKA's build no longer runs the forbidden-apis Maven plugin,
> >>so we got a  few new violation especially regarding the
> >>toUpper/LowerCase(). In fact the  following commit broke this:
> >>
> >> Revision: 1624185
> >> Author: mattmann
> >> Date: Donnerstag, 11. September 2014 05:11:19
> >> Message:
> >> surround in plugin management to resolve
> >> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> >> execution-not-covered-by-lifecycle-configuration-for-sprin
> >> ----
> >> Modified : /tika/trunk/tika-parent/pom.xml
> >>
> >> Since that change, the plugin is no longer run by default. I have no
> >>idea, why  this is like this, but in fact this broke some of the
> >>globally defined check tasks.
> >> I have no idea how to reenable it easily.
> >> So I cannot help, but reverting that commit restores behavior. What
> >>is the  reason for this commit, there is not even an issue about that.
> >>I think it seems  to be a workaround for some Eclipse issue, but in
> >>fact this disables the whole  plugins. To reenable forbidden-apis you
> >>have to now explicitely enable it in  every module (because
> >>pluginManagement just gives the config of a plugin,  where without
> >>that it also enables its execution.
> >>
> >> In addition, there is already version 1.7 of forbiddenapis, so you
> >>can replace
> >> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs with
> >>Java 8  and Java 9).
> >>
> >> The following new violations were found -> and in fact those broke
> >>code in  turkish locale:
> >> [INFO]
> >>----------------------------------------------------------------------
> >>--  [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
> >>--------------------------
> >> ----------------------------------------------
> >> [INFO]
> >> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
> >>[INFO]  Scanning for classes to check...
> >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to check...
> >> [INFO] Scanning for API signatures and dependencies...
> >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >>[Uses default locale]
> >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> (BasicContentHandlerFactoryTest.java:79)
> >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >>[Uses default locale]
> >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> (BasicContentHandlerFactoryTest.java:80)
> >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >>[Uses default locale]
> >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> (BasicContentHandlerFactoryTest.java:88)
> >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >>[Uses default locale]
> >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> (BasicContentHandlerFactoryTest.java:133)
> >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >>[Uses default locale]
> >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> (BasicContentHandlerFactoryTest.java:176)
> >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >>[Uses default locale]
> >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> (BasicContentHandlerFactoryTest.java:221)
> >> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> >>[Uses default locale]
> >> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> >> (BasicContentHandlerFactoryTest.java:273)
> >> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
> >>invocations (in 0.16s), 7 error(s).
> >> [INFO]
> >>----------------------------------------------------------------------
> >>--
> >> [...]
> >> [INFO]
> >>----------------------------------------------------------------------
> >>--  [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
> >>----------------------
> >> --------------------------------------------------
> >> [INFO]
> >> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
> >>[INFO]  Scanning for classes to check...
> >> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading
> >>bundled  API signatures: jdk-deprecated [INFO] Loading classes to check...
> >> [INFO] Scanning for API signatures and dependencies...
> >> [ERROR] Forbidden method invocation:
> >> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> >>charset]
> >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> >> (TesseractOCRParser.java:309)
> >> [ERROR] Forbidden method invocation:
> >>java.lang.String#<init>(byte[],int,int)
> >> [Uses default charset]
> >> [ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> >> (ChmDirectoryListingSet.java:240)
> >> [ERROR] Forbidden method invocation:
> >> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
> >>locale]
> >> [ERROR]   in
> >> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> >> (ImageMetadataExtractor.java:304)
> >> [ERROR] Forbidden method invocation:
> >> java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
> >>default  locale]
> >> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> >> (TesseractOCRConfig.java:214)
> >> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API
> >>invocations (in 0.38s), 4 error(s).
> >>
> >> Uwe
> >>
> >> -----
> >> Uwe Schindler
> >> H.-H.-Meier-Allee 63, D-28213 Bremen
> >> http://www.thetaphi.de
> >> eMail: uwe@thetaphi.de
> >
> >



Re: Forbidden-APIS no longer ran because of carzy POM change

Posted by "Mattmann, Chris A (3980)" <ch...@jpl.nasa.gov>.
Hi Uwe,

Thanks. I will check it out. Like I said, I’m not OK reverting anything
if my Eclipse keeps complaining at me so we’ll need a fix that handles
both. Let me try with the latest version of Eclipse and m2e and see if
(with your patch) the issue goes away.

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: chris.a.mattmann@nasa.gov
WWW:  http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Uwe Schindler <uw...@thetaphi.de>
Reply-To: "dev@tika.apache.org" <de...@tika.apache.org>
Date: Friday, January 23, 2015 at 3:59 AM
To: "dev@tika.apache.org" <de...@tika.apache.org>
Subject: RE: Forbidden-APIS no longer ran because of carzy POM change

>Here ist he explanation why the plugin is no longer called because of
>this:
>
>- Works for me too, but can anyone explain why? –  Andrew Swan May 15 '13
>at 6:26		
>- @Andrew I think this works because m2e is not looking for plugins in
>pluginManagement, but only in build/plugins. In the Maven world, there is
>a difference between the two - the former defines "if you happen to use
>this plugin, here's the configuration to use", whereas the latter states
>"use this plugin". See this post and its top two answers. –  GreenGiant
>Jul 5 '13 at 17:52
>- I agree with @GreenGiant. I tried this solution but it then breaks the
>compilation since the aspectj plugin is not called before compilation. –
>Pierre Aug 30 '13 at 20:21
>
>This explains the change. In fact placing the plugins in
>pluginManagements disables them unless explicitely configured in a
>sub-module. So this commit should be reverted.
>
>
>In fact the bug described here no longer applies to later M2E
>installations. It still complains about plugins that Eclipse does not
>know about, but this does not prevent you from using Eclipse. So I would
>strongly ask to revert the commit because it breaks the build.
>
>Uwe
>
>-----
>Uwe Schindler
>H.-H.-Meier-Allee 63, D-28213 Bremen
>http://www.thetaphi.de
>eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: Uwe Schindler [mailto:uwe@thetaphi.de]
>> Sent: Friday, January 23, 2015 12:11 PM
>> To: dev@tika.apache.org
>> Subject: Forbidden-APIS no longer ran because of carzy POM change
>> 
>> Hi,
>> 
>> I just noticed while checking the problems around the ExternalParsers
>>that
>> the TIKA's build no longer runs the forbidden-apis Maven plugin, so we
>>got a
>> few new violation especially regarding the toUpper/LowerCase(). In fact
>>the
>> following commit broke this:
>> 
>> Revision: 1624185
>> Author: mattmann
>> Date: Donnerstag, 11. September 2014 05:11:19
>> Message:
>> surround in plugin management to resolve
>> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
>> execution-not-covered-by-lifecycle-configuration-for-sprin
>> ----
>> Modified : /tika/trunk/tika-parent/pom.xml
>> 
>> Since that change, the plugin is no longer run by default. I have no
>>idea, why
>> this is like this, but in fact this broke some of the globally defined
>>check tasks.
>> I have no idea how to reenable it easily.
>> So I cannot help, but reverting that commit restores behavior. What is
>>the
>> reason for this commit, there is not even an issue about that. I think
>>it seems
>> to be a workaround for some Eclipse issue, but in fact this disables
>>the whole
>> plugins. To reenable forbidden-apis you have to now explicitely enable
>>it in
>> every module (because pluginManagement just gives the config of a
>>plugin,
>> where without that it also enables its execution.
>> 
>> In addition, there is already version 1.7 of forbiddenapis, so you can
>>replace
>> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs with
>>Java 8
>> and Java 9).
>> 
>> The following new violations were found -> and in fact those broke code
>>in
>> turkish locale:
>> [INFO] 
>>------------------------------------------------------------------------
>> [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO]
>>--------------------------
>> ----------------------------------------------
>> [INFO]
>> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core --- [INFO]
>> Scanning for classes to check...
>> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading bundled
>> API signatures: jdk-deprecated [INFO] Loading classes to check...
>> [INFO] Scanning for API signatures and dependencies...
>> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> [Uses default locale]
>> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> (BasicContentHandlerFactoryTest.java:79)
>> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> [Uses default locale]
>> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> (BasicContentHandlerFactoryTest.java:80)
>> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> [Uses default locale]
>> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> (BasicContentHandlerFactoryTest.java:88)
>> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> [Uses default locale]
>> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> (BasicContentHandlerFactoryTest.java:133)
>> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> [Uses default locale]
>> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> (BasicContentHandlerFactoryTest.java:176)
>> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> [Uses default locale]
>> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> (BasicContentHandlerFactoryTest.java:221)
>> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
>> [Uses default locale]
>> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
>> (BasicContentHandlerFactoryTest.java:273)
>> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
>> invocations (in 0.16s), 7 error(s).
>> [INFO] 
>>------------------------------------------------------------------------
>> [...]
>> [INFO] 
>>------------------------------------------------------------------------
>> [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO]
>>----------------------
>> --------------------------------------------------
>> [INFO]
>> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
>>[INFO]
>> Scanning for classes to check...
>> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading bundled
>> API signatures: jdk-deprecated [INFO] Loading classes to check...
>> [INFO] Scanning for API signatures and dependencies...
>> [ERROR] Forbidden method invocation:
>> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
>> charset]
>> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
>> (TesseractOCRParser.java:309)
>> [ERROR] Forbidden method invocation:
>>java.lang.String#<init>(byte[],int,int)
>> [Uses default charset]
>> [ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
>> (ChmDirectoryListingSet.java:240)
>> [ERROR] Forbidden method invocation:
>> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default
>>locale]
>> [ERROR]   in
>> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
>> (ImageMetadataExtractor.java:304)
>> [ERROR] Forbidden method invocation:
>> java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses
>>default
>> locale]
>> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
>> (TesseractOCRConfig.java:214)
>> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API
>> invocations (in 0.38s), 4 error(s).
>> 
>> Uwe
>> 
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>
>


RE: Forbidden-APIS no longer ran because of carzy POM change

Posted by Uwe Schindler <uw...@thetaphi.de>.
Here ist he explanation why the plugin is no longer called because of this:

- Works for me too, but can anyone explain why? –  Andrew Swan May 15 '13 at 6:26		
- @Andrew I think this works because m2e is not looking for plugins in pluginManagement, but only in build/plugins. In the Maven world, there is a difference between the two - the former defines "if you happen to use this plugin, here's the configuration to use", whereas the latter states "use this plugin". See this post and its top two answers. –  GreenGiant Jul 5 '13 at 17:52 
- I agree with @GreenGiant. I tried this solution but it then breaks the compilation since the aspectj plugin is not called before compilation. –  Pierre Aug 30 '13 at 20:21

This explains the change. In fact placing the plugins in pluginManagements disables them unless explicitely configured in a sub-module. So this commit should be reverted.


In fact the bug described here no longer applies to later M2E installations. It still complains about plugins that Eclipse does not know about, but this does not prevent you from using Eclipse. So I would strongly ask to revert the commit because it breaks the build.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> Sent: Friday, January 23, 2015 12:11 PM
> To: dev@tika.apache.org
> Subject: Forbidden-APIS no longer ran because of carzy POM change
> 
> Hi,
> 
> I just noticed while checking the problems around the ExternalParsers that
> the TIKA's build no longer runs the forbidden-apis Maven plugin, so we got a
> few new violation especially regarding the toUpper/LowerCase(). In fact the
> following commit broke this:
> 
> Revision: 1624185
> Author: mattmann
> Date: Donnerstag, 11. September 2014 05:11:19
> Message:
> surround in plugin management to resolve
> http://stackoverflow.com/questions/6352208/how-to-solve-plugin-
> execution-not-covered-by-lifecycle-configuration-for-sprin
> ----
> Modified : /tika/trunk/tika-parent/pom.xml
> 
> Since that change, the plugin is no longer run by default. I have no idea, why
> this is like this, but in fact this broke some of the globally defined check tasks.
> I have no idea how to reenable it easily.
> So I cannot help, but reverting that commit restores behavior. What is the
> reason for this commit, there is not even an issue about that. I think it seems
> to be a workaround for some Eclipse issue, but in fact this disables the whole
> plugins. To reenable forbidden-apis you have to now explicitely enable it in
> every module (because pluginManagement just gives the config of a plugin,
> where without that it also enables its execution.
> 
> In addition, there is already version 1.7 of forbiddenapis, so you can replace
> 1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs with Java 8
> and Java 9).
> 
> The following new violations were found -> and in fact those broke code in
> turkish locale:
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Apache Tika core 1.8-SNAPSHOT [INFO] --------------------------
> ----------------------------------------------
> [INFO]
> [INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core --- [INFO]
> Scanning for classes to check...
> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading bundled
> API signatures: jdk-deprecated [INFO] Loading classes to check...
> [INFO] Scanning for API signatures and dependencies...
> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> [Uses default locale]
> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> (BasicContentHandlerFactoryTest.java:79)
> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> [Uses default locale]
> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> (BasicContentHandlerFactoryTest.java:80)
> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> [Uses default locale]
> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> (BasicContentHandlerFactoryTest.java:88)
> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> [Uses default locale]
> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> (BasicContentHandlerFactoryTest.java:133)
> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> [Uses default locale]
> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> (BasicContentHandlerFactoryTest.java:176)
> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> [Uses default locale]
> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> (BasicContentHandlerFactoryTest.java:221)
> [ERROR] Forbidden method invocation: java.lang.String#toLowerCase()
> [Uses default locale]
> [ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest
> (BasicContentHandlerFactoryTest.java:273)
> [ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API
> invocations (in 0.16s), 7 error(s).
> [INFO] ------------------------------------------------------------------------
> [...]
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Apache Tika parsers 1.8-SNAPSHOT [INFO] ----------------------
> --------------------------------------------------
> [INFO]
> [INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers --- [INFO]
> Scanning for classes to check...
> [INFO] Reading bundled API signatures: jdk-unsafe [INFO] Reading bundled
> API signatures: jdk-deprecated [INFO] Loading classes to check...
> [INFO] Scanning for API signatures and dependencies...
> [ERROR] Forbidden method invocation:
> java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default
> charset]
> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2
> (TesseractOCRParser.java:309)
> [ERROR] Forbidden method invocation: java.lang.String#<init>(byte[],int,int)
> [Uses default charset]
> [ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet
> (ChmDirectoryListingSet.java:240)
> [ERROR] Forbidden method invocation:
> java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default locale]
> [ERROR]   in
> org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1
> (ImageMetadataExtractor.java:304)
> [ERROR] Forbidden method invocation:
> java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default
> locale]
> [ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig
> (TesseractOCRConfig.java:214)
> [ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API
> invocations (in 0.38s), 4 error(s).
> 
> Uwe
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de