jira-importer commented on issue #535: URL: https://github.com/apache/maven-deploy-plugin/issues/535#issuecomment-2771549703
**[Robert Scholte](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rfscholte)** commented {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... > Hi [TheSnoozer](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org