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: u...@thetaphi.de


> -----Original Message-----
> From: Uwe Schindler [mailto:u...@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: u...@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Mattmann, Chris A (3980) [mailto:chris.a.mattm...@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.mattm...@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 <u...@thetaphi.de>
> > Reply-To: "dev@tika.apache.org" <dev@tika.apache.org>
> > Date: Friday, January 23, 2015 at 3:59 AM
> > To: "dev@tika.apache.org" <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: u...@thetaphi.de
> > >
> > >
> > >> -----Original Message-----
> > >> From: Uwe Schindler [mailto:u...@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: u...@thetaphi.de
> > >
> > >


Reply via email to