You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Richard Sand (JIRA)" <ji...@apache.org> on 2017/03/19 19:12:41 UTC

[jira] [Commented] (MDEPLOY-131) use default repository when no url specified

    [ https://issues.apache.org/jira/browse/MDEPLOY-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15931887#comment-15931887 ] 

Richard Sand commented on MDEPLOY-131:
--------------------------------------

This thread has been inactive for a couple of years, but I'm guessing that the need for deploy-file to be able to use the existing project's default repositories is still out there. I've attached a very simple patch to enable this without changing the existing behavior of any current deployments. See the attachment "maven-deploy-useProjectRepo-20170319.patch"

The patch adds a new configuration parameter called "useProjectRepository" (default false of course). When set to true, it will use the project's default artifactresolver. It changes "url" from required to optional, but throws an error if "url" is missing and "useProjectRepository" isn't explicitly set to true, so it won't disrupt any current behavior.

I've used this new parameter in two of my company's projects to good effect. I use it in combination with maven shade plugin, to create multiple permutations of a shaded jar that includes different log capabilities (e.g. one has slf4j and slf4j-jcl, another has slf4j and jcl-over-slf4j, one has only slf4j, etc). I allow the shade plugin to create the dependency reduced pom, then deploy-file to attach the alternate jar and pom to a different artifact ID. It works great!

-Richard

> use default repository when no url specified
> --------------------------------------------
>
>                 Key: MDEPLOY-131
>                 URL: https://issues.apache.org/jira/browse/MDEPLOY-131
>             Project: Maven Deploy Plugin
>          Issue Type: Improvement
>          Components: deploy:deploy-file
>            Reporter: raymond domingo
>              Labels: contributers-welcome
>         Attachments: DeployFileMojo.java, patch_deploy_file_mojo.diff
>
>
> When using the deploy goal there is no need to specify the url of the repository.
> When using deploy-file you DO need to specify the url. This is a problem, because during development I like to deploy to snapshot repository and when releasing i deploy to release repository and I can't add this logic to the pom.
> Thas is why I like the url paramter to become optional (backwards compatible) and add default behaviour when it is null. It should just like the deploy plugin use the default repository. Snapshot for snapshots and release for none snapshot versions.
> I added a patch file fixing this.
> I also added complete source of patched Mojo



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)