how to build project after code changes without mvn clean install?

13,326

Solution 1

You are probably looking for a hot deployment feature. When working wit ha webapp, in most cases it is not enough just to compile a java class - usually you have to create a war package, and nearly always you have to redeploy the new code to the app server.

mvn package should be enough to create the war. You don't need to run mvn clean as long as you don't remove or rename any file. That would make things faster.

To achieve hot deployment (i.e. to get the new code instantaneously on the web-engine dev server) you need to do do some extra work, however. Make sure you use the Google Plugin for Eclipse - you can use it along with maven. The plugin at least should take care of static files hot deployment. Running the application in debug mode with Eclipse helps a bit as well as it is capable of replacing the methods' bodies on the fly.

Find further information answers to this question.

Solution 2

I know this is a very old post but I recently came across this issue while working with STS and Websphere application server. Hope this helps anyone to come across this ancient relic of a post.

Have a look at the "FileSync" plugin in the Eclipse marketplace. It allows to sync your workspace files with external directories (think your application server). After you install "FileSync" you can configure it to "copy/paste" your workspace files directly to your application server's exploded .war directory. It might take a little playing around with to get your files copied in a j2ee compliant format but it worked like a charm for me. Once its configured you basically just update files, save them, and your application is ready to go!

Share:
13,326
Alejohuertas
Author by

Alejohuertas

Updated on June 26, 2022

Comments

  • Alejohuertas
    Alejohuertas almost 2 years

    I have a project in eclipse, a java app with appengine sdk and maven as my builder.

    The .class files are not refreshed until i launch clean install, so every change i do in code i have to run:

    • mvn clean install
    • mvn eclipse:clean
    • mvn eclipse:eclipse

    and then try to launch my app.

    Help me please it's really annoying. Thanks