You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Laird Nelson <lj...@gmail.com> on 2025/07/01 01:24:56 UTC
NPE in MavenProject (3.9.10) in parallel build
Curious if people have seen this NPE before:
https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:9789
We're running with -T8 (
https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:166).
(Github Actions.)
Relevant snippet:
Caused by: java.lang.NullPointerException: Cannot invoke
"java.util.Set.add(Object)" because "this.artifacts" is null
at org.apache.maven.project.MavenProject.getArtifacts
(MavenProject.java:683)
at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.getPathElements
(AbstractJavadocMojo.java:2491)
at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.addJavadocOptions
(AbstractJavadocMojo.java:4550)
at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport
(AbstractJavadocMojo.java:1968)
The fact that it was javadocs I think may be immaterial. It is certainly
the case that MavenProject is not thread safe. Maybe that's by design?
Should I file a bug?
Best,
Laird
Re: NPE in MavenProject (3.9.10) in parallel build
Posted by Tamás Cservenák <ta...@cservenak.net>.
Laird,
Can you try the latest maven-3.9.x branch?
This seems related: https://github.com/apache/maven/pull/2470
Thanks
T
On Thu, Jul 3, 2025 at 2:33 AM Laird Nelson <lj...@gmail.com> wrote:
>
> It is https://github.com/apache/maven/issues/2487. This affects 3.9.10 but
> not 3.9.9 I guess.
>
> On Wed, Jul 2, 2025 at 4:46 PM Laird Nelson <lj...@gmail.com> wrote:
>
> > Looks like https://issues.apache.org/jira/browse/MNG-8256 introduced code
> > that causes this problem
> >
> > On Wed, Jul 2, 2025 at 11:57 AM Laird Nelson <lj...@gmail.com> wrote:
> >
> >> Will do. It's certainly possible, I guess, in 3.9.10.
> >>
> >> Here's one place the non-volatile artifacts instance field is set:
> >> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L661
> >>
> >> Here's another:
> >> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L1457
> >>
> >> And another:
> >> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L1471
> >>
> >> So if for some reason any of those happens, then this:
> >> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L683
> >>
> >> …might be null. We're still trying to figure out how to reproduce this in
> >> a tidy manner; in the meantime my prior message shows the bug tripping in
> >> one of our (public) CI runs.
> >>
> >> On Tue, Jul 1, 2025 at 4:32 AM Elliotte Rusty Harold <el...@ibiblio.org>
> >> wrote:
> >>
> >>> That shouldn't be possible, at least not with the code I see at head.
> >>> Please file a bug though a reproducible test case might be required to
> >>> do anything about this.
> >>>
> >>> On Tue, Jul 1, 2025 at 1:26 AM Laird Nelson <lj...@gmail.com> wrote:
> >>> >
> >>> > Curious if people have seen this NPE before:
> >>> >
> >>> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:9789
> >>> >
> >>> > We're running with -T8 (
> >>> >
> >>> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:166
> >>> ).
> >>> > (Github Actions.)
> >>> >
> >>> > Relevant snippet:
> >>> >
> >>> > Caused by: java.lang.NullPointerException: Cannot invoke
> >>> > "java.util.Set.add(Object)" because "this.artifacts" is null
> >>> > at org.apache.maven.project.MavenProject.getArtifacts
> >>> > (MavenProject.java:683)
> >>> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.getPathElements
> >>> > (AbstractJavadocMojo.java:2491)
> >>> > at
> >>> org.apache.maven.plugins.javadoc.AbstractJavadocMojo.addJavadocOptions
> >>> > (AbstractJavadocMojo.java:4550)
> >>> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport
> >>> > (AbstractJavadocMojo.java:1968)
> >>> >
> >>> > The fact that it was javadocs I think may be immaterial. It is
> >>> certainly
> >>> > the case that MavenProject is not thread safe. Maybe that's by design?
> >>> > Should I file a bug?
> >>> >
> >>> > Best,
> >>> > Laird
> >>>
> >>>
> >>>
> >>> --
> >>> Elliotte Rusty Harold
> >>> elharo@ibiblio.org
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: NPE in MavenProject (3.9.10) in parallel build
Posted by Laird Nelson <lj...@gmail.com>.
It is https://github.com/apache/maven/issues/2487. This affects 3.9.10 but
not 3.9.9 I guess.
On Wed, Jul 2, 2025 at 4:46 PM Laird Nelson <lj...@gmail.com> wrote:
> Looks like https://issues.apache.org/jira/browse/MNG-8256 introduced code
> that causes this problem
>
> On Wed, Jul 2, 2025 at 11:57 AM Laird Nelson <lj...@gmail.com> wrote:
>
>> Will do. It's certainly possible, I guess, in 3.9.10.
>>
>> Here's one place the non-volatile artifacts instance field is set:
>> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L661
>>
>> Here's another:
>> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L1457
>>
>> And another:
>> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L1471
>>
>> So if for some reason any of those happens, then this:
>> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L683
>>
>> …might be null. We're still trying to figure out how to reproduce this in
>> a tidy manner; in the meantime my prior message shows the bug tripping in
>> one of our (public) CI runs.
>>
>> On Tue, Jul 1, 2025 at 4:32 AM Elliotte Rusty Harold <el...@ibiblio.org>
>> wrote:
>>
>>> That shouldn't be possible, at least not with the code I see at head.
>>> Please file a bug though a reproducible test case might be required to
>>> do anything about this.
>>>
>>> On Tue, Jul 1, 2025 at 1:26 AM Laird Nelson <lj...@gmail.com> wrote:
>>> >
>>> > Curious if people have seen this NPE before:
>>> >
>>> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:9789
>>> >
>>> > We're running with -T8 (
>>> >
>>> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:166
>>> ).
>>> > (Github Actions.)
>>> >
>>> > Relevant snippet:
>>> >
>>> > Caused by: java.lang.NullPointerException: Cannot invoke
>>> > "java.util.Set.add(Object)" because "this.artifacts" is null
>>> > at org.apache.maven.project.MavenProject.getArtifacts
>>> > (MavenProject.java:683)
>>> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.getPathElements
>>> > (AbstractJavadocMojo.java:2491)
>>> > at
>>> org.apache.maven.plugins.javadoc.AbstractJavadocMojo.addJavadocOptions
>>> > (AbstractJavadocMojo.java:4550)
>>> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport
>>> > (AbstractJavadocMojo.java:1968)
>>> >
>>> > The fact that it was javadocs I think may be immaterial. It is
>>> certainly
>>> > the case that MavenProject is not thread safe. Maybe that's by design?
>>> > Should I file a bug?
>>> >
>>> > Best,
>>> > Laird
>>>
>>>
>>>
>>> --
>>> Elliotte Rusty Harold
>>> elharo@ibiblio.org
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
Re: NPE in MavenProject (3.9.10) in parallel build
Posted by Laird Nelson <lj...@gmail.com>.
Looks like https://issues.apache.org/jira/browse/MNG-8256 introduced code
that causes this problem
On Wed, Jul 2, 2025 at 11:57 AM Laird Nelson <lj...@gmail.com> wrote:
> Will do. It's certainly possible, I guess, in 3.9.10.
>
> Here's one place the non-volatile artifacts instance field is set:
> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L661
>
> Here's another:
> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L1457
>
> And another:
> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L1471
>
> So if for some reason any of those happens, then this:
> https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L683
>
> …might be null. We're still trying to figure out how to reproduce this in
> a tidy manner; in the meantime my prior message shows the bug tripping in
> one of our (public) CI runs.
>
> On Tue, Jul 1, 2025 at 4:32 AM Elliotte Rusty Harold <el...@ibiblio.org>
> wrote:
>
>> That shouldn't be possible, at least not with the code I see at head.
>> Please file a bug though a reproducible test case might be required to
>> do anything about this.
>>
>> On Tue, Jul 1, 2025 at 1:26 AM Laird Nelson <lj...@gmail.com> wrote:
>> >
>> > Curious if people have seen this NPE before:
>> >
>> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:9789
>> >
>> > We're running with -T8 (
>> >
>> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:166
>> ).
>> > (Github Actions.)
>> >
>> > Relevant snippet:
>> >
>> > Caused by: java.lang.NullPointerException: Cannot invoke
>> > "java.util.Set.add(Object)" because "this.artifacts" is null
>> > at org.apache.maven.project.MavenProject.getArtifacts
>> > (MavenProject.java:683)
>> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.getPathElements
>> > (AbstractJavadocMojo.java:2491)
>> > at
>> org.apache.maven.plugins.javadoc.AbstractJavadocMojo.addJavadocOptions
>> > (AbstractJavadocMojo.java:4550)
>> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport
>> > (AbstractJavadocMojo.java:1968)
>> >
>> > The fact that it was javadocs I think may be immaterial. It is certainly
>> > the case that MavenProject is not thread safe. Maybe that's by design?
>> > Should I file a bug?
>> >
>> > Best,
>> > Laird
>>
>>
>>
>> --
>> Elliotte Rusty Harold
>> elharo@ibiblio.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
Re: NPE in MavenProject (3.9.10) in parallel build
Posted by Laird Nelson <lj...@gmail.com>.
Will do. It's certainly possible, I guess, in 3.9.10.
Here's one place the non-volatile artifacts instance field is set:
https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L661
Here's another:
https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L1457
And another:
https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L1471
So if for some reason any of those happens, then this:
https://github.com/apache/maven/blob/maven-3.9.10/maven-core/src/main/java/org/apache/maven/project/MavenProject.java#L683
…might be null. We're still trying to figure out how to reproduce this in a
tidy manner; in the meantime my prior message shows the bug tripping in one
of our (public) CI runs.
On Tue, Jul 1, 2025 at 4:32 AM Elliotte Rusty Harold <el...@ibiblio.org>
wrote:
> That shouldn't be possible, at least not with the code I see at head.
> Please file a bug though a reproducible test case might be required to
> do anything about this.
>
> On Tue, Jul 1, 2025 at 1:26 AM Laird Nelson <lj...@gmail.com> wrote:
> >
> > Curious if people have seen this NPE before:
> >
> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:9789
> >
> > We're running with -T8 (
> >
> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:166
> ).
> > (Github Actions.)
> >
> > Relevant snippet:
> >
> > Caused by: java.lang.NullPointerException: Cannot invoke
> > "java.util.Set.add(Object)" because "this.artifacts" is null
> > at org.apache.maven.project.MavenProject.getArtifacts
> > (MavenProject.java:683)
> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.getPathElements
> > (AbstractJavadocMojo.java:2491)
> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.addJavadocOptions
> > (AbstractJavadocMojo.java:4550)
> > at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport
> > (AbstractJavadocMojo.java:1968)
> >
> > The fact that it was javadocs I think may be immaterial. It is certainly
> > the case that MavenProject is not thread safe. Maybe that's by design?
> > Should I file a bug?
> >
> > Best,
> > Laird
>
>
>
> --
> Elliotte Rusty Harold
> elharo@ibiblio.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: NPE in MavenProject (3.9.10) in parallel build
Posted by Elliotte Rusty Harold <el...@ibiblio.org>.
That shouldn't be possible, at least not with the code I see at head.
Please file a bug though a reproducible test case might be required to
do anything about this.
On Tue, Jul 1, 2025 at 1:26 AM Laird Nelson <lj...@gmail.com> wrote:
>
> Curious if people have seen this NPE before:
> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:9789
>
> We're running with -T8 (
> https://github.com/helidon-io/helidon/actions/runs/15985949089/job/45090504083?pr=10313#step:3:166).
> (Github Actions.)
>
> Relevant snippet:
>
> Caused by: java.lang.NullPointerException: Cannot invoke
> "java.util.Set.add(Object)" because "this.artifacts" is null
> at org.apache.maven.project.MavenProject.getArtifacts
> (MavenProject.java:683)
> at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.getPathElements
> (AbstractJavadocMojo.java:2491)
> at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.addJavadocOptions
> (AbstractJavadocMojo.java:4550)
> at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport
> (AbstractJavadocMojo.java:1968)
>
> The fact that it was javadocs I think may be immaterial. It is certainly
> the case that MavenProject is not thread safe. Maybe that's by design?
> Should I file a bug?
>
> Best,
> Laird
--
Elliotte Rusty Harold
elharo@ibiblio.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org