• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Maven compilation in Eclipse

Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Team ,

I am completely new to Maven.In my project I have downloaded the project modules from GIT.I have done the "maven clean install" in command prompt and successfully war file generated.I imported that maven project module in Eclipse as import as Maven project .Kindly clarify my following doubts.

My Doubt-

1) If I want to change some code in eclipse ,how can build that file to be reflected the changes in workspace.(Through "maven compile"  in command prompt or maven build  in eclipse)

2)Once I build that file ,do I need to run again maven clean install so that the war file need to be updated with the changes?If It require to run clean install ,where do I need to run....In eclipse or Command prompt.
Saloon Keeper
Posts: 24501
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Deepak!

It makes no difference whether you run Maven from a command line or within Eclipse.

Eclipse will recompile classes when you change them, and if your project is set up properly, the output of the compiler will go into the Maven target/classes directory, so that's all good.

Eclipse will not, however, build the WAR automatically. You don't have to run maven's "clean" goal, but to rebuild the WAR, you need to run the "war:war" goal or a goal such as "package" that invokes the war:war goal as a sub-goal.

Run Maven clean when you want to be sure that any "dead" files (classes and/or property/data files) that go into the WAR will be removed. Maven won't remove them automatically.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic