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

[JENKINS-55816] Publish over FTP fails on multi-module project when modules skipped #69

Closed
jira-importer opened this issue Jan 28, 2019 · 10 comments

Comments

@jira-importer
Copy link
Collaborator

I have a multi-module project that is built with Jenkins/Maven. When doing a release build, in the cleanup phase, only the top module results in SUCCESS, while the other modules get a SKIPPED, simply because there is nothing to do for them. This looks like this, for example:

[INFO] Reactor Summary:
[INFO] 
[INFO] Main Module #1 .................................... SUCCESS [6:40.776s]
[INFO] Module #2 ......................................... SKIPPED
[INFO] Module #3 ......................................... SKIPPED
[INFO] Module #4 ......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

 

It's actually not a problem. The overall result is SUCCESS. However, the Publish Over FTP plugin does not seem to look at the overall result, but seems to see only that some steps did have resulted in something different from SUCCESS, so erroneously assumes a build problem and does not upload the artifacts:

FTP: Current build result is [NOT_BUILT], not going to run.
[M2Release] assigning keep build to current build.
channel stopped
Finished: SUCCESS.

There doesn't seem to be a way to work around this, so I hope for a fix in the Publish Over FTP plugin.

 

 


Originally reported by mesa, imported from: Publish over FTP fails on multi-module project when modules skipped
  • assignee: slide_o_mix
  • status: Closed
  • priority: Critical
  • resolution: Duplicate
  • resolved: 2019-02-15T00:27:49+11:00
  • imported: 2022/01/10
@jira-importer
Copy link
Collaborator Author

mesa:

According to the very similar issue described in JENKINS-16240, it may not actually happen always when modules are skipped. In fact, I have another Jenkins build with skipped modules, and there, the FTP takes place as expected.

How's the NOT_BUILT determined?

@jira-importer
Copy link
Collaborator Author

@jira-importer
Copy link
Collaborator Author

mesa:

Thanks. Does not give me any more insight, though. It works okay when building snapshots, but fails on releases. Does it refer to the snapshot build only somehow?

However, I wonder why the plugin checks the build result, because when configuring the FTP step in the build, the user selects between "Run only if build succeeds", "Run only if build succeeds or is unstable", "Run regardless of build result". The fact that the plugin tries to act according to the build result is actually confusing. For example, I tried it with "Run regardless of build result", but the plugin insists on making its own decision and ignores my wish.

I think the plugin itself should not check the build result at all.

@jira-importer
Copy link
Collaborator Author

slide_o_mix:

That option is not part of the plugin itself, and the plugin is used in more than just Maven builds, so I can't really remove it. I am not very familiar with Maven jobs, so I am not sure what will need to be done here. I will need to look into it further.

@jira-importer
Copy link
Collaborator Author

mesa:

You've linked to the Jenkins plugin, so I assumed that this was a Jenkins functionality. In the context of Jenkins, I think it would make sense not to determine the build success within the plugin, but instead let Jenkins take care of that.

However, maybe it's an idea to create a new option (tickbox) to let the user decide whether the plugin should check the build result or not?

@jira-importer
Copy link
Collaborator Author

slide_o_mix:

Again, the option to only do things on success, etc is specific to Maven builds. The plugin MUST look at the build status for other builds types. I will look into different options.

@jira-importer
Copy link
Collaborator Author

mesa:

I see what you mean.  

Just FYI, I've found another variation of this problem here. It looks like the getResult() method returns only the result of the last module/component?

@jira-importer
Copy link
Collaborator Author

mesa:

FYI, I've created a local patch, commenting out the check for build success. Doing so, I've noticed that it's also required to remove the build status update (last few lines in perform method), because it used the wrong NOT_BUILT status it had determined from the previous step to update the status of the whole build to NOT_BUILT, causing the build to be considered failed.

@jira-importer
Copy link
Collaborator Author

slide_o_mix:

The logic for this is in the parent "publish-over" plugin, so the same issue is affecting both SSH and FTP (also CIFS would be affected as well).

@jira-importer
Copy link
Collaborator Author

[Originally related to: JENKINS-16240]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant