Charles Mager created MBUILDCACHE-118:
-----------------------------------------
Summary: Use of extension breaks IntelliJ generate sources
Key: MBUILDCACHE-118
URL: https://issues.apache.org/jira/browse/MBUILDCACHE-118
Project: Maven Build Cache Extension
Issue Type: Bug
Affects Versions: 1.2.0
Reporter: Charles Mager
Attachments: build-cache-issue.zip
When running {{Maven > Generate Sources and Update Folders}} from IntelliJ with
the [Maven Build Cache
Extension|https://maven.apache.org/extensions/maven-build-cache-extension/]
present, I get this error in the output:
{{"org.apache.maven.execution.ExecutionListener.projectDiscoveryStarted(org.apache.maven.execution.ExecutionEvent)"
because "this.delegate" is null}}
I think the delegate it refers to is the one in
[ChainedListener.|https://github.com/apache/maven-build-cache-extension/blob/e2f31d9c359b146d9bb5ad70ee037ac6a25d7ce4/src/main/java/org/apache/maven/buildcache/ChainedListener.java].
I appreciate this works running via the Maven CLI, but for whatever reason
IntelliJ doesn't provide a listener with the request. I'm not clear on whether
IntelliJ is incorrectly using the API or if the extension should handle this
scenario, but it would seem a fairly easy fix to not call the delegate methods
if it's not present.
I've attached a repro that would be demonstrated in IntelliJ - just run
Generate Sources and Update Folders to see the error.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)