Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 251
Alejohuertas Avatar asked Aug 31 '12 20:08

Alejohuertas


People also ask

Is mvn clean necessary?

On Maven, each time you want to compile, the best practice is to run mvn clean . It clears out the existing classes that you compiled from last compile. If you don't want to run 3 lines, just do "mvn test" after mvn clean . You don't have to always do mvn compile .

What is the difference between Maven build and Maven clean?

mvn clean: Cleans the project and removes all files generated by the previous build. mvn compile: Compiles source code of the project.

What is the difference between Maven clean and Maven install?

clean is its own build lifecycle phase (which can be thought of as an action or task) in Maven. mvn clean install tells Maven to do the clean phase in each module before running the install phase for each module.

What command is used to install Maven which is necessary for the build process?

mvn clean install is the command to do just that. You are calling the mvn executable, which means you need Maven installed on your machine. (see How do you install Maven?) You are using the clean command, which will delete all previously compiled Java .


1 Answers

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!

like image 176
Jason Avatar answered Nov 14 '22 23:11

Jason