aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes recompile maven project 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 "recompile maven project" Watch "recompile maven project" New topic
Author

recompile maven project

Rakesh Basani
Ranch Hand

Joined: Jun 04, 2012
Posts: 38
Hi guys..

I am working on a spring maven project. Is it necessary to compile my project again if I change pom.xml. And exaplain the reason.


Thanks in advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16236
    
  21

Your POM defines how a project is built. If you change it, typically you are changing something about how the projects gets built. Therefore it's only logical that you would rebuild the project (recompile) to reflect those changes.


Customer surveys are for companies who didn't pay proper attention to begin with.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

I guess it depends on the change that you made and what your end goal is.

Did you add a dependency? Then maybe. I assume that the project built and the tests ran without it, so adding it might not have that much of an impact. But if you are packing your project using the asembly plugin and you noted that that dependency was missing, then yes re-run the build so that it gets included in the package.

Did you change the artifact's description? Then only if you plan to regenerate the site would you need to build again.

Did you add or change a plugin? Then yes because you have changed how the project gets built.

Did you change the version number. Then maybe. If other projects are already referencing yoru artifact by the new number then yes you must rebuild. If not, then you don't have to.

I could go on, but you probably get the idea.


JBoss In Action
 
Don't get me started about those stupid light bulbs.
 
subject: recompile maven project