[
https://issues.apache.org/jira/browse/MBUILDCACHE-56?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17715452#comment-17715452
]
ASF GitHub Bot commented on MBUILDCACHE-56:
-------------------------------------------
olamy opened a new pull request, #73:
URL: https://github.com/apache/maven-build-cache-extension/pull/73
Signed-off-by: Olivier Lamy <[email protected]>
Following this checklist to help us incorporate your
contribution quickly and easily:
- [ ] Make sure there is a [MBUILDCACHE JIRA
issue](https://issues.apache.org/jira/browse/MBUILDCACHE) filed
for the change (usually before you start working on it). Trivial
changes like typos do not
require a JIRA issue. Your pull request should address just this
issue, without
pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line
and body.
- [ ] Format the pull request title like `[MBUILDCACHE-XXX] - Fixes bug in
ApproximateQuantiles`,
where you replace `MBUILDCACHE-XXX` with the appropriate JIRA issue.
Best practice
is to use the JIRA issue title in the pull request title and in the
first line of the
commit message.
- [ ] Write a pull request description that is detailed enough to
understand what the pull request does, how, and why.
- [ ] Run `mvn clean verify` to make sure basic checks pass. A more
thorough check will
be performed on your pull request automatically.
- [ ] You have run the [Core IT][core-its] successfully.
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January
2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [ ] I hereby declare this contribution to be licenced under the [Apache
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor
License Agreement](https://www.apache.org/licenses/icla.pdf).
[core-its]: https://maven.apache.org/core-its/core-it-suite/
> NPE with mojo parameters not declared as fields (prevent any saving of cache)
> -----------------------------------------------------------------------------
>
> Key: MBUILDCACHE-56
> URL: https://issues.apache.org/jira/browse/MBUILDCACHE-56
> Project: Maven Build Cache Extension
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Olivier Lamy
> Assignee: Olivier Lamy
> Priority: Blocker
> Fix For: 1.0.1
>
>
> such field from m-enforcer-p
> https://github.com/apache/maven-enforcer/blame/master/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java#L192
> is creating an NPE when trying saving the cache content because there is no
> field but a method!
> This makes the cache extension totally not usable.
> {code}
> java.lang.NullPointerException: Cannot invoke
> "java.lang.reflect.Field.setAccessible(boolean)" because "field" is null
> at org.codehaus.plexus.util.ReflectionUtils.getValueIncludingSuperclasses
> (ReflectionUtils.java:177)
> at org.apache.maven.buildcache.CacheControllerImpl.recordMojoProperties
> (CacheControllerImpl.java:612)
> at org.apache.maven.buildcache.CacheControllerImpl.buildExecutionInfo
> (CacheControllerImpl.java:579)
> at org.apache.maven.buildcache.CacheControllerImpl.save
> (CacheControllerImpl.java:440)
> at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute
> (BuildCacheMojosExecutionStrategy.java:134)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:160)
> at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> (LifecycleModuleBuilder.java:105)
> at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> (LifecycleModuleBuilder.java:73)
> at
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
> (SingleThreadedBuilder.java:53)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
> (LifecycleStarter.java:118)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:260)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:172)
> at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:100)
> at org.apache.maven.cli.MavenCli.execute (MavenCli.java:821)
> at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:270)
> at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:77)
> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke (Method.java:568)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
> (Launcher.java:282)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch
> (Launcher.java:225)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
> (Launcher.java:406)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main
> (Launcher.java:347)
> {code}
> Ideally we should check if there is a field and throw IAE in this case.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)