This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jredmine. See http://git.nuiton.org/jredmine.git commit 807623d94134c8bb589020d432cb93827c7aa846 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Mar 4 11:59:07 2015 +0100 add warning when publish attachment failed --- .../jredmine/plugin/PublishAttachmentsMojo.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java b/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java index c846205..06ad049 100644 --- a/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java +++ b/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java @@ -30,6 +30,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.nuiton.helper.plugin.CollectFilesMojo; import org.nuiton.jredmine.model.Attachment; +import org.nuiton.jredmine.service.RedmineServiceException; import org.nuiton.plugin.PluginHelper; import java.io.File; @@ -270,11 +271,21 @@ public class PublishAttachmentsMojo extends AbstractRedmineMojoWithProjectAndVer a.setToUpload(f); // do upload - Attachment result = service.addAttachment(projectId, releaseVersion.getName(), a); - long t1 = System.nanoTime(); - if (isVerbose()) { - getLog().info("done in " + PluginHelper.convertTime(t1 - t0) + ". attachment id : " + result.getId() + ", size : " + PluginHelper.convertMemory(result.getFilesize())); + try { + Attachment result = service.addAttachment(projectId, releaseVersion.getName(), a); + long t1 = System.nanoTime(); + if (isVerbose()) { + getLog().info("done in " + PluginHelper.convertTime(t1 - t0) + ". attachment id : " + result.getId() + ", size : " + PluginHelper.convertMemory(result.getFilesize())); + } + } catch (RedmineServiceException e) { + + getLog().warn(""); + getLog().warn(String.format("Could not upload attachment %s, may be the file length (%s) exceed the one authorized by the redmine instance.", f, f.length())); + getLog().warn(""); + throw e; + } + } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.