Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A set of questions on Maven.

 
Dmitry Zhuravlev
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings!

Need help with a set of quesions on Maven!

1) As far as I understand, Maven always takes all artefacts from local repo. But the repo itself is not updated while I call the build. Maven is not checking whether the downloaded version of that artifact is the most fresh. The only way to correct it is to build with -U prefix. Is it correct?

2) My build failed during the INSTALL phase. I corrected the error and tried to repeat the command with -rf parameter, but Maven said I have an error in command. How can I force Maven continue the build not from some module, but from some phase?

3) One of my artifacts in the repo is called 1.x-Snapshot-... + lastUpdated. I.e. Maven has added "lastUpdated" to my artifact. Why?

4) Whats the difference (or correlations) between the mvn DEPLOY phase and Maven Release Plugin? When should I use that plugin?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Almost. For snapshots, Maven will check Maven Central (or Nexus or where ever you are hosting) every so often. HOw often "every so often" is is defined in your Maven settings under updatePolicy. For releases, Maven will not check because releases are final.

2) What error did Maven give?

3) No idea. I look forward to learning the answer.

4) I believe deploy just installs the artifact in the remote repository whereas the release plugin takes care of tagging it/updating the pom/etc first.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dmitry Zhuravlev wrote:

3) One of my artifacts in the repo is called 1.x-Snapshot-... + lastUpdated. I.e. Maven has added "lastUpdated" to my artifact. Why?

Snapshots, unlike released artifacts, are specific to a certain time and can have changes for the same snapshot version. For example, at 1.0.0-SNAPSHOT version at 12:22 PM might not be the same as a 1.0.0-SNAPSHOT version at 12:50 PM. Maven adds that timestamp for such snapshots, although I remember there's an option where you can configure Maven to not add that.

 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:

4) I believe deploy just installs the artifact in the remote repository whereas the release plugin takes care of tagging it/updating the pom/etc first.


That's correct. "deploy" just deploys it to a repository. The target repository can either be configured to be local filesystem or a remote repository. A release plugin on the other hand goes to a variety of other steps including some version control steps like tagging, then checking out from that tag, building from that tag and deploying from that tag.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tried to repeat the command with -rf parameter, but Maven said I have an error in command. How can I force Maven continue the build not from some module, but from some phase?


-rf is not for building from a specific phase, instead its for resume from a specific module (in a multi module project).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic