Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: startup failed: [ERROR] General error during conversion: java.lang.NullPointerException #158

Open
papanito opened this issue May 27, 2020 · 6 comments

Comments

@papanito
Copy link

papanito commented May 27, 2020

I have a project which was build successfully in the past. as of a sudden it fails with

[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.9.0:compile (default) on project demo-ci-pipeline: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: startup failed:
[ERROR] General error during conversion: java.lang.NullPointerException

My configuration looks like this:

<plugin>
    <groupId>org.codehaus.gmavenplus</groupId>
    <artifactId>gmavenplus-plugin</artifactId>
    <configuration>
        <sources>
            <source>
                <directory>${project.basedir}/vars</directory>
                <includes>
                    <include>**/*.groovy</include>
                </includes>
            </source>
        </sources>
        <testSources>
            <testSource>
                <directory>${project.basedir}/test</directory>
                <includes>
                    <include>**/*.groovy</include>
                </includes>
            </testSource>
        </testSources>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>addSources</goal>
                <goal>addTestSources</goal>
                <goal>compile</goal>
                <goal>compileTests</goal>
            </goals>
        </execution>
    </executions>
</plugin>

and

...
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>3.0.4</version>
            <type>pom</type> <!-- required JUST since Groovy 2.5.0 -->
        </dependency>
...
$ mvn compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ch.mycompany.ci.pipeline:demo-ci-pipeline:jar:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.gmavenplus:gmavenplus-plugin is missing. @ line 36, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------< ch.mycompany.ci.pipeline:demo-ci-pipeline >-------------
[INFO] Building demo-ci-pipeline 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (create-buildnumber) @ demo-ci-pipeline ---
[INFO] Change the default 'git' provider implementation to 'jgit'.
[INFO] Storing buildNumber: 52138dca99d84e0c5fcec6f3843c5cf20e355c42 at timestamp: 1590583173768
[INFO] Storing buildScmBranch: feature/DEVA-44750
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-timestamp (create-timestamp) @ demo-ci-pipeline ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (copy-vars-resources) @ demo-ci-pipeline ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] skip non existing resourceDirectory D:\development\data\git\JENKINS\demo-ci-pipeline\src
[INFO]
[INFO] --- gmavenplus-plugin:1.9.0:addSources (default) @ demo-ci-pipeline ---
[INFO]
[INFO] --- gmavenplus-plugin:1.9.0:addTestSources (default) @ demo-ci-pipeline ---
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (add-source) @ demo-ci-pipeline ---
[INFO] Source directory: D:\development\data\git\JENKINS\demo-ci-pipeline\vars added.
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ demo-ci-pipeline ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\development\data\git\JENKINS\demo-ci-pipeline\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ demo-ci-pipeline ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- gmavenplus-plugin:1.9.0:compile (default) @ demo-ci-pipeline ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
[INFO] Using Groovy 3.0.4 to perform compile.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.858 s
[INFO] Finished at: 2020-05-27T14:39:39+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.9.0:compile (default) on project demo-ci-pipeline: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: startup failed:
[ERROR] General error during conversion: java.lang.NullPointerException
[ERROR]
[ERROR] java.lang.NullPointerException
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.validateExpressionListElement(AstBuilder.java:3379)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitExpressionListElement(AstBuilder.java:3358)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitEnhancedArgumentListElement(AstBuilder.java:2581)
[ERROR]         at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
[ERROR]         at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
[ERROR]         at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
[ERROR]         at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[ERROR]         at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitEnhancedArgumentListInPar(AstBuilder.java:2518)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExpression(AstBuilder.java:2045)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExprAlt(AstBuilder.java:2016)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExprAlt(AstBuilder.java:341)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$CommandExprAltContext.accept(GroovyParser.java:8041)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:20)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visit(AstBuilder.java:4177)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitEnhancedStatementExpression(AstBuilder.java:2179)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitAssignmentExprAlt(AstBuilder.java:3001)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitAssignmentExprAlt(AstBuilder.java:341)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$AssignmentExprAltContext.accept(GroovyParser.java:8594)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:20)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visit(AstBuilder.java:4177)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExpression(AstBuilder.java:2031)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExprAlt(AstBuilder.java:2016)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExprAlt(AstBuilder.java:341)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$CommandExprAltContext.accept(GroovyParser.java:8041)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:48)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParserBaseVisitor.visitExpressionStmtAlt(GroovyParserBaseVisitor.java:411)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$ExpressionStmtAltContext.accept(GroovyParser.java:6732)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:20)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visit(AstBuilder.java:4177)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatement(AstBuilder.java:3976)
[ERROR]         at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
[ERROR]         at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
[ERROR]         at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[ERROR]         at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatements(AstBuilder.java:3965)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatementsOpt(AstBuilder.java:3952)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitClosure(AstBuilder.java:3614)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitClosureOrLambdaExpression(AstBuilder.java:3940)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitPathElement(AstBuilder.java:2355)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.lambda$createPathExpression$35(AstBuilder.java:4264)
[ERROR]         at java.base/java.util.stream.ReduceOps$1ReducingSink.accept(ReduceOps.java:80)
[ERROR]         at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
[ERROR]         at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
[ERROR]         at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[ERROR]         at java.base/java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:553)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.createPathExpression(AstBuilder.java:4260)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitPathExpression(AstBuilder.java:2191)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitPostfixExpression(AstBuilder.java:2695)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitPostfixExpression(AstBuilder.java:341)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$PostfixExpressionContext.accept(GroovyParser.java:8082)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:48)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParserBaseVisitor.visitPostfixExprAlt(GroovyParserBaseVisitor.java:163)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$PostfixExprAltContext.accept(GroovyParser.java:8163)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:20)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visit(AstBuilder.java:4177)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExpression(AstBuilder.java:2031)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExprAlt(AstBuilder.java:2016)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExprAlt(AstBuilder.java:341)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$CommandExprAltContext.accept(GroovyParser.java:8041)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:48)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParserBaseVisitor.visitExpressionStmtAlt(GroovyParserBaseVisitor.java:411)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$ExpressionStmtAltContext.accept(GroovyParser.java:6732)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:20)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visit(AstBuilder.java:4177)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatement(AstBuilder.java:3976)
[ERROR]         at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
[ERROR]         at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
[ERROR]         at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[ERROR]         at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatements(AstBuilder.java:3965)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatementsOpt(AstBuilder.java:3952)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitBlock(AstBuilder.java:2010)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitMethodBody(AstBuilder.java:1721)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitMethodDeclaration(AstBuilder.java:1521)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitMethodDeclaration(AstBuilder.java:341)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$MethodDeclarationContext.accept(GroovyParser.java:2216)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:48)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParserBaseVisitor.visitMethodDeclarationStmtAlt(GroovyParserBaseVisitor.java:403)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$MethodDeclarationStmtAltContext.accept(GroovyParser.java:6721)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:48)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParserBaseVisitor.visitScriptStatement(GroovyParserBaseVisitor.java:475)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$ScriptStatementContext.accept(GroovyParser.java:469)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:20)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visit(AstBuilder.java:4177)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.lambda$visitScriptStatements$1(AstBuilder.java:472)
[ERROR]         at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
[ERROR]         at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
[ERROR]         at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
[ERROR]         at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[ERROR]         at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitScriptStatements(AstBuilder.java:473)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCompilationUnit(AstBuilder.java:434)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visitCompilationUnit(AstBuilder.java:341)
[ERROR]         at org.apache.groovy.parser.antlr4.GroovyParser$CompilationUnitContext.accept(GroovyParser.java:318)
[ERROR]         at groovyjarjarantlr4.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:20)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.visit(AstBuilder.java:4177)
[ERROR]         at org.apache.groovy.parser.antlr4.AstBuilder.buildAST(AstBuilder.java:424)
[ERROR]         at org.apache.groovy.parser.antlr4.Antlr4ParserPlugin.buildAST(Antlr4ParserPlugin.java:58)
[ERROR]         at org.codehaus.groovy.control.SourceUnit.convert(SourceUnit.java:244)
[ERROR]         at org.codehaus.groovy.control.CompilationUnit.lambda$addPhaseOperations$1(CompilationUnit.java:191)
[ERROR]         at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:880)
[ERROR]         at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:650)
[ERROR]         at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:627)
[ERROR]         at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:606)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]         at org.codehaus.gmavenplus.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:214)
[ERROR]         at org.codehaus.gmavenplus.mojo.AbstractCompileMojo.doCompile(AbstractCompileMojo.java:288)
[ERROR]         at org.codehaus.gmavenplus.mojo.CompileMojo.execute(CompileMojo.java:69)
[ERROR]         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR]         at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR]         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR]         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
[ERROR]         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR]         at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR] 1 error
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
@papanito papanito changed the title [ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.9.0:compile (default) on project demo-ci-pipeline: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: startup failed: [ERROR] General error during conversion: java.lang.NullPointerException Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: startup failed: [ERROR] General error during conversion: java.lang.NullPointerException May 27, 2020
@papanito
Copy link
Author

Suggestion from #84 (comment) did not help

@papanito
Copy link
Author

So if I define the dependency globally then it does not work, but when defined as part of the plugin as follows, it seems to work...

<plugins>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <dependencies>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>3.0.4</version>
                <type>pom</type> <!-- required JUST since Groovy 2.5.0 -->
            </dependency>
        </dependencies>

Did I understand something wrong? Please advice, thanks

@keeganwitt
Copy link
Member

keeganwitt commented May 27, 2020

It looks to me like this is a multimodule project. The plugin would need Groovy to be a dependency of the submodule(s) in which it runs

Although it also looks like it is finding Groovy as a dependency, are you sure when it's working that Maven is choosing the same version (mvn dependency:tree)?

@papanito
Copy link
Author

papanito commented Jun 4, 2020

@keeganwitt no it's a single module project.

But as you suspected, it actually takes different versions.

dependency as part of plugin

$ mvn dependency:tree |grep groovy
[INFO] +- org.codehaus.groovy:groovy-all:pom:3.0.4:compile

dependency defined globally

When done as commented above it looks as follows:

$ mvn dependency:tree |grep groovy
[INFO] |  +- org.codehaus.groovy:groovy-all:jar:2.4.11:compile

However I tried to reproduce the issue again and I am not able. There is definitely something odd, but unless I cannot properly reproduce the issue I may close the issue.

@keeganwitt
Copy link
Member

Just to rule out the obvious, there's no possibility that there's profiles affecting results here?

@papanito
Copy link
Author

papanito commented Jun 5, 2020

I can definitively rule out this - so no, there is no profile which can affect the result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants