I'm using Jdk 11.

On Wed, 8 Jul 2020, 07:11 LINUS FERNANDES, <linus.fernan...@gmail.com>
wrote:

> I get the following error for code narc version 0.16 and 0.17 as set in
> the configuration.
>
>
>
>
> ERROR: Unable to make
> jdk.internal.loader.ClassLoaders$AppClassLoader(jdk.internal.loader.ClassLoaders$PlatformClassLoader,jdk.internal.loader.URLClassPath)
> accessible: module java.base does not "opens jdk.internal.loader" to
> unnamed module @7085bdee
>      [java] java.lang.reflect.InaccessibleObjectException: Unable to make
> jdk.internal.loader.ClassLoaders$AppClassLoader(jdk.internal.loader.ClassLoaders$PlatformClassLoader,jdk.internal.loader.URLClassPath)
> accessible: module java.base does not "opens jdk.internal.loader" to
> unnamed module @7085bdee           [java]     at
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
>                        [java]     at
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
>                        [java]     at
> java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:189)
>                                  [java]     at
> java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:182)
>                                          [java]     at
> org.codehaus.groovy.reflection.CachedConstructor$1.run(CachedConstructor.java:41)
>                                    [java]     at
> java.base/java.security.AccessController.doPrivileged(Native Method)
> [java]     at
> org.codehaus.groovy.reflection.CachedConstructor.<init>(CachedConstructor.java:39)
>                                   [java]     at
> org.codehaus.groovy.reflection.CachedClass$2.initValue(CachedClass.java:73)
>                                          [java]     at
> org.codehaus.groovy.reflection.CachedClass$2.initValue(CachedClass.java:63)
>                                          [java]     at
> org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
>                                            [java]     at
> org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
>  [java]     at
> org.codehaus.groovy.reflection.CachedClass.getConstructors(CachedClass.java:257)
>                                     [java]     at
> groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:192)
> [java]     at groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:196)
>             [java]     at
> groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createNormalMetaClass(MetaClassRegistry.java:149)
>              [java]     at
> groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createWithCustomLookup(MetaClassRegistry.java:139)
>             [java]     at
> groovy.lang.MetaClassRegistry$MetaClassCreationHandle.create(MetaClassRegistry.java:122)
>                             [java]     at
> org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:165)
>                                   [java]     at
> org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:195)
>                                            [java]     at
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:214)
>             [java]     at
> org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:747)
>                                       [java]     at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:107)
>                            [java]     at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:148)
>                            [java]     at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
>                                [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
>                                [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
>                                [java]     at
> org.codenarc.util.io.ClassPathResource.getInputStream(ClassPathResource.groovy:59)
>                                   [java]     at
> org.codenarc.util.io.Resource$getInputStream.call(Unknown Source)
>  [java]     at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
>                                [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
>                                [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
>                                [java] CodeNarc - static analysis for
> Groovy',                                          [java] Usage: java
> org.codenarc.CodeNarc [OPTIONS]
> [java]     at
> org.codenarc.util.io.ClassPathResource.getInputStream(ClassPathResource.groovy:39)
>                                   [java]     at
> org.codenarc.util.io.ClassPathResource$getInputStream.call(Unknown Source)
>                                           [java]     at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
>                                [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
>                                [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
>                                [java]     at
> org.codenarc.ruleregistry.PropertiesFileRuleRegistry.loadRules(PropertiesFileRuleRegistry.groovy:52)
>                 [java]     at
> org.codenarc.ruleregistry.PropertiesFileRuleRegistry.this$2$loadRules(PropertiesFileRuleRegistry.groovy)
>             [java]   where OPTIONS are zero or more command-line options of
> the form "-NAME[=VALUE]":                                           [java]
>    -basedir=<DIR>                   [java]     at
> org.codenarc.ruleregistry.PropertiesFileRuleRegistry$this$2$loadRules.callCurrent(Unknown
> Source)                     [java]         The base (root) directory for
> the source code to be analyzed.            [java]     at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
>                         [java]         Defaults to the current directory
> (".").                                 [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
>
> Setting the CodeNarc version to 1.6 throws the  following exception where
> the plugin can't  find a groovy class:
>
> ERROR: java.lang.NoClassDefFoundError:
> org/codehaus/groovy/runtime/BytecodeInterface8
>           [java] java.lang.NoClassDefFoundError:
> org/codehaus/groovy/runtime/BytecodeInterface8
>                  [java]     at
> org.codenarc.CodeNarc.execute(CodeNarc.groovy:158)
> [java]     at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)                                        [java]     at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>                     [java]     at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>             [java]     at
> java.base/java.lang.reflect.Method.invoke(Method.java:566)
> [java]     at
> org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)
>                                 [java]     at
> org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:63)
>                             [java]     at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
>                                [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
>                                [java]     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
>                                [java]     at
> org.codenarc.CodeNarc.main(CodeNarc.groovy:147)
>  [java] Caused by: java.lang.ClassNotFoundException:
> org.codehaus.groovy.runtime.BytecodeInterface8
>      [java]     at
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
>                              [java]     at
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
>
> Additionally, the Github repo at
>
> https://github.com/gleclaire/codenarc-maven-plugin/
>
> has been archived by the owner.
>
>
>
>
>
> On Wed, 8 Jul 2020, 06:24 LINUS FERNANDES, <linus.fernan...@gmail.com>
> wrote:
>
>> That's the original error. I also had issues with the 0.22.x version.
>>
>> I still am not clear whether I'm referring to the right CodeNarc plugin
>> version.
>>
>>
>>
>> On Wed, 8 Jul 2020, 00:02 LINUS FERNANDES, <linus.fernan...@gmail.com>
>> wrote:
>>
>>> Ok. Thanks.
>>>
>>> My mistake, apparently.
>>>                  <plugin>
>>> <groupId>org.codenarc</           groupId>
>>> <artifactId>CodeNarc</            artifactId>
>>>  <version>1.6</version>        </plugin>
>>>
>>> I've also had issues with the above.
>>>
>>>  failed to get report for org.codenarc:CodeNarc: Failed to parse plugin
>>> descriptor for org.codenarc:CodeNarc:1.6
>>> (/root/.m2/repository/org/codenarc/CodeNarc/1.6/CodeNarc-1.6.jar): No
>>> plugin descriptor found at META-INF/maven/plugin.xml -> [Help 1]
>>>
>>> What's this about?
>>>
>>> Thanks,
>>> Linus.
>>>
>>>
>>> On Tue, 7 Jul 2020, 22:20 Thomas Broyer, <t.bro...@gmail.com> wrote:
>>>
>>>> This is a Grails plugin, not a Maven plugin.
>>>> http://grails.org/plugin/codenarc
>>>>
>>>> On Tue, Jul 7, 2020 at 5:42 PM LINUS FERNANDES <
>>>> linus.fernan...@gmail.com>
>>>> wrote:
>>>>
>>>> > I'm trying to use the following maven plugin to run static code
>>>> analysis on
>>>> > groovy scripts.
>>>> >
>>>> >         <plugin>
>>>> >           <groupId>org.grails.plugins</groupId>
>>>> >           <artifactId>codenarc</artifactId>
>>>> >           <version>1.6</version>
>>>> >         </plugin>
>>>> >
>>>> > I added the plugin repositories as below since it's not hosted on the
>>>> > superPom's repos.
>>>> >
>>>> >    <pluginRepositories>
>>>> >     <pluginRepository>
>>>> >       <id>grails-plugins</id>
>>>> >       <name>Grails Plugins Repository</name>
>>>> >       <url>https://repo.grails.org/grails/plugins</url>
>>>> >     </pluginRepository>
>>>> >   </pluginRepositories>
>>>> >
>>>> > However, I encounter an error downloading the dependencies since maven
>>>> > expects a codenarc:jar file but a zip file is provided instead.
>>>> >
>>>> > How do I force Maven to download the zip file instead, preferably
>>>> > configuring it within the pom?
>>>> >
>>>> >
>>>> > Regards,
>>>> > Linus.
>>>> >
>>>>
>>>>
>>>> --
>>>> Thomas Broyer
>>>> /tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/> <
>>>> http://xn--nna.ma.xn--bwa-xxb.je/>
>>>>
>>>

Reply via email to