You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@apache.org> on 2015/07/04 12:22:04 UTC
[jira] [Commented] (MDEPLOY-198) deploy:deploy in some cases upload
a file twice
[ https://issues.apache.org/jira/browse/MDEPLOY-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14613664#comment-14613664 ]
Robert Scholte commented on MDEPLOY-198:
----------------------------------------
{quote:title=comment from MDEPLOY-197}
Hi Robert Scholte,
thanks for the feedback.
I can't speak here for the deploy:deploy-file. However, the problem I reported in MDEPLOY-198 shows a valid use-case where a developer may not want to upload an artifact twice.
What happens is kind of simple. The default-deploy will be executed before the java-doc and sources are build. Therefore the default-deploy will not upload them and we simply can't put the generation of the files before the default-deploy because it's automatically attached. Hence we either need to set the generation of the java-doc to a different phase OR introduce an second configuration of a deploy. However, when we create an additional configuration, the artifacts will be uploaded twice (and the javadocs+sources).
When I add the configuration to skip the duplicate artifact, it will not be uploaded at all because the default-deploy and the custom-deploy share the same configuration (you can test this with my attached example).
I also think that it should be totally up the the pom-writer where he want's to create javadoc and source's (e.g. in deploy).
I haven't tested with deploy:file but I would say it's kind of the same problem here.
Maybe a more reliable test would be something like:
if the md5-sum of the artifact matches, skip the upload and not just skip it at all, if the artifact is present...
{quote}
Hi [~TheSnoozer], copied your comment to this issue.
thanks for the example (although it can't be built), it gave me enough info about your issue. However, I still don't understand why you chose to go for a second execution of the deploy goal, rather then changing the phases. Actually, the default phase for both {{sources:jar-no-fork}} and {{javadoc:jar}} is package. IMO after the {{package}} phase, the project should be in such a state that it shouldn't matter if you want to {{install}} or {{deploy}} this project. So by simplifying for {{pom.xml}} (remove the phases for the {{attach-sources}} and {{attach-javadoc}} executions and removing the whole executions-block from the maven-deploy-plugin) you will get the desired result.
> deploy:deploy in some cases upload a file twice
> -----------------------------------------------
>
> Key: MDEPLOY-198
> URL: https://issues.apache.org/jira/browse/MDEPLOY-198
> Project: Maven Deploy Plugin
> Issue Type: Bug
> Components: deploy:deploy
> Affects Versions: 2.8.2
> Reporter: S L
> Priority: Minor
> Attachments: hello-maven-plugin.zip
>
>
> This is a similar issue to MDEPLOY-197 and if you feel that is this is the same problem feel free to close it as duplicate.
> However, in some cases when using the maven-deploy-plugin the artificat will be uploaded twice. Example will be attached.
> In my example I craft sources & javadoc in the deploy-phase and have an additional maven-deploy-plugin-definition which also be be executed in deploy. However the default-deploy will upload the final artifact as well as my custom tailored maven-deploy-plugin-definition and therefore the artifcat will be uploaded twice.
> In the zip there is also the build log where I replaced all sensitive information.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)