-
Notifications
You must be signed in to change notification settings - Fork 65
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
Skip specified attached artifacts from deploy #3
base: master
Are you sure you want to change the base?
Conversation
First thanks for trying to contribute...(BTW: Can you read the informations about contribution etc. here https://github.com/apache/maven-help-plugin we have not yet added the information to all plugin repositories on github).. Maybe I misunderstand your idea...but if I have configured maven-shade-plugin to attach the artifact why should I skip deploying the artifact? Can you give an example of a real life scenario where this makes sense ? |
So added some information https://github.com/apache/maven-deploy-plugin/tree/MDEPLOY-239 ... |
Thank you for sharing and introducing informations about contribution on the project. I'll follow all the indicated procedure for possible future contributions. About needs that made me look for this solution I exposed my specific scenario as solution on the following thread on stackoverflow: Basically I needed to attach an uber jar artifact on my maven module without versioning it on my repository. Reason is that this artifact is then included as dependency into another module and this is the one uploaded on repository ( this will allow me to exclude transitive dependencies I had instead into the skipped one ). Moreover I found also that other people searched for this solution according to their needs. In general I think it could be useful for all that scenarios where user want to generate attached artifacts and just use these locally for some reason without uploading them on repository. |
Another practical use case, due to the constraints of our CI/CD system some of our projects use Apache Maven as the overarching build tool but use plugins to invoke other tools - Then for ease of integration testing within our large multi-modules builds we have these plugins attach Maven artifacts as well, this lets us then have other modules depend on those artifacts explicitly to enforce required module build order and that the developer activated the right profile. BUT we don't actually want to deploy these attached artifacts because the original artifacts e.g. the Docker images themselves are going to get deployed by non-Maven post-processing steps to their own appropriate repositories provided as part of our CI/CD system. TL;DR We use Maven to build non-Maven artifacts (e.g. Docker images) that don't want/need to be deployed to our Maven repository |
another usecase is i have a shaded artifact which i don't want to deploy to remote repository even i skip the main project artifact to deploy the rpm artifact but still the shaded artifact is deployed there! there must be a way to skip base in classifier. |
In my case, I produce an |
My use-case is that I generate a Spring Boot fat JAR with I can skip attaching the fat JAR (the plugin supports I just want a simple way to tell deploy-plugin, "don't deploy something". I don't want to go down a rabbit hole trying to stop stuff being attached in the first place. I could imagine a world where someone wants an artifact to be install-able but not deploy-able. In which case, not attaching the artifact is not a solution. @khmarbaise Can you please comment on this? You wanted a real-world use-case, and 5 people have now given you theirs. It's disappointing that a PR has been ready to go for 6 years and is still sitting here. I checked through it and it looks like a high-quality change. It has tests and updates to documentation. I'm happy to fix the conflicts. |
Suppose you have differents artifacts attached on a single Maven module. For example:
I've worked on my fork project in order to allow to specify artifacts to skip deploy for.
Here the usage example:
Implementing feature I took care of:
As result you will have the following output during execution:
[INFO]
[INFO] --- maven-deploy-plugin:3.0.3-SNAPSHOT:deploy (default-deploy) @ cc-manager4j ---
[INFO] Skipping artifact [com.group.test:test-artifact:jar:shaded:1.0-SNAPSHOT]
If attached artifact to skip doesn't exists the plugin will fail the execution:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.3-SNAPSHOT:deploy (default-deploy) on project cc-manager4j: No attached artifact com.group.test:test-artifact:zip:shaded:1.0-SNAPSHOT to exclude from deploy found -> [Help 1]
[ERROR]