File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes A set of questions on Maven. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "A set of questions on Maven." Watch "A set of questions on Maven." New topic
Author

A set of questions on Maven.

Dmitry Zhuravlev
Ranch Hand

Joined: Apr 14, 2010
Posts: 93
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

Joined: May 26, 2003
Posts: 31062
    
232

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10288
    
168

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.


[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10288
    
168

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

Joined: Jul 20, 2005
Posts: 10288
    
168

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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A set of questions on Maven.