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

Fix parallel builds [DI-128] #75

Merged
merged 1 commit into from
May 24, 2024
Merged

Fix parallel builds [DI-128] #75

merged 1 commit into from
May 24, 2024

Conversation

kwart
Copy link
Contributor

@kwart kwart commented May 24, 2024

Fixes cryptic errors in other plugins when the multimodule project is built using a parallel build.

E.g.

$ mvn -T0.5C clean install -DskipTests
....
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/frantisek/work/hz/repos/hazelcast-mono/hazelcast/hazelcast-spring/src/test/java/com/hazelcast/NoMixedJUnitAnnotationsInOurTestSourcesTest.java:[19,35] package com.hazelcast.test.archunit does not exist
[ERROR] /home/frantisek/work/hz/repos/hazelcast-mono/hazelcast/hazelcast-spring/src/test/java/com/hazelcast/NoMixedJUnitAnnotationsInOurTestSourcesTest.java:[20,35] package com.hazelcast.test.archunit does not exist

....
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project hazelcast-jet-csv: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile failed: Cannot invoke "java.io.File.getPath()" because "element" is null -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project hazelcast-jet-s3: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile failed: Cannot invoke "java.io.File.getPath()" because "element" is null -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project hazelcast-jet-avro: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile failed: Cannot invoke "java.io.File.getPath()" because "element" is null -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project hazelcast-jet-cdc-debezium: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile failed: Cannot invoke "java.io.File.getPath()" because "element" is null -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:testCompile (default-testCompile) on project hazelcast-spring: Compilation failure: Compilation failure: 
[ERROR] /home/frantisek/work/hz/repos/hazelcast-mono/hazelcast/hazelcast-spring/src/test/java/com/hazelcast/NoMixedJUnitAnnotationsInOurTestSourcesTest.java:[19,35] package com.hazelcast.test.archunit does not exist
[ERROR] /home/frantisek/work/hz/repos/hazelcast-mono/hazelcast/hazelcast-spring/src/test/java/com/hazelcast/NoMixedJUnitAnnotationsInOurTestSourcesTest.java:[20,35] package com.hazelcast.test.archunit does not exist

@kwart kwart merged commit 30f79f1 into hazelcast:main May 24, 2024
2 checks passed
@kwart kwart deleted the fix/DI-128 branch May 24, 2024 23:00
@JackPGreen
Copy link
Contributor

@kwart are you able to describe what caused the issue please and how it was addressed?

@kwart
Copy link
Contributor Author

kwart commented May 27, 2024

@kwart are you able to describe what caused the issue please and how it was addressed?

During the parallel build, it sometimes happened that the artifacts within Set<Artifact> MavenProject.artifacts returned null when Artifact.getFile() was called. Some plugins don't have a null check and fail with NPEs.

My hypothesis is that the dependencies within the project (i.e. a submodule depending on another one) caused the troubles. The plugin now skips dependencies that have groupId:artifactId belonging to one of submodules. So the main part of the fix is she skip in https://github.com/hazelcast/attribution-maven-plugin/pull/75/files#diff-e69ba7d4e67ec4d2c25fdbcc0520e9b0f33ad311cb77ec3959300380fd9f89bfR45-R49

@kwart
Copy link
Contributor Author

kwart commented May 27, 2024

devOpsHazelcast pushed a commit to hazelcast/hazelcast that referenced this pull request May 31, 2024
…2072)

The `attribution-maven-plugin` in version `1.2.1` caused unresolved
artifacts files to be present in the `MavenProject` artifacts. It
sometimes led to `NullPointerException` in other plugins when a parallel
build was used.

The behavior was fixed on the plugin side:
* hazelcast/attribution-maven-plugin#75
* hazelcast/attribution-maven-plugin#76

This commit also takes action to speed up standard builds by
skipping the full attribution file generation. The proper attribution
file content is only generated during deployments and releases.

---------

Co-authored-by: Jack Green <[email protected]>
GitOrigin-RevId: 650bd7eab7ea424e2e0297843573dcd9939ccc51
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

Successfully merging this pull request may close these issues.

2 participants