Open Zegveld opened 3 months ago
Can you provide an integration-test to demonstrate the issue?
It took me a while but I finally figured it out.
In our build we have a couple of optional jars which we include using maven dependencies, but these depend on a reactor project. If I exclude the implicit maven dependency in the product my build succeeds again.
I've created a reproducer for this issue, there I've just directly added the dependency in the product maven project.
My situation to be exact is the following:
module gid.a
.
module gid.b
(depends on gid.a
).
product includes gid.a
, and has gid.b
added as separate jar using a specific assembly configuration.
The severity for me has now decreased, because I've got a work-around:
<dependency>
<groupId>gid</groupId>
<artifactId>gid.b</artifactId>
<version>${project.version}</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>gid</groupId>
<artifactId>gid.a</artifactId>
</exclusion>
</exclusions>
</dependency>
With that exclusion set, gid.a
doesn't throw the reactor error anymore for the product.
When building our project including product the build crashes with the following error:
After debugging I found the following location where the normalizedArtifact is initialized: https://github.com/eclipse-tycho/tycho/blob/b110909834cc796cf8fc9fdc206b40771b71d152/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/ArtifactCollection.java#L65
Here is the location where the check exists: https://github.com/eclipse-tycho/tycho/blob/b110909834cc796cf8fc9fdc206b40771b71d152/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/ArtifactCollection.java#L184-L186
In my case the ones in classified collection know the mavenProject, and it is not
null
as defined for the normalizedArtifact at initialization.The thing I can't put my finger on is why this only happens consistently for this project and not others.
Perhaps this sanity check does not make sense for cases where the
normalizedArtifact.getMavenProject()
is not set? Or perhaps L65 should change into something like:That way the mavenProject should indeed be the same value.