You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mariusz Smykuła (JIRA)" <ji...@apache.org> on 2017/05/30 12:28:04 UTC

[jira] [Commented] (MDEPLOY-150) deploy-file does not use repository in the same way as deploy

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

Mariusz Smykuła commented on MDEPLOY-150:
-----------------------------------------

One reason for not using {{{deploy}}} is to deploy only selected artifact from project.

For example I have microservices with big fat-jar and additional artifact like jar with contract definition. I need to deploy only jar with contract definition.  I don't need to deploy big-fat jar, because this jar is already deployed by jenkins to production.

Unfortunately there is no way to skip deploy selected artifacts... But, {{{deply-file}}} can read project configuration from {{{pom.xml}}} and should work....

> deploy-file does not use repository <url>  in the same way as deploy
> --------------------------------------------------------------------
>
>                 Key: MDEPLOY-150
>                 URL: https://issues.apache.org/jira/browse/MDEPLOY-150
>             Project: Maven Deploy Plugin
>          Issue Type: Bug
>          Components: deploy:deploy-file
>    Affects Versions: 2.7
>         Environment: Windows 7, Maven 2.2.1
>            Reporter: Kai Hofmann
>            Assignee: Robert Scholte
>            Priority: Critical
>
> We use an own lifecycle here which creates a zip file instead of a jar file.
> So we use {noformat}org.apache.maven.plugins:maven-install-plugin:install,org.apache.maven.plugins:maven-install-plugin:install-file{noformat} which installs the zip file correctly.
> Additionally I now wanted to also allow deploying of this zip file to nexus by:
> {noformat}org.apache.maven.plugins:maven-deploy-plugin:deploy,org.apache.maven.plugins:maven-deploy-plugin:deploy-file{noformat}
> in the pom I have then:
> {code:xml}
> 	<properties>
> 		<file>${project.build.directory}/${project.artifactId}-${project.version}.zip</file>
>         </properties>
> 	<build>
> 		<pluginManagement>
> 			<plugins>
> 				<plugin>
> 					<groupId>org.apache.maven.plugins</groupId>
> 					<artifactId>maven-install-plugin</artifactId>
>           <version>2.3.1</version>
> 					<executions>
> 						<execution>
> 							<id>install-service-zip</id>
> 							<goals>
> 								<goal>install-file</goal>
> 							</goals>
> 						</execution>
> 					</executions>
> 				</plugin>
>         
>         <plugin>
> 					<groupId>org.apache.maven.plugins</groupId>
> 					<artifactId>maven-deploy-plugin</artifactId>
>           <version>2.7</version>
> 					<executions>
> 						<execution>
> 							<id>deploy-service-zip</id>
> 							<goals>
> 								<goal>deploy-file</goal>
> 							</goals>
> 						</execution>
> 					</executions>
> 				</plugin>
> 			</plugins>
> 		</pluginManagement>
> {code}
> as well as settings for the repositories within the maven {{settings.xml}}.
> As said the install process works perfectly, but I have trouble with the {{deploy-file}}.
> When working without the {{deploy-file}} (only with the {{deploy}}) everything also works correct for the deployment.
> After adding the {{deploy-file}} as shown above I come into trouble, because beside the <file> property the deploy-plugin requests for the required <url> parameter.
> I wonder about this, because I assumed that the <url> parameter will come from the choosen repository (release vs snapshot) settings?
> When I set the <url> as property beside the <file> property, then I can deploy a snapshot.
> But to deploying snapshot/release this will not work.
> In {{deploy}} the url parameter is implicitly correctly choosen, why not in {{deploy-file}}? this would make the url parameter optional.
> So I see this as a bug/feature, because when deploy works in this way, then {{deploy-file}} should work analogous. Or have I missed something here?



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