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

NCL-7185: Ignore overrideTransitive if dependencySource=NONE #386

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.commonjava.maven.ext.common.json.PME;
import org.commonjava.maven.ext.common.util.JSONUtils;
import org.commonjava.maven.ext.core.groovy.InvocationStage;
import org.commonjava.maven.ext.core.state.DependencyState;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Dependency;
Expand Down Expand Up @@ -592,11 +593,13 @@ private Map<RelaxedProjectVersionRef, ProjectVersionRef> getDependencies(Project
}
Set<ResolvedDependency> target;
if (internalConfig.overrideTransitive() == null || !internalConfig.overrideTransitive()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the original code, but it looks like this outer if was never necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, disregard.

// Check for shadow jar configuration.
if (internalConfig.overrideTransitive() == null &&
project.getPluginManager().hasPlugin("com.github.johnrengelman.shadow")) {
// Check for shadow jar configuration.
throw new ManipulationUncheckedException(
"Shadow plugin (for shading) configured but overrideTransitive has not been explicitly enabled or disabled.");
if (internalConfig.dependencyConfiguration() != DependencyState.DependencyPrecedence.NONE) {
throw new ManipulationUncheckedException(
"Shadow plugin (for shading) configured but overrideTransitive has not been explicitly enabled or disabled.");
}
}
target = lenient.getFirstLevelModuleDependencies();
} else {
Expand Down