Skip to content

Edit support for proxy configuration in modules for multi module project #146

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nitinp19
Copy link

@nitinp19 nitinp19 commented Jul 18, 2025

  • All tests passed. If this feature is not already covered by the tests, I added new
    tests.

Problem Statement -
The Gradle Artifactory Plugin fails to recognize proxy configurations defined in the build.gradle files for respective modules within a multi-module project.

Solution -
We fix this by ensuring the task receives the module specific properties, allowing it to apply the correct configurations.

@nitinp19 nitinp19 added the bug Something isn't working label Jul 18, 2025
Copy link

github-actions bot commented Jul 18, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@nitinp19 nitinp19 added the safe to test Approve running tests on a pull request label Jul 18, 2025
@github-actions github-actions bot removed the safe to test Approve running tests on a pull request label Jul 18, 2025
@nitinp19
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@nitinp19 nitinp19 changed the title Edit support for proxy configuration for different modules in multi module project Edit support for proxy configuration in modules for multi module project Jul 18, 2025
project.getGradle().projectsEvaluated(projectsEvaluatedBuildListener::projectsEvaluated);

// Set build started if not set
Copy link

Choose a reason for hiding this comment

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

Why is this change Moving buildStarted info into restricting it for root project required?

Copy link
Author

@nitinp19 nitinp19 Jul 22, 2025

Choose a reason for hiding this comment

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

isn't this inly suppose to happen only for the build info?

Copy link
Author

Choose a reason for hiding this comment

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

I have also checked it is not providing the build info to the root project. On contrary, there is no build info which gets created for the modules. Let me revert back the changes as it is not related to this feature.

orderedTasks.forEach(t -> {
ArtifactoryPluginConvention convention = ExtensionsUtils.getExtensionWithPublisher(t.getProject());
if (convention != null) {
DeployUtils.deployTaskArtifacts(convention.getClientConfig(), propsRoot, allDeployDetails, t, null);
Copy link

Choose a reason for hiding this comment

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

Do we need to update config other sub modules as well ? instead of only the configured sub module?

Copy link
Author

Choose a reason for hiding this comment

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

as per the current design the submodule config will not get cascaded from the parent module. only if it defined at the root project it will get cascaded in the submodules.

@@ -83,6 +83,7 @@ public static void addExtractModuleInfoTask(TaskProvider<ArtifactoryTask> collec
extractModuleTask.mustRunAfter(project.getTasks().withType(ArtifactoryTask.class));
});
TaskProvider<ExtractModuleTask> finalTaskProvider = taskProvider;
// we are not adding the extractModuleTask as a dependency or else it will run before the artifactoryTask, addDeploymentTask will take care of the execution
Copy link

Choose a reason for hiding this comment

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

while reading code it will be tough to understand what is extractModuleTask, artifactoryTask, addDeploymentTask. Lets elaborate more.

@@ -52,8 +53,9 @@ public FileCollection getModuleInfoFiles() {
public void extractBuildInfoAndDeploy() throws IOException {
log.debug("Extracting build-info and deploying build details in task '{}'", getPath());
ArtifactoryClientConfiguration accRoot = ExtensionsUtils.getArtifactoryExtension(getProject()).getClientConfig();
// Deploy Artifacts to artifactory
// We should ensure that the actual project configuration should be passed to deploy task, but it might be possible that publish task for the modules are not evaluated yet.
Copy link

Choose a reason for hiding this comment

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

is it like "ensure root project configuration should be passed?"
and "it is possible that publish task for the sub modules are not evaluated yet" ? Can you review the comment again.

Copy link
Author

Choose a reason for hiding this comment

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

yes, because at this time it might be possible that artifactory task are not available but orderedTasks.forEach() this will ensure that artifactory task is available for the execution. I can remove this comment as this was for my reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants