Differenz between mvn clean install and mvn clean install deploy

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Differenz between mvn clean install and mvn clean install deploy

Oliver B. Fischer-2
Hi all,

I stumbled on a strange problem with Maven. Therefore I would like to
know if the following commands should have the same result or not:

1. mvn clean install deploy
2. mvn clean deploy

Best,

Oliver


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Differenz between mvn clean install and mvn clean install deploy

Marco Schulz
jupp they have the same result. because. frist both run the clean lifecycle then comes the build lifecycle wich step through all phases. install is defined before deploy. so you don't need to call it when you plan to deploy

keep in mind deploy is a publishing to a remote repository like nexus. you just see effects when you have the right to deploy artifacts there and they not hurt rhe deploy conventions.

install is a cipy to your local repository .m2

regards
.marco

Get Outlook for Android<https://aka.ms/ghei36>



From: Oliver B. Fischer
Sent: Monday, September 17, 23:53
Subject: Differenz between mvn clean install and mvn clean install deploy
To: Maven Users List


Hi all, I stumbled on a strange problem with Maven. Therefore I would like to know if the following commands should have the same result or not: 1. mvn clean install deploy 2. mvn clean deploy Best, Oliver --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Differenz between mvn clean install and mvn clean install deploy

Oliver B. Fischer-2
I thought so too but I have a project where calling mvn clean install
deploy causes Maven to use wrong paths for some modules. I think I
should create bug report for this.

Best,
Oliver

Am 18.09.18 um 00:02 schrieb Marco Schulz:

> jupp they have the same result. because. frist both run the clean lifecycle then comes the build lifecycle wich step through all phases. install is defined before deploy. so you don't need to call it when you plan to deploy
>
> keep in mind deploy is a publishing to a remote repository like nexus. you just see effects when you have the right to deploy artifacts there and they not hurt rhe deploy conventions.
>
> install is a cipy to your local repository .m2
>
> regards
> .marco
>
> Get Outlook for Android<https://aka.ms/ghei36>
>
>
>
> From: Oliver B. Fischer
> Sent: Monday, September 17, 23:53
> Subject: Differenz between mvn clean install and mvn clean install deploy
> To: Maven Users List
>
>
> Hi all, I stumbled on a strange problem with Maven. Therefore I would like to know if the following commands should have the same result or not: 1. mvn clean install deploy 2. mvn clean deploy Best, Oliver --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Differenz between mvn clean install and mvn clean install deploy

Manfred Moser-4
In reply to this post by Oliver B. Fischer-2
The difference is that the first invocation is just simply wrong. When you call a mvn lifecycle phase it will run through all prior phases. If you specify 2 lifecycle phase from the same lifecycle (the default cycle) .. you run through things twice..

E.g.

mvn install

runs

initialize, .. validate ..  compile, .... install

mvn deploy

runs

initialize, .. validate ..  compile, .... install deploy


So when you use

mvn install deploy

you get

initialize, .. validate ..  compile, .... install .. initialize, .. validate ..  compile, .... install .. deploy

As you can see you duplicate a whole lot of stuff and that lead to confusing results and issues.

So .. just do that and learn more about Maven lifecycle phases and such..

Manfred



Oliver B. Fischer wrote on 2018-09-17 14:53:

> Hi all,
>
> I stumbled on a strange problem with Maven. Therefore I would like to
> know if the following commands should have the same result or not:
>
> 1. mvn clean install deploy
> 2. mvn clean deploy
>
> Best,
>
> Oliver
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]